Bob Cronin wrote:
> been too complex for me to get my head around how I'd do them entirely in
> the pipeline, and I've always fallen back to using the standard
> WAKEUP-driven Rexx "Do Forever" loop.

The starting point is just to move that DO FOREVER loop into the
pipeline.  Use ADDRESS COMMAND to issue all the same CMS commands you
would normally, except for PIPE.  Use CALLPIPE instead of PIPE to run
any one-shot pipelines.

None of that improves anything directly, of course.  What it buys you is
that now you can use ADDPIPE to add subroutine pipelines your program
can read and write to.  You're then starting up those pipelines just
once for the whole program, rather than repeatedly for each record or
group of records you need to process.

Then you can look at replacing WAKEUP with STARMSG, DELAY, etc., and
maybe even eliminating the main loop.  Rather than doing all that from
scratch, though, you can use PIPESERV as your starting point:

   PIPE (end /) serv.rdr: pipeserv | xferrdr / serv.smsg: | echosmsg

Then your small XFERRDR and ECHOSMSG stages do the parts you care
about.  Each of those can do the bulk of its work in a single subroutine
pipeline.

¬R

Reply via email to