MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to know whether a user is connected to mainframe.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
bade_miya
Beginner


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Thu Sep 16, 2004 4:39 am    Post subject: How to know whether a user is connected to mainframe. Reply with quote

Hi guys,
How do you know whether a mainframe id is currently connected to a mainframe. Say i want to check whether one of the onsite guys are connected to mainframe or not. I know his mainframe id. Now what i does is that i will go and check in the spool(and give Pre mfid1*) to see whether his master session is active(the one with priority 15). What i need to know is whether we can do it programatically.

I am planning to use a rexx utility in which i will specify his mainframe id as a parameter. This utility will check whether the guy is connected or not. if he is connected i will immideatly get a message. If it is not, it will wait for say 5 minuts and again check. This will continue till either i stop the utility or when the guy actually logs into the mainframe.

But how excatly will i check in the program whether his master session is active. Or should i have to submit a job for this? Can we do this? Or am i asking too much from rexx? Very Happy . I am just doing this for hobby purpose. Its not an urgent requirement or so. All inputs and suggestions are welcome.

thanks
bade_miya
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Sep 16, 2004 5:08 am    Post subject: Reply with quote

bade_miya,

Please search before posting. This has been discussed earlier. check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=2278&highlight=logged

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bade_miya
Beginner


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Thu Sep 16, 2004 9:05 am    Post subject: Reply with quote

Hi Kolusu,
thanks for the link. One for doubt. Can i issue a "tso st userid" command from my REXX and capture the output of the same? if yes, please tell me how to do it?

thanks
bade_miya.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Sep 16, 2004 11:05 am    Post subject: Reply with quote

bade_miya,

Please search before posting. Check this link which discusses about capturing output from a TSO command

http://www.mvsforums.com/helpboards/viewtopic.php?t=1618&highlight=rexx+tso+command

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sriramla
Beginner


Joined: 22 Feb 2003
Posts: 74
Topics: 1

PostPosted: Thu Sep 16, 2004 11:16 am    Post subject: Reply with quote

I dont know the origin of this code. I think its from CBT tape or from Xephon archive....But this gives all the active User IDs in a given system. I just customized it to display only those IDs I require.

The input file should contain the User ID's to verify in the first 8 characters and their names, other details etc from position 10 onwards.
Sample input file will look like this:

USERID1 NAME1
USERID2 NAME2
USERID3 NAME3

Code:

/* Rexx code to see the list of online users */                                                                                               
                         
inputDS= 'Your PS/PDS Member having the above input file'
"ALLOC DA('"inputDS"') FILE(INDD) SHR"               
uidlist. = ' '                                                         
"EXECIO * DISKR INDD (STEM UIDLIST."                                   
"EXECIO 0 DISKR INDD (FINIS"                                           
say "Active users in the list are:"                                     
numeric digits 10                                                       
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 */                               
UID = stg(ascbjbns,8)                                                   
call showStatus(UID)                                                   
End                                                                     
End                                                                     
End                                                                     
"FREE FILE(INDD)"                                                       
Exit                                                                   
ptr: Return c2d(storage(d2x(Arg(1)),4)) /* Return a pointer */         
stg: Return storage(d2x(Arg(1)),Arg(2)) /* Return storage */           
showStatus:                                                             
 do i=1 to uidlist.0                                                   
   if substr(uidlist.i,1,8) = arg(1) then                               
     say strip(substr(uidlist.i,9,50))                                 
 end                                                                   
 return                                                                 
 
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group