On 2021-02-16, at 16:26:35, Glenn Knickerbocker wrote:
>
> This is a frequent puzzle I shake my head at solving a different way
> every time:  I need to pass a string to a pipeline stage, and it might
> have pipeline characters in it, and it might be null, it might or might
> not need delimiting, and it might or might not be a required argument.
>  ...
> When I'm just trying to pass the argument intact from an exec to a
> pipeline or from one stage to another, it's particularly unsatisfying to
> wind up sticking it in a variable first to do work on it.  Have I
> overlooked something to make all this unnecessary?
>
I don't find it "particularly unsatisfying" to code:
    OUTPUT ARG( 1 )
... but it is a hurdle to pass an arbitrary string as
the argument to a REXX Pipeline stage; far worse to
pass ARG( 2 ).

I once converted a (small by master plumber standards) EXEC
a co-worker had written to a Pipeline stage by renaming
its filetype to REXX and adding startup code:
    Stage = address()
    address command
... the CMS commands then worked as before, and I could
intersperse Pipeline comnands as
    address value Stage
        ADDPIPE | CALLPIPE | BEGOUTPUT | ...
    address command  /* To return to CMS code.  */

I never confronted the ARG( 2 ), ARG( 3 ), ... problem.  My
predecessor coding in pure Rexx had never CALLed an external
EXEC with multiple arguments.  But REXX and REXXCMD stages
each support only a single argument.

-- gil

Reply via email to