On Wed, 7 Dec 2016 18:39:26 -0800, Charles Mills wrote:

>Okay, I think I picture this thing. Your customers write programs. The
>programs invoke, by calling your API, some function that is a part of your
>product. The users who run those programs have the ability to change the
>behavior of that function, let's call it making the function left-handed or
>right-handed. You can't have them set the handedness by coding //S1 EXEC
>PGM=USERPROG,PARM=LEFT because the customer application thinks it "owns" the
>PARM=string, and in any event has no logic to parse the parm and pass it to
>you on the API. So the way the user makes it left-handed is to code
>//PHILLEFT DD DUMMY and your function finds that in the TIOT and operates
>left-handed.
> 
Pretty much what I had surmised.  Thanks for doing the writing for me.
And if USERPROG is in LINKLIST, STEPLIB is needless.

In a UNIX shell:
    PHILLEFT=DUMMY  # sets an environment variable.
    unset PHILLEFT    # Clears it.

Then, in Rexx (my favorite) the following (untested, and with some lazy
shortcuts that will seem like pitfalls when you step in them):

/* Rexx */ signal on novalue

do I = 1 to __ENVIRONMENT.0
    if __ENVIRONMENT.I=='PHILLEFT=DUMMY' then
        call BPXWDYN 'alloc dd(PHILLEFT) dummy reuse msg(2)';  end I

address LINKMVS 'USERPROG'  '__ARGV.2'
call BPXWDYN 'free dd(PHILLEFT) msg(2)'

Put it in the executable search path; mark it executable.  You can even
name it USERPROG with no conflict because of different name spaces.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to