View previous topic :: View next topic |
Author |
Message |
bade_miya Beginner

Joined: 10 Dec 2003 Posts: 110 Topics: 38
|
Posted: Thu Sep 16, 2004 4:39 am Post subject: How to know whether a user is connected to mainframe. |
|
|
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? . 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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
bade_miya Beginner

Joined: 10 Dec 2003 Posts: 110 Topics: 38
|
Posted: Thu Sep 16, 2004 9:05 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
sriramla Beginner
Joined: 22 Feb 2003 Posts: 74 Topics: 1
|
Posted: Thu Sep 16, 2004 11:16 am Post subject: |
|
|
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 |
|
 |
|
|