EOFBACK CONS and now EOFBACK WARP is convenient for tracking records
through a pipeline without reading extra input records, but it creates a
weird timing problem:  Since the record isn't written to the driver
until after it's released, you wind up following the record upstream
rather than downstream.

  PIPE literal x|eofback cons|pad 2 x|eofback cons|pad 3 x|cons
  xxx
  xx
  x

I wrote myself a little COLLECT REXX to do it the old-fashioned way
using FANOUT|COPY|SYNCH|FANINANY, but of course SYNCH doesn't terminate
until it actually fails to write a record, so it still reads one extra
record (and each SYNCH further upstream reads one more).  

  pipe literal 1 2 3|split|a:collect|pad 2 x|a:|pad 3 y|take 1|a:|cons
  1
  1x
  1xy
  2
  2x
  3

Am I overlooking a way to get the records in the right order without any
extra?

¬R   http://users.bestweb.net/~notr/xmas2008

Reply via email to