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

How to get the No of users using the PDS


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

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Wed Aug 22, 2007 10:06 pm
Reply with quote

Any solution of the problem
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Aug 25, 2007 7:49 pm
Reply with quote

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                                                   
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 IBM OnDemand Folders displaying to al... IBM Tools 6
No new posts VAGen Users IBM Tools 0
No new posts Copy a DS Member to multiple users at... TSO/ISPF 8
No new posts User key common area users - How to r... All Other Mainframe Topics 0
No new posts Free FILE not working for specific users CLIST & REXX 12
Search our Forums:

Back to Top