Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Show all active TSO user
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 55
Location: Germany

PostPosted: Tue Nov 16, 2010 11:59 pm    Post subject: Show all active TSO user
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: 2360
Location: Israel

PostPosted: Wed Nov 17, 2010 12:23 am    Post subject:
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: 645
Location: Pennsylvania

PostPosted: Wed Nov 17, 2010 1:01 am    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Wed Nov 17, 2010 1:09 am    Post subject:
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: 645
Location: Pennsylvania

PostPosted: Wed Nov 17, 2010 1:11 am    Post subject:
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: 2360
Location: Israel

PostPosted: Wed Nov 17, 2010 1:29 am    Post subject:
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: 55
Location: Germany

PostPosted: Wed Nov 17, 2010 1:15 pm    Post subject:
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: 2360
Location: Israel

PostPosted: Wed Nov 17, 2010 1:25 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Nov 17, 2010 1:28 pm    Post subject:
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: 55
Location: Germany

PostPosted: Wed Nov 17, 2010 7:40 pm    Post subject:
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    Post subject:
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 User


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

PostPosted: Tue Nov 11, 2014 1:54 am    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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 User


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

PostPosted: Tue Nov 11, 2014 6:49 pm    Post subject:
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

Senior Member


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

PostPosted: Tue Nov 11, 2014 10:18 pm    Post subject: Reply to: Show all active TSO user
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 User


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

PostPosted: Tue Nov 11, 2014 11:48 pm    Post subject:
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    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts SORT - E15 and E35 using same user ex... Abhi Nature DFSORT/ICETOOL 12 Mon Oct 03, 2016 4:33 pm
No new posts How to show message using batch jobs madprasy TSO/ISPF 7 Fri Sep 09, 2016 6:55 pm
No new posts User exit in COBOL programs ganasrinivasan PL/I & Assembler 0 Thu Aug 18, 2016 12:48 pm
No new posts Data set is allocated to another job ... Seppe CLIST & REXX 2 Wed Aug 03, 2016 4:31 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us