On Fri, 5 Apr 2013 13:06:07 -0500, John McKown wrote:
>Which is why forkexecm() is not a good way to run what is really a batch
>program. I generally use ADDRESS TSO in my REXX CGIs to run anything other
>than UNIX commands (I tend to use bpxwunix() for UNIX commands). If I need
>to, I write a TSO REXX program which does the ALLOCATE commands for the DDs
>needed, followed by a TSO CALL command to actually run the batch program.
>
I do very much the same. Perhaps I was unduly influenced by the OP's
statement that he wanted to avoid TSO.
>Note that the UNIX environment variables are passed to the new process,
>just like always. Why is this important? Because if the batch program is
>written in COBOL or PL/I, they have the ability to dynamically allocate a
>DD with a DSN
>
Thanks for confirming this. I might suggest using the format of TSOALLOC:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/BPXZA5C0/SHCMDDES.TSO.5
... just to stay on familiar ground, even though you must parse it yourself. I
believe
the values passed via TSOALLOC are entire BPXWDYN argument strings.
"address TSO" from the UNIX environment is somewhat different from "address TSO"
in the TSO environment. It's frustrating that it closes all the caller's
descriptors
before invoking the TSO command.
>ref:
>http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR50/4.2.3.1
>
>So, for a batch COBOL program, you could do something like:
>
>export SYSPRINT='DSN(some.output.dsn) OLD'
>export VSAMFILE='DSN(some.input.vsam) SHR'
>export STEPLIB='my.load.library:CEE.SCEERUN:CEE.SCEERUN2'
>pgm='MYPROG'
>"forkexecm (pgm) 'INPUT PARMS' "
>
>Unfortunately, there doesn't seem to be a way to allocate a SYSOUT data
>set. And I don't know about doing something funky like:
>
>export SYSPRINT="PATH(/dev/fd/2)" /* allocate stderr to SYSPRINT */
>
This fails with "address TSO" because descriptor 2 is closed. You could
simply "call BPXWDYN('alloc dd(SYSPRINT) sysout')", but then you must
root around with SDSF to find it.
I believe forkexecm may propagate descriptors. Just a guess.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN