Question with ESP User in ESP job



Ask queries about other IBM Tools like Tivoli, COBTEST, Fault Analyzer, z/OS File Manager, Workload Simulator, APA, SCLM, Merge & Migration Tools etc...

Question with ESP User in ESP job

Postby did007 » Mon Feb 13, 2017 7:53 pm

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?
did007
 
Posts: 2
Joined: Mon Feb 13, 2017 5:31 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Question with ESP User in ESP job

Postby Robert Sample » Mon Feb 13, 2017 8:08 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Question with ESP User in ESP job

Postby did007 » Mon Feb 13, 2017 11:31 pm

what does that mean BPXBATCH? I use bash shell to run our scripts usually from command line
did007
 
Posts: 2
Joined: Mon Feb 13, 2017 5:31 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Question with ESP User in ESP job

Postby Robert Sample » Tue Feb 14, 2017 7:34 am

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to Other IBM Tools

 


  • Related topics
    Replies
    Views
    Last post