Wow, thanks for the info John! -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of John McKown Sent: Friday, April 05, 2013 2:06 PM To: [email protected] Subject: Re: REXX calling an authorized program.
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. 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 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 */ On Fri, Apr 5, 2013 at 12:43 PM, Paul Gilmartin <[email protected]>wrote: > On Apr 5, 2013, at 10:57, Leonardo Vaz wrote: > > > > I tried using forkexecm and it worked, the only thing is that only > TASKLIB, STEPLIB, or JOBLIB DD data set allocations are propagated to > the new process, do you have any idea how to make allocations on the new ASID? > > > > -----Original Message----- > > From: IBM Mainframe Discussion List > > [mailto:[email protected]] > On Behalf Of Paul Gilmartin > > Sent: Friday, April 05, 2013 11:27 AM > >> > > BPX1EXM. But note many restrictions. > > > Only the hard way. Pass the list of required allocations as strings > in PARM (I don't know whether pipes and/or environment variables are > propagated), and re-do the allocations with BPXWDYN or C library > functions. Even worse, since forkexecm() starts a separate ASID, you > may encounter ENQ conflicts with the parent process. > > And the propagated TASKLIB, etc. allocations may be passed as a list > of catalogued data set names; allocation by VOLSER may not be > respected. > > LISTSERV MVS-OE might be a source of additional information. > Many of them are better than I am. > > -- gil > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, send > email to [email protected] with the message: INFO IBM-MAIN > -- This is a test of the Emergency Broadcast System. If this had been an actual emergency, do you really think we'd stick around to tell you? Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
