You'd want to read one of Melinda's papers:
http://vm.marist.edu/~pipeline/addpipe.pdf
It explains CALLPIPE and ADDPIPE in great detail. If LOOKUP could
perform part of the work:
(note: this is written without consulting the doc, so it may contain errors)
/* You Rexx stage: */
'ADDSTREAM INPUT'; instream=rc
'ADDSTREAM OUTPUT'; outstream=rc
'ADDPIPE (end ?) *.output.'outStream':',
'|LK: Lookup ....',
'|... modify the record ...',
'|*.input.'inStream':',
'? < STATIC FILE',
'|LK:'
/* Main loop reading the "normal" stuff */
do forever
'PEEKTO REC' ; if rc<>0 then leave
'SELECT OUTSTREAM' outStream
'OUTPUT' rec /* Feed record to the added PIPE */
'SELECT INSTREAM' inStream
'READTO ModifiedRecord'
'SELECT OUTSTREAM 0'
'OUTPUT' ModifiedRecord
'SELECT INSTREAM 0'
'READTO' /* consume input records */
end
'SEVER OUTPUT' outStream /* Tell added pipe we're done */
exit
2008/6/20 Marty Zimelis <[EMAIL PROTECTED]>:
> It sounds like you're looking for an indeterminate number of copies of the
> file. There's an idiom for doing this. Put the file in storage, create an
> infinite number of copies, then release each copy of the file under control
> of the SYNCHRONIZE stage:
>
> '(end \)',
> ...
> 'sy: synchronize |',
> ...
> '\',
> '<' fn ft fm |',
> 'instore |', /* Put file in storage */
> 'dup * |', /* Make as many copies as you need */
> 'sy: |', /* Control release of copies */
> 'outstore |', /* Copy of file into the pipeline */
> ...
>
> Each time a record hits the SYNCHRONIZE stage's primary input stream, it
> releases a record from the "dup *" to convert it into a copy of the file via
> "outstore".
>
> Marty
> ____________________
> Martin Zimelis
> Principal
> maz/Consultancy
>
>
>> -----Original Message-----
>> From: CMSTSO Pipelines Discussion List
>> [mailto:[EMAIL PROTECTED] On Behalf Of Ian S. Worthington
>> Sent: Thursday, June 19, 2008 7:55 PM
>> To: [email protected]
>> Subject: [CMS-PIPELINES] Creating parallel pipes
>>
>> I have a pipe that takes two input streams and passes them
>> through a set of
>> standard and custom stages to produce an annotated list of significant
>> differences between them.
>>
>> One of the new stages called from the differencing stage
>> takes a large static
>> file as input and applies some changes to the output data.
>> But as it is as
>> the moment it rereads and reprocesses this file for each
>> record, which clearly
>> needs to be changed.
>>
>> What's the best way of setting up a parallel pipe which only
>> needs to be
>> initialised once and then sending and receiving records from
>> that in the
>> middle of a rexx stage? (Addpipe by chance? I can't find too much
>> documentation on how to use it, and what I can seems to fit
>> it on to the start
>> or end of an existing pipe, not something that can be called
>> in the middle.
>>
>> Any thoughts welcome.
>>
>>
>> ian
>> ...
>>
>> Ian S. Worthington, MBCS.
>>
>> me: http://isw.me.uk/
>> photos: http://gallery.isw.me.uk/
>>
>>
>> Dulce et decorum est pro patria mori, sed dulcius pro patria
>> vivere, et
>> dulcissimus pro patria biber. Ergo, bibiamo pro salute patriae.
>>
>
--
Kris Buelens,
IBM Belgium, VM customer support