On Wed, 15 Jan 2020 at 01:48, Glenn Knickerbocker <n...@bestweb.net> wrote:

> I knew I had written some "sipping stages" in the past where I didn't
> need PEEKTO to put any input in REXX variables, and I only needed
> STREAMSTATE SUMMARY to check whether to continue:
>

But isn't that a leaky garden hose? If you meant to sip all records from
the input stream, RC=8 from STREAMSTATE would be a reason to keep sipping.
Only when your CALLPIPE holds the finger on the tap when it's done after
seeing the next input record, you can now for sure you'd have RC=0.

In the same box of plumbing appendices: when your CALLPIPE is also writing
records to the output stream, that eof is not propagated back through the
CALLPIPE. So when your output stream is severed, the CALLPIPE does not get
a chance to consume more input records because it can't write the result,
and you end up looping in REXX. I find myself using EOFREPORT ALL and ANY
more and more, instead of using COUNT and testing for no progress.

signal on error
'eofreport all'
do forever
   'peekto'
   'callpipe *: | ... | *:'
end
error: return rc * (0==wordpos(rc, 8 12))

Sir Rob the Plumber

Reply via email to