/*********************************************************************** * query if user is valid * ***********************************************************************/ trace 'o' parse upper arg address command logon. = "" arg userid /* check pun */ "PIPE CP DEFINE PUN 01D" "PIPE CP SPOOL 01D TO " userid sprc = rc "PIPE CP DETACH 01D" /* check link */ "PIPE CP LINK " userid lnkrc = rc /* q user */ "PIPE CP Q USER "userid" | STEM LOGON." logrc = rc fndrc = min(sprc,lnkrc) /* determine userid status */ select when fndrc = 0 then select when logrc = 0 then found="VALID and Logged On "word(logon.1,3) when logrc = 45 then found="VALID and Not Logged On" otherwise nop end when fndrc = 53 then found="INVALID" when fndrc = 22 then found="VALID and set to NOLOG" otherwise nop end /* display userid status and exit with rc for calling program */ /* 0 = 0+0 = Valid and logged on */ /* 45 = 0+45 = Valid and Not logged on */ /* 67 = 22+45 = Valid and set to nolog */ /* 98 = 53+45 = Invalid userid */ say "UserID "userid" is "found exit fndrc+logrc
-----Original Message----- From: The IBM z/VM Operating System [mailto:ib...@listserv.uark.edu] On Behalf Of Alan Altmark Sent: Tuesday, August 18, 2009 8:29 AM To: IBMVM@LISTSERV.UARK.EDU Subject: Re: Validation of user id On Tuesday, 08/18/2009 at 08:59 EDT, "Frank M. Ramaekers" <framaek...@ailife.com> wrote: > I use to use the 'SP PRT TO userid' to validate a user id. Is there a > better/different way? The generally-accepted idiom is "LINK <userid>" with no other parameters. There are Things that can cause SPOOL to fail even though you are using a valid user ID. Alan Altmark z/VM Development IBM Endicott This electronic transmission and any documents accompanying this electronic transmission contain confidential information belonging to the sender. This information may be legally privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited.