On 25 September 2012 15:49, Frank M. Ramaekers <[email protected]> wrote:
> I'm trying to figure out how I can create a pipeline that will create
> multiple output records based on the input.
> NICDEF 1F80 TYPE HIPER DEV 19 LAN SYSTEM TORCHMAR
You could obviously do a stage in REXX to parse the record and produce
the N-1 extra records...
This is what I could come up with. The tricks:
- use "juxtapose count" to number the records in a run
- use specs arithmetic to produce the consecutive addresses
- use "c2v" conversion to produce a variable number of records
'\ o: fanout',
'| spec w2 x2d 1.8 r 1-* nw', /* Address in decimal */
'| j: juxtapose count', /* Generate with count */
'| spec a:w1 - b:w2 - w3 1',
'print a+b-1 d2x nw.4 r', /* Construct next address */
'w5-* nw ', /* and rest of it */
'| cons',
'\ o:',
'| spec w6 d2c 1.2 r', /* Take the count field */
'| pad 1024', /* and convert to record with */
'| spec 1-* c2v', /* that number of bytes */
'| fblock 1', /* to get that many records */
'| chop 0', /* of length 0 */
'| j: /* to pass to juxtapose */
PS The "c2v" is a classic one. With recent plumbing you create a
record of specified length like this:
spec a: w6 - ,*, (a)
Sir Rob the Plumber