1830226 Members
1562 Online
109999 Solutions
New Discussion

PIPE cmd failure

 
SOLVED
Go to solution
Jack Trachtman
Super Advisor

PIPE cmd failure

Can someone tell me why the following fails:

$ PIPE SHOW SYSTEM | -
( SEARCH SYS$INPUT "ROP___ROP5" ; -
READ SYS$INPUT X ; -
DEFINE/JOB ROP_INFO &X )
0000E809 ROP___ROP5 LEF 6 127308 0 00:01:10.45 719 1047
%RMS-E-EOF, end of file detected

The output shows that the SEARCH cmd is
successful, but the READ cmd is failing.
I've tried substituing SYS$PIPE for SYS$INPUT
with the same results.

TIA
3 REPLIES 3
John Gillings
Honored Contributor
Solution

Re: PIPE cmd failure

Jack,

I prefer to see "SYS$PIPE" to make commands clearer, but that's not your problem. The trouble is SEARCH and READ are in the same pipeline, so SEARCH will exhaust the input stream and READ will see EOF (exactly as reported).

I think what you really mean is for the READ to see the output of the SEARCH, so the command should be:

$ PIPE SHOW SYSTEM | -
SEARCH SYS$PIPE "ROP___ROP5" | -
( READ SYS$PIPE X ; -
DEFINE/JOB ROP_INFO &X )

A crucible of informative mistakes
Antoniov.
Honored Contributor

Re: PIPE cmd failure

As John posted, search consume all input stream and read receive eof.
$ PIPE SHOW SYSTEM | SEARCH SYS$INPUT "ROP__ROP5" | (READ SYS$INPUT X ; DEFINE/JOB ROP_INFO &X )
works fine for me.

Antonio Vigliotti

Antonio Maria Vigliotti
Jan van den Ende
Honored Contributor

Re: PIPE cmd failure

Jack,

....and as far I know, this behavior is excactly the same as it would have been on any *IX system: once you HAVE read a pipe, there is nothing there anymore until some new info is sent, but NO info will be available for processing twice! If you need it twice, just present it again to another data stream. (might just be another pipe, as in the above).

Jan
Don't rust yours pelled jacker to fine doll missed aches.