This way you are dependant on SET EMSG ON. Futhermore: if IBM would ever
move the handling of the Q USERID command to another module than HCPCQV the
message ID would change.
For CP commands the message number always corresponds to the returncode

2010/3/15 Feller, Paul <[email protected]>

>  Everyone will have their own way of doing what you asked.  Here is some
> code I used to check in a routine that starts up a guest.  It works for what
> I needed to do.
>
>
>
> /*                                                                    */
>
> /* Issue QUERY command to see if the USERID is already on the system  */
>
> /*                                                                    */
>
> 'PIPE CP QUERY' USERID '|var userline'
>
>
>
> /*                                                                    */
>
> /* Do this check to see if an invalid USERID was used                 */
>
> /*                                                                    */
>
> if substr(userline,1,10) = 'HCPCQV003E' then do
>
>   say
>
>   say 'You have entered invalid information - please retry your request'
>
>   say
>
>   say 'Date..' DATE() '     Time..' TIME('N')
>
>   LOGMSG = " - Error found - Invalid USER ID entered - USER ID: "||USERID
>
>   Call WRTELOG
>
>   LOGMSG = ENDMSG
>
>   Call WRTELOG
>
>   exit
>
>   end
>
>
>
> /*                                                                    */
>
> /* Do this check to see if the USERID is already on the system        */
>
> /*                                                                    */
>
> if substr(userline,1,10) = 'HCPCQU045E' then USERON = 'NO'
>
>
>
>
>
> *Paul Feller*
> *AIT Mainframe Technical Support*
>
>   *From:* The IBM z/VM Operating System [mailto:[email protected]] *On
> Behalf Of *Frank M. Ramaekers
> *Sent:* Monday, March 15, 2010 2:20 PM
>
> *To:* [email protected]
> *Subject:* Check for User...
>
>
>
> What’s the best way to check:
>
>
>
> 1)             UserID is valid (a user on this system)
>
> 2)             UserID is logged on (or not)
>
>
>
>  Frank M. Ramaekers Jr.
>
>
>
> Systems Programmer
>
> MCP, MCP+I, MCSE & RHCE
>
> American Income Life Insurance Co.
>
> Phone: (254)761-6649
>
> 1200 Wooded Acres Dr.
>
> Fax: (254)741-5777
>
> Waco, Texas  76701
>
>
>
>
>
> _____________________________________________________ This message contains
> information which is privileged and confidential and is solely for the use
> of the intended recipient. If you are not the intended recipient, be aware
> that any review, disclosure, copying, distribution, or use of the contents
> of this message is strictly prohibited. If you have received this in error,
> please destroy it immediately and notify us at [email protected].
>



-- 
Kris Buelens,
IBM Belgium, VM customer support

Reply via email to