View previous topic :: View next topic
|
Author |
Message |
oerdgie
New User
Joined: 22 Nov 2007 Posts: 64 Location: Germany
|
|
|
|
Hi,
... is it possible to show all active TSO user with REXX ?
Thanks in advance |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Try this:
Code: |
/* REXX */
O = 0
SAY 'Currently active users:'
SAY '-----------------------'
CVT=PTR(16) /* GET CVT */
ASVT=PTR(CVT+556)+512 /* GET ASVT */
ASVTMAXU=PTR(ASVT+4) /* GET MAX ASVT ENTRIES */
DO A = 0 TO ASVTMAXU - 1
ASCB=STG(ASVT+16+A*4,4) /* GET PTR TO ASCB (SKIP
MASTER) */
IF BITAND(ASCB,'80000000'X) = '00000000'X THEN /* IF IN USE */
DO
ASCB=C2D(ASCB) /* GET ASCB ADDRESS */
CSCB=PTR(ASCB+56) /* GET CSCB ADDRESS */
CHTRKID=STG(CSCB+28,1) /* CHECK ADDR SPACE TYPE */
IF CHTRKID='01'X THEN /* IF TSO USER */
DO
ASCBJBNS=PTR(ASCB+176) /* GET ASCBJBNS */
ASCBSRBT=PTR(ASCB+200) /* GET ASCBEATT */
O = O + 1
SAY RIGHT(O,2,'0') ASCBSRBT,
STG(ASCBJBNS,8) /* WE IS SOME HAPPY CAMPER! */
END
END
END
EXIT
/*-------------------------------------------------------------------*/
PTR: RETURN C2D(STORAGE(D2X(ARG(1)),4)) /* RETURN A POINTER */
/*-------------------------------------------------------------------*/
STG: RETURN STORAGE(D2X(ARG(1)),ARG(2)) /* RETURN STORAGE */
/*-------------------------------------------------------------------*/
|
|
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Try in SDSF (if you have it), on the command line:
DA OTSU |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
daveporcelan wrote: |
DA OTSU |
Every time I see that, I can't help but mistake it for dai otaku |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
I did not notice he wanted it with rexx. My error. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You mau also invoke SDSF from within REXX...
O. |
|
Back to top |
|
|
oerdgie
New User
Joined: 22 Nov 2007 Posts: 64 Location: Germany
|
|
|
|
Hi all,
the rexx is exactly what I need, many thanks !
Where can I get more information about the MVS control blocks to understand rexx ? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
MVS Data Areas Volume 1
MVS Data Areas Volume 2
MVS Data Areas Volume 3
MVS Data Areas Volume 4
MVS Data Areas Volume 5
MVS Data Areas Volume 6
Oops Ofer, you took already care of that one. |
|
Back to top |
|
|
oerdgie
New User
Joined: 22 Nov 2007 Posts: 64 Location: Germany
|
|
|
|
Thanks a lot ! |
|
Back to top |
|
|
B.Fischer-Bossert
New User
Joined: 06 Nov 2014 Posts: 8 Location: Germany
|
|
|
|
Thank you for your program. It's working fine but on one one of our systems there is displayed one very special user:
...
09 0 RACFCO6
10 0 OPR0037
11 0 : :::
12 0 PRD0322
13 0 PRD5117
...
Does anyone have an idea what this user " : :::" may be? |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
I think a better source for the userid would be at CSCB+8 (CHKEY) rather than ASCBJBNS. I have Assembler code that does more or less the same thing and that's where I get the userid. |
|
Back to top |
|
|
B.Fischer-Bossert
New User
Joined: 06 Nov 2014 Posts: 8 Location: Germany
|
|
|
|
Meaning "CHKEY=PTR(ASCB+64)"? I am sorry but this gets me a lot of colons and blanks for all users. Some get a "0" or a double quote, too. |
|
Back to top |
|
|
B.Fischer-Bossert
New User
Joined: 06 Nov 2014 Posts: 8 Location: Germany
|
|
|
|
Sorry, found it. It has to be "CHKEY=STG(CSCB+8,8)". This day the special user is not there so I cannot say what its CHKEY may be. |
|
Back to top |
|
|
B.Fischer-Bossert
New User
Joined: 06 Nov 2014 Posts: 8 Location: Germany
|
|
|
|
What I found, too, is the field containing the logon procedure "CHCLS=STG(CSCB+16,8)". But now I am searching for what is named in "DA OTSU" as "ProcStep" and the VTAM Session Id. Does someone know where to find them? It seems to me that both fields are not located in the CSCB. |
|
Back to top |
|
|
B.Fischer-Bossert
New User
Joined: 06 Nov 2014 Posts: 8 Location: Germany
|
|
|
|
In another system the special user now shows twice. But the CHKEY and CHCLS fields are empty in both cases. What's that, a TSO session cancelled? |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
This is the Assembler code. The test for a valid ASCB pointer is a little different than the Rexx code, and it validates ASCBCSCB, which the Rexx code does not.
Code: |
* OBTAIN THE TSO USERS
L 2,CVTASVT-CVTMAP(,10) LOAD ADDR OF THE ASVT
L 3,ASVTMAXU-ASVT(,2) LOAD NUMBER OF ASCB ENTRIES
LA 2,ASVTENTY-ASVT(,2) LOAD ADDR OF THE FIRST ASCB POINTER
FINDTSOU ICM 4,B'1111',0(2) LOAD AN ASCB ADDRESS
BNP SKIPASCB BR IF THERE IS AN ADDRESS
ICM 5,B'1111',ASCBCSCB-ASCB(4) LOAD A CSCB ADDRESS
BZ SKIPASCB BR IF NO CSCB
CLI CHTRKID-CHAIN(5),CHTSID TEST IF THIS IS A TSO USER
BNE SKIPASCB BR IF NOT
...
SKIPASCB LA 2,4(,2) COMPUTE ADDR OF THE NEXT ASCB ADDR
BCT 3,FINDTSOU GO CHECK IT |
The comment on the BNP SKIPASCB instruction is incorrect. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
The comment on the BNP SKIPASCB instruction is incorrect. |
It is odd that you knew it was incorrect but did not fix it while posting. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Pedro - the program is a little over a year old; it looks like the last time it was touched was August last year. I probably run the code at least once a day.
I only noticed the bad comment after I extracted the section of the code in the post and after I sent the post. There are just a few lines of code in the missing section that are not of interest or value here. |
|
Back to top |
|
|
B.Fischer-Bossert
New User
Joined: 06 Nov 2014 Posts: 8 Location: Germany
|
|
|
|
Thank you for these assembler lines. I tried to see what you meant with:
Code: |
SAY RIGHT(D2X(CSCB-ASCB),8,'0') |
but I do not get a null pointer for my special user(s).
But:
B.Fischer-Bossert wrote: |
What I found, too, is the field containing the logon procedure "CHCLS=STG(CSCB+16,8)". But now I am searching for what is named in "DA OTSU" as "ProcStep" and the VTAM Session Id. Does someone know where to find them? It seems to me that both fields are not located in the CSCB. |
Has anyone a solution for this? |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Don't know where you can find them, but you can get descriptions of the fields from: From a DA OTSU panel hit F1:
Code: |
HELP HELP: Display Active Users Panel
COMMAND INPUT ===>
Select a topic by number, or press Enter to view them in sequence.
1 - Introduction to the DA panel
2 - Syntax of the DA command
3 - Action characters: display output, cancel jobs, etc.
4 - Fields on the DA panel
5 - Overtyping fields to change their values
6 - Commands: limit jobs displayed, search, etc.
These topics are displayed only if selected:
97 - What's new
98 - Search and navigate the help
99 - Messages
F1 = Help F10 = Previous Enter = Forward
F3 = Exit F7 = Up TOC = Menu |
Option 4 will tell you. |
|
Back to top |
|
|
B.Fischer-Bossert
New User
Joined: 06 Nov 2014 Posts: 8 Location: Germany
|
|
|
|
Thank you, but that "ProcStep" means the session's terminal ID on TSO sessions is nothing new to me.
I want to get the information what I can find only on this VTAM command (TATOG072 is listed as "ProcStep"):
and
D NET,SESSIONS,LIST=ALL
IST097I DISPLAY ACCEPTED
IST350I DISPLAY TYPE = SESSIONS 704
IST873I PLU SLU SID STATUS
IST874I DEVISAFF.NDMT DEVISAFF.NDMTI001 D17F2A912103DAA9 ACTIV
IST874I DEVISAFF.TSOT01 DEVISAFF.TATOG072 D17F2A912103DAA6 ACTIV
... |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
The VTAM session ID is in the "Terminal Status Block" (TSB). It won't do the Rexx user much good; the TSB is in protected storage.
In Assembler code, when you see something like
ICM 5,B'1111',ASCBCSCB-ASCB(4)
it's equivalent to
USING ASCB,4
ICM 5,B '1111',ASCBCSCB
DROP 4
Many Assembler programmers prefer one line rather than the USING ... DROP sequence |
|
Back to top |
|
|
B.Fischer-Bossert
New User
Joined: 06 Nov 2014 Posts: 8 Location: Germany
|
|
|
|
Thank you, it's more than 20 years that I was involved in assembler coding ... and I forgot some details. |
|
Back to top |
|
|
|