I just stumbled on this quirk of PREDSELECT and wondered how many last
lines I've lost in the past:

  "It terminates as soon as its primary input stream is severed."

I'm guessing (hoping) I haven't actually run into this before, but in
this case I was specifically trying to grab the last record by using
STRLITERAL APPEND to tack a record onto the alternate input.  It may be
just dumb luck that I even saw the problem right away, because
STRLITERAL's input was actually severed first, so if STRLITERAL had
happened to run before PREDSELECT's primary was severed I might never
have known anything was wrong.

The workaround I came up with is to copy the same extra record to the
end of the alternate input and *then* to the primary:

  (end /) ...  | sticky: fanin | out: predselect | ...
       / ... | last: fanin | out:
       / literal | extra: fanout | last:
       / extra: | sticky:

This way, the primary is still connected when the extra record arrives
on the alternate.  If the alternate output is used, it's important to
make sure a record won't arrive late on input 2 and select the extra
record for the alternate.

¬R

Reply via email to