"SPITZ, HOBART CTR DFAS" wrote:
> What makes you think you are losing a record?  Absent premature
> termination, the input stream cannot be severed until the last record
> has been consumed by the stage(s) that follows predselect.

This is all about premature termination.  That's what my quote from the
doc was describing.

> If you just want to grab the last record, what about "take last 1"?

If I do that on the primary input, I'll delay the records and wind up
with a total mess.

If I do it on a copy of the primary input and add it into the output,
I'll get a duplicate if I've also selected it by some other criterion. 
(I may want to keep other duplicates from the input file, so I can't
just add a UNIQUE to eliminate this one.)

If I add it into my other selectors on the alternate input, I have
exactly the same problem as with STRLITERAL APPEND:  the output isn't
written until after EOF on the input.

I suppose I could use TAKE or DROP LAST 1 on the primary *and* all the
files that feed into the alternate to delay them by the same amount. 
I'm not sure that would come out any simpler or more comprehensible than
what I've got, though:

  (end /) in: fanout
 | strliteral append | drop last 1 | early: fanout
       / in: | last: drop last 1 | out: predselect | all: fanin | ...
       / last: | all:
       / early: | ... | more: faninany | out: 
       / in: | strliteral append | drop last 1 | ... | more:

¬R

Reply via email to