Dave,
Here is a pipe in an exec that will do what you want.
/* */
address command
arg userid
"PIPE cp query user" userid "| stem resp."
say resp.1
exit
These are the responses to the exec;
cpcmdtst ftpserve
FTPSERVE - DSC
Ready; T=0.01/0.01 10:49:23
cpcmdtst ftpser
HCPCQU045E FTPSER not logged on
Ready; T=0.01/0.01 10:49:32
You could also check the return code from the command. 0 is userid is
logged on, 45 user is not logged on.
Rick
Rick Bourgeois, President
Virtual Software Systems, Inc.
7715 Browns Bridge Rd
Gainesville, GA 30506
[EMAIL PROTECTED]
770-781-3200
-----Original Message-----
From: The IBM z/VM Operating System [mailto:[EMAIL PROTECTED] On
Behalf Of Dave Hansen
Sent: Thursday, October 25, 2007 10:16 AM
To: [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