> Not tested. But then the first pipe wasn't tested either.
Au contraire mon ami.  My first Pipe was tested, albeit not quite 
correctly. 

I had used a home-grown "REXX EXEC" to test it.  Until "QUIT" is entered, 
the REXX EXEC repeatedly prompts for a rexx command, executes it, and 
continues to prompts again. 

I didn't believe that using a rexx variable would work either, not even 
inside a rexx exec.  But I had recently re-learned that inside a pipe one 
can read an existing stem, make changes, use the BUFFER stage, and then 
re-write the same stem name.  I re-learn more every day.

So I wondered if recent changes to Pipes might let me use a variable as 
part of the processing, after all, the Piper is very clever.  I again 
re-learned that  it is not possible because when rexx interprets that pipe 
command, the variable has not yet been set, and will still be an 
uninitialized variable when processed at its second reference in the pipe.

But that "REXX EXEC" provided a quite surprise.  The first time I entered 
that erroneous Pipe command, the results were as expected: it did not 
work.  But it silently set the "sysres" variable before failing.  Not 
realizing that the "sysres" var had been set, and not leaving the REXX 
EXEC prompts, I decided to try adding the 'BUFFER' stage to see if that 
might help the way it does when reading and writing the same stem.  So I 
pressed the "RETRIEVE" PFkey, inserted the 'BUFFER' stage and pressed 
"Enter".

That time it worked perfectly.  So I removed the BUFFER stage and tried 
again (there might have been a few other attempts that failed due to 
typos).  It continued to work perfectly, but unbeknownst to me only 
because the "sysres" var was still set.  So the "tested" results were 
posted, with me confident that I had learned something new.

After Richard replied that it could not work, I tried again so that I 
could show a console list of it working.  Naturally that test was doomed 
to failure, since the command was copied and pasted from the post (with no 
typos).  But it worked when I pressed the RETRIEVE PFkey and pressed 
Enter" again, unchanged!  WTH!!???  It took a couple minutes for the 
proper synapses to fire before I understood why.  :-)

Moral of the story: ah... you figure it out - consider it a learning 
experience. 

The corrected, complete pipe was posted November 4:
pipe cp q alloc all | take last | cons | spec /q dasd/ 1 w-1 nw | cp | 
pick w3 == /CP/ | cons

Mike Walter
Aon Corporation
The opinions expressed herein are mine alone, not my employer's.





"Alan Ackerman" <[email protected]> 

Sent by: "The IBM z/VM Operating System" <[email protected]>
11/09/2010 10:22 PM
Please respond to
"The IBM z/VM Operating System" <[email protected]>



To
[email protected]
cc

Subject
Re: How to determine SYSRES






'PIPE CP Q ALLOC ALL' ,
   '| TAKE LAST 1' ,
   '| CONSOLE' ,
   '| SPECS W6 1' ,
   '| VAR sysres' ,
   '| CP QUERY CPOWNED' ,
   '| PICK W2 == /'sysres'/' ,
   '| SPECS W2-* 1' ,
   '| CONSOLE' 

This won't work. You cannot set the REXX variable and use it in the same 
pipe.

'PIPE CP Q ALLOC ALL' ,
   '| TAKE LAST 1' ,
   '| CONSOLE' ,
   '| SPECS W6 1' ,
   '| VAR sysres' 

'PIPE CP QUERY CPOWNED' ,
   '| PICK W2 == /'sysres'/' ,
   '| SPECS W2-* 1' ,
   '| CONSOLE' 

Not tested. But then the first pipe wasn't tested either.

Alan Ackerman





The information contained in this e-mail and any accompanying documents may 
contain information that is confidential or otherwise protected from 
disclosure. If you are not the intended recipient of this message, or if this 
message has been addressed to you in error, please immediately alert the sender 
by reply e-mail and then delete this message, including any attachments. Any 
dissemination, distribution or other use of the contents of this message by 
anyone other than the intended recipient is strictly prohibited. All messages 
sent to and from this e-mail address may be monitored as permitted by 
applicable law and regulations to ensure compliance with our internal policies 
and to protect our business. E-mails are not secure and cannot be guaranteed to 
be error free as they can be intercepted, amended, lost or destroyed, or 
contain viruses. You are deemed to have accepted these risks if you communicate 
with us by e-mail. 


Reply via email to