And you can do getenv() and setenv() from a program running the traditional 
EXEC PGM= way.

An important concept to keep in mind is that the mental model of "there is a 
legacy MVS over here, and then over there in some other compartment is UNIX, 
and you run in one place or the other" is erroneous.

It's all one thing. There is MVS, and it has full UNIX services available to 
it. There are three or more user interfaces, "shells" if you will (in the 
broadest sense of the term): The USS shell environment, TSO, and JCL. They are 
all just very different user interfaces into more or less the same running 
environment.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Tony Harminc
Sent: Friday, October 13, 2017 9:39 AM
To: [email protected]
Subject: Re: fopen DD

On 12 October 2017 at 20:40, Paul Gilmartin 
<[email protected]> wrote:
> On Fri, 13 Oct 2017 00:17:40 +0000, Frank Swarbrick wrote:
>>
>>//SHELL  JOB NOTIFY=&SYSUID,REGION=2000M //UNIXSH  EXEC 
>>PGM=BPXBATCH,PARMDD=PARMSIN
>>//FW      DD DISP=SHR,DSN=DVFJS.FW
>>//PARMSIN DD *
>>SH /u/dvfjs/src/fw
>>/*
>>//STDIN   DD DUMMY
>>//STDOUT  DD SYSOUT=*
>>//STDERR  DD SYSOUT=*
>>//STDENV  DD DUMMY
>>//
>>
>>Does the Unix environment for BPXBATCH not have access to the JCL DD?
>>
> Right.  BPXBATCH starts a new address space which inherits none of the DDs.
> BPXBATSL runs in the job step address space, but has onerous APF 
> entanglements.
>
> I don't know that BPXWUNIX is better.
>
> The cumbersome alternative is to use Rexx; BPXWDYN('alloc dd(FW) 
> ...'), then address SYSCALL spawn with BPX_SHAREAS=MUST.  Details are 
> left as an exercise for the student.  The MVS-OE forum might be helpful.

A quite different approach is to simply copy the executable from the UNIX file 
to a PDSE member, and then run it with EXEC PGM=FW with that PDSE as STEPLIB.

I've found this generally works very well for programs that aren't full of 
UNIXisms such as requiring env vars and such.

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

Reply via email to