Page 1 of 1

Question with ESP User in ESP job

PostPosted: Mon Feb 13, 2017 7:53 pm
by did007
Hi,

I have a ESPx job which will run a shell script sample.sh using user ABC.

User ABC has .bash_profile, which have certain variables that are used in sample.sh.

Am not executing the .bash_profile inside the sample.sh. It should execute it as soon as i login into the shell with that ABC user.

If i run the job from ESPx ( with user name as ABC inside the job definition) it should run the .bash_profile of the user ABC correct? But its not happening. It is failing as it was not able to find the variables.

I need some clarification here? why the ESPx( with user name as ABC inside the job definition) user cannot run the .bash_profile?

Re: Question with ESP User in ESP job

PostPosted: Mon Feb 13, 2017 8:08 pm
by Robert Sample
Are you using BPXBATCH to execute your script? If so, this note from the z/OS UNIX System Services User's Guide is relevant -- note that NOTHING is said about .bash_profile:
Note: When using BPXBATCH with the SH option (SH is the default), environment variables specified in the STDENV DD are overridden by those specified in /etc/profile and .profile (which overrides /etc/profile). This is because SH causes BPXBATCH to execute a login shell that runs the /etc/profile script and runs the user's .profile.
To pass environment variables to BPXBATCH, you define a file containing the variable definitions and allocate it to the STDENV ddname. The file can be one of the following:

A z/OS UNIX file identified with the ddname STDENV
An MVS™ data set identified with the ddname STDENV

If you are running your script in some other way, you need to explain more than you have.

Re: Question with ESP User in ESP job

PostPosted: Mon Feb 13, 2017 11:31 pm
by did007
what does that mean BPXBATCH? I use bash shell to run our scripts usually from command line

Re: Question with ESP User in ESP job

PostPosted: Tue Feb 14, 2017 7:34 am
by Robert Sample
Post the JCL you are using -- BPXBATCH is one of the "normal" ways to execute Unix System Services commands (or shell scripts) in a batch job.