IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Show all active TSO user


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 64
Location: Germany

PostPosted: Tue Nov 16, 2010 11:59 pm
Reply with quote

Hi,

... is it possible to show all active TSO user with REXX ?

Thanks in advance
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Nov 17, 2010 12:23 am
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Nov 17, 2010 1:01 am
Reply with quote

Try in SDSF (if you have it), on the command line:

DA OTSU
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Nov 17, 2010 1:09 am
Reply with quote

daveporcelan wrote:
DA OTSU

Every time I see that, I can't help but mistake it for dai otaku icon_lol.gif
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Nov 17, 2010 1:11 am
Reply with quote

I did not notice he wanted it with rexx. My error.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Nov 17, 2010 1:29 am
Reply with quote

You mau also invoke SDSF from within REXX... icon_lol.gif

O.
Back to top
View user's profile Send private message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 64
Location: Germany

PostPosted: Wed Nov 17, 2010 1:15 pm
Reply with quote

Hi all,

the rexx is exactly what I need, many thanks ! icon_smile.gif
Where can I get more information about the MVS control blocks to understand rexx ?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Nov 17, 2010 1:25 pm
Reply with quote

As always, it's all in the fine manual.

O.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Nov 17, 2010 1:28 pm
Reply with quote

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
View user's profile Send private message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 64
Location: Germany

PostPosted: Wed Nov 17, 2010 7:40 pm
Reply with quote

Thanks a lot ! icon_biggrin.gif
Back to top
View user's profile Send private message
B.Fischer-Bossert

New User


Joined: 06 Nov 2014
Posts: 8
Location: Germany

PostPosted: Mon Nov 10, 2014 8:30 pm
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue Nov 11, 2014 1:54 am
Reply with quote

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
View user's profile Send private message
B.Fischer-Bossert

New User


Joined: 06 Nov 2014
Posts: 8
Location: Germany

PostPosted: Tue Nov 11, 2014 3:46 pm
Reply with quote

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
View user's profile Send private message
B.Fischer-Bossert

New User


Joined: 06 Nov 2014
Posts: 8
Location: Germany

PostPosted: Tue Nov 11, 2014 4:36 pm
Reply with quote

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
View user's profile Send private message
B.Fischer-Bossert

New User


Joined: 06 Nov 2014
Posts: 8
Location: Germany

PostPosted: Tue Nov 11, 2014 5:10 pm
Reply with quote

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
View user's profile Send private message
B.Fischer-Bossert

New User


Joined: 06 Nov 2014
Posts: 8
Location: Germany

PostPosted: Tue Nov 11, 2014 5:33 pm
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue Nov 11, 2014 6:49 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Tue Nov 11, 2014 10:18 pm
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue Nov 11, 2014 11:48 pm
Reply with quote

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
View user's profile Send private message
B.Fischer-Bossert

New User


Joined: 06 Nov 2014
Posts: 8
Location: Germany

PostPosted: Wed Nov 12, 2014 8:22 pm
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Nov 12, 2014 8:55 pm
Reply with quote

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
View user's profile Send private message
B.Fischer-Bossert

New User


Joined: 06 Nov 2014
Posts: 8
Location: Germany

PostPosted: Thu Nov 13, 2014 5:03 pm
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu Nov 13, 2014 5:54 pm
Reply with quote

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
View user's profile Send private message
B.Fischer-Bossert

New User


Joined: 06 Nov 2014
Posts: 8
Location: Germany

PostPosted: Thu Nov 13, 2014 6:47 pm
Reply with quote

Thank you, it's more than 20 years that I was involved in assembler coding ... and I forgot some details.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts user exit in IBM Infosphere Optim DB2 8
No new posts Running a Job with the Default User ID JCL & VSAM 2
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
Search our Forums:

Back to Top