You can avoid the rexx stage by using SPECS to construct your callpipe, feeding the resulting record to pipcmd:
"PIPE.... . . < no getfiles< . "|Spec /Callpipe </ n w1.3 nw /||pick w1 ==,'value',||take 1||*:/ n", "|Pipcmd", ... The IBM z/VM Operating System <IBMVM@LISTSERV.UARK.EDU> wrote on 12/12/2008 03:32:51 PM: > I have a situation where I need to extract a single record from each > of several files based on the first word of the record. A construct like this > Pipe ... | getfiles | pick w1 == /value/ | ... > Does the job. However I know there is no more than one matching > record, there may be none, in each of the files. The number of files > is variable. The location of the record containing is variable, and > the number of records in a file is variable. Some files may be quite large. > I would like to speed the search up by stopping the search in a file > without reading the rest of it when a hit is found. I can easily use > a Rexx filter that does something like this > 'call pipe *.input | take 1 | getfiles | pick w1 == /value/ > | take 1 | *.output:' > Is there any prettier or better way of doing it? Perhaps some way to > avoid the Rexx filter? > > Regards, > Richard Schuh