Dave: This is an example of how I do that:

/* CHKID: Determine if a userid exists */ 
Parse Source . . exnm . 
exmsg = '*' exnm':' 
exerr = exmsg 'ERROR -' 
 
Parse UPPER Arg uid . 
 
If uid = '' | uid = '?' Then Do 
   Say exmsg 'Determine if a userid exists' 
   Say 
   Say 'Command Format:' exnm 'userid' 
   Say 
   Exit '99' 
End 
 
cpcmd = 'CP LINK' uid 
 
Parse Value Diagrc(8,cpcmd) With xrc . cpresp '15'x 
Select 
   When xrc = '22' Then Say exmsg 'Userid' uid 'exists.' 
   When xrc = '53' Then Say exerr 'Userid' uid 'does NOT exist.' 
   Otherwise Do 
      Say exerr exerr 'Unknown response to:' cpcmd '-rc='xrc 
      Say exerr cpresp 
      Exit xrc 
   End 
End 
Exit   




Dave Hansen <[EMAIL PROTECTED]> 
Sent by: The IBM z/VM Operating System <IBMVM@LISTSERV.UARK.EDU>
10/25/2007 10:15 AM
Please respond to
The IBM z/VM Operating System <IBMVM@LISTSERV.UARK.EDU>


To
IBMVM@LISTSERV.UARK.EDU
cc

Subject
How can I find if a user is defined in the directory (without looking!)?






---------------------- Information from the mail header 
-----------------------
Sender:       The IBM z/VM Operating System <IBMVM@LISTSERV.UARK.EDU>
Poster:       Dave Hansen <[EMAIL PROTECTED]>
Subject:      How can I find if a user is defined in the directory 
(without
              looking!)?
-------------------------------------------------------------------------------

Hello,

   I have an EXEC that I wish to use to TRANS the console files from 
another userid for a given period of time.  I would like to check if the 
userid
given the EXEC actually exists.
   I looked at the CMS QUERY which does stack the results, but userid is 
not part of the CMS query.   The CP Query does let me know about the user,
but doesn't stack the results.
   The CP MSG (and SMSG) & IND USER don't care about the userid, and an 
invalid userid is always NOT LOGGED ON.
    It looks like I almost need to spool and close my console to get the 
results of my CP Query.  I suppose I could just issue the TRANS against an
invalid userid and let it fail.
    Any thoughts from the group?

      Thank you,  Dave Hansen
                              Sr. Systems Programmer
                              Hennepin County

Reply via email to