Running Wrong Profile from Script

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
oacvb
Participant
Posts: 128
Joined: Wed Feb 18, 2004 5:33 am

Running Wrong Profile from Script

Post by oacvb »

Hi,

We have environment variable(EDW_HOME) at Unix level whose value is set up at profile (.profile) file which presents at home directory of a user. Value depends on user logged in.

Please find the values of EDW_HOME depends on the user.

User= etladmin
EDW_HOME=/hedw

User= etldev
EDW_HOME=/hedw_dev

User= etlsit
EDW_HOME=/hedw_sit

User= etluat
EDW_HOME=/hedw_uat



Now i created a script which creates a log file in the EDW_HOME directory and calling the script from job. The same job is imported into the following projects

Dev
Sit
Uat

I logged in to Dev project as etldev user and ran the job. But it tries to create a log file in /hedw directory. It happens with all the users and projects. i.e.always it tries to create in /hedw directory and looks like it is default. I wanted to create the log file based on user. If i execute the same script from command prompt it is working fine. Please let me know what could be the problem.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Look in the second event in the job log, which shows all environment variables' settings. Look in the first event in the job log ("job starting") which shows all job parameter settings with which the job was invoked. Figure out whether they're being passed properly. Check the job design, to see whether the pathname is hard coded as /hedw rather than being a reference to a job parameter.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Jobs run as phantoms. They have no UNIX shell like ksh therefore they do run any .profile. You need to add this to dsenv or uv.rc or as Ray's states.
Mamu Kim
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Or create a Environmental varialbe which will be configured for each project, to the home directory of that corresponding user. And pass this variable as parameter to the shell and source the .profile for each time, so that you can ensure that the user specific variable is used.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply