expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
This is what I posted on the similar thread that got moved to "OFF TOPICS"
To get the number of users you will need to count the occurences of JOBNAME, as WHOHAS may return multiple lines for each user.
Code: |
/* REXX ***/
SAY 'PLEASE ENTER THE PDS NAME'
PARSE PULL DSN
X = OUTTRAP('USERIDS.')
"WHOHAS '"STRIP(DSN)"'"
Y = OUTTRAP('OFF')
DO A=1 TO USERIDS.0
PARSE UPPER VAR USERIDS.A PART1 .
IF INDEX(PART1,'JOBNAME') THEN DO
USER_ID = SUBSTR(PART1,INDEX(PART1,'JOBNAME=')+9,7)
SAY 'THE USER WHO IS USING MYPDS IS ' USER_ID
END
END
|
|
|