This pipe below can never work as the author apparently expected, whatever
the piper might implement
'PIPE CP Q ALLOC ALL' ,
   '| TAKE LAST 1' ,
  '| CONSOLE' ,
  '| SPECS W6 1' ,
  '| VAR sysres' ,
  '| CP QUERY CPOWNED' ,
  '| PICK W2 == /'sysres'/' ,
  '| SPECS W2-* 1' ,
  '| CONSOLE'
Just think a bit.
It is a REXX EXEC, so REXX is reading the source lines, and replaces all
variables by their contents (or the uppercased variable name).  In the case
above: only 'sysres' is outside the quotes and replaced by whatever value it
has at that time.  All lines (but the last) end with a , so REXX joins it to
the presvious string with 1 blnk in between.
When REXX built this long string (from the 9 source lines), it sees it is
not an assigment, not an IF, ....  So it passes the string to the current
"address" (those that know me a bit know that I tell it should better be
COMMAND).
So the CMS command processor starts the PIPE command, and it gets this long
string to handle.  PIPE simply cannot know that part of the PICK parameters
ever were a runtime variable.
And, there is even a second error: the second CP stage.  It will first pass
QUERY CPOWNED as command to CP, and then the records it finds in its input
stream.  In this case the 6th word of the last line of Q ALLOC.  I guess
your IPL volser is not labeled LOGOFF ... you would have been very surprised
...



-- 
Kris Buelens,
IBM Belgium, VM customer support

Reply via email to