Try using the LINK command:
link trash
HCPLNM053E TRASH not in CP directory
RSCHUH CMS 22 (CMS22B)(00053);
link tools
A little exec:
/***
* query if user is valid *
***/
trace 'o'
parse upper arg
address command
logon. =
arg userid
On 10/25/07, Dale R. Smith [EMAIL PROTECTED] wrote:
CP LINK userid is the best way to tell if a userid is defined in the
directory or not. CP SPOOL PUN userid will give a non-zero return code
If you have an ESM, there's a few more things to think of because that
might keep you from doing the
But Rob, that depends on the console being at 009 and on the target having a
190 (either as MDISK or as LINK).
The good trick is simply LINK userid, and I've hear somewhere (ages ago)
that IBM is aware of this trick, so they will not revert the logic
(logically one would indeed first check the
On 10/26/07, Kris Buelens [EMAIL PROTECTED] wrote:
But Rob, that depends on the console being at 009 and on the target having a
190 (either as MDISK or as LINK).
I assume one can predict where his own console is. Whether the 190
disk is there or not, the return code allows you to distinguish
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
Can't you use the return code from your CP QUERY? 0 = logged on, 3 = not in
directory, 45 = in directory but not logged on...
-Original Message-
From: The IBM z/VM Operating System [mailto:[EMAIL PROTECTED]
Behalf Of Dave Hansen
Sent: Thursday, October 25, 2007 9:16 AM
To:
If you want to get the output of a CP command in a REXX program use EXECIO.
Dave Hansen wrote:
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
Almost, but not quite. The RC=3 means invalid option. The proper form of
the query is CP QUERY USER userid, which will report not logged on for a
user that doesn't exist. Spooling your punch (after querying it to capture
the existing setting) to the target user will return RC=53 if the user
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:'
Dave,
Here is a pipe in an exec that will do what you want.
/* */
address command
arg userid
Dave, I messed up in my last example.
By coding the pipe without the USER keyword yow get what you want.
/* */
address command
arg userid
Hello again,
Thank you for all your suggestions. I did like Kens response with the
diagrc in it. I did some testing and for simplicity I favor just checking
the return code on the CP Q userid. I had forgotten about our friend EXECIO
that stacks the output and I liked the PIPE that put the
With LINK, only 1 CP command s required, so why revert to DEFINE + SPOOL +
DETACH?
2007/10/25, David Boyes [EMAIL PROTECTED]:
Define a virtual punch or printer at a known address and attempt to
spool that device to the user in question. If the user is not valid, you
will get an error. You can
Hello again,
OK, I did some pondering. I wanted to suppress the CP command and SETtting
CMSTYPE of coarse did suppress it. so I used the PIPE approach. I
would hope that userids should not match literals lke DISK or NOLOG, but I
liked the 'NOT IN CP DIRECTORY' message from the spool
By coding
IF WORD(RESP.1,1) = 'HCPCSP053E' THEN
you depend in CP SET EMSG ON
Why not simply testing the returncode?
And, the test with the LINK, is a LINK without a minidisk address:
'PIPE CP LINK ' cw
if rc=22 then ... user exists ...
if rc=53 then ... user not in CP directory
Side
Either will work. That's just the method that popped off the top of my
head.
It's workable, but I'd suggest that for what you're doing you don't
really need a separate test for valid userid. The query rdr itself will
do that. Your date checking can be streamlined as well. This would be
my solution:
/*
**
CP LINK userid is the best way to tell if a userid is defined in the
directory or not. CP SPOOL PUN userid will give a non-zero return code
for a userid defined in the directory with a password of NOLOG. This
information could be useful if you were trying to determine whether or no
t
you
19 matches
Mail list logo