Funny, I just ran into this.  My ID's OMVS segment was using /bin/bash which was a symbolic link to Rocket's Conda environment (where bash is installed).   bash does not behave well with BPXBATCH.  There are a few ways around the issue.  I finally just added:

#!/bin/bash -l

to my script I was running.

The -l causes it to be treated as a login shell and reads /etc/profile.

If you are using bash, you can also code:

//STDENV DD *
BASH_ENV=/etc/profile
/*
//STDPARM DD *
sh env
/*
//

On 11/17/2021 8:07 AM, Colin Paice wrote:
Im trying to run the shell script (httpd server) as a started task
If I use userid websrv it takes the instream  //STDENV and uses it, and
works
if I use a different userid, it ignores the instream //STDENV values, and
fails because of Libpath.

With WEBSRV it takes the //STDENV and ignores  /etc/profile.
With WEB2 it ignores //STDENV and uses /etc/profile

The userids have very similar OMVS attributes.

My shell script displays all of the "set" variables, so I can tell what is
being used.

The doc says


*Note: When using BPXBATCH with the SH option (SH is the default),
environment variables speci®ed in the STDENV DD are overridden by those
speci®ed in /etc/profile and .profile (whichoverrides /etc/profile). This
is because SH causes BPXBATCH to execute a login shell that runsthe
ietcipro® e script and runs the user's .profile.*

I do not have any .profile shells.
Is there a magic attribute I am missing?

Colin

----------------------------------------------------------------------
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

Reply via email to