Hi,
First time CMS Pipes user and poster.
I'm sure I've not understood properly, but what I want to do is find one free
DASD in a long list of devices returned by the CP command "Q DASD FREE". When
it exists, the code works as I expect. When it doesn't, I get a blank line,
which is what I'm calling "empty pipe" here, which I hope makes sense.
Here is the code, and then a question:
/*-----------------------------------------------------------*/
/* find a unit in the FREE list of DASDs */
/*-----------------------------------------------------------*/
/* trace r */
arg unit . /* find this unit in the FREE list */
if unit = '' then exit
signal on novalue
say "finding free DASD: " unit ;say
address command /* requires PIPE to be capitalised */
'PIPE cp q dasd free ' , /* list free DASD */
'|split , ' , /* split at commas */
'|strip ' , /* strip blanks */
'|locate /' unit '/' , /* find the unit */
'|console ' /* show it */
The question is: how can a get a message similar to "Unit not found" to
display, instead of nothing as happens now? Here's some sample output to show
you what I mean:
21:21:54 shfree AFB9
21:21:54 finding free DASD: AFB9
21:21:54
21:21:54 DASD AFB9 FREE
21:21:54 Ready;
21:22:16 shfree ffff
21:22:16 finding free DASD: FFFF
21:22:16
21:22:16 Ready;
I read the Pipelines for Authors manual and see that I can make a small REXX,
to run after the "locate" stage and before the "console" stage, to do something
like 'readto in' and if nothing is returned, act accordingly, but that seems
like overkill...
Is there already a stage, or a better "pipethink" way, to do this? Just as
background, sometimes we need to see if a DASD is online or not and the list of
free DASD is hundreds of lines long. I realise I could just use "Q DASD rdev"
but I thought I'd like to use this as an introductory "plumbing exercise"
anyway.
Thanks in advance for any help you can offer. In the meantime, I'm off to read
more of the material on the CMS Pipelines Home Page.
Kind regards,
Peter Bishop
System Programmer - Mainframe
DXC Technology Australia Pty Limited; Registered Office: 26 Talavera Road,
Macquarie Park NSW 2113 Australia; Incorporated in Australia ACN: 008 476 944.
DXC Technology Company -- This message is transmitted to you by or on behalf of
DXC Technology Company or one of its affiliates. It is intended exclusively for
the addressee. The substance of this message, along with any attachments, may
contain proprietary, confidential or privileged information or information that
is otherwise legally exempt from disclosure. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended recipient
of this message, you are not authorized to read, print, retain, copy or
disseminate any part of this message. If you have received this message in
error, please destroy and delete all copies and notify the sender by return
e-mail. Regardless of content, this e-mail shall not operate to bind DXC
Technology Company or any of its affiliates to any order or other contract
unless pursuant to explicit written agreement or government initiative
expressly permitting the use of e-mail for such purpose.