where is the PATH variable value will be set in DataStage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
dwblore
Charter Member
Charter Member
Posts: 40
Joined: Tue Mar 28, 2006 12:02 am

where is the PATH variable value will be set in DataStage

Post by dwblore »

When i'm invoking a unix script from Before job sub-routine and attempting to connect to Db2 , it fails.

But when path variable is been set properly it works fine.

Currently the issue is our dsenv file do not export PATH variable.
So i want to know how does the DataStage gets these values ?
salil
Participant
Posts: 46
Joined: Thu Oct 13, 2005 5:41 am

Re: where is the PATH variable value will be set in DataStag

Post by salil »

Are you able to enter path values in DS Administrator?
Check in Environment for your particular project and ensure the values are correct.
A printer consists of 3 main parts: the case, the jammed paper tray and the blinking red light.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I think it should work in dsenv but never tried it.
Mamu Kim
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Its your .profile. Make sure you are invoking the dsenv in your .profile so that when ever you login, you can go directly to the db2.
Is this problem happening only when you are running it via a script?
Can you go to db2 from the cmd prompt?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Yes, source the dsenv though .profile. But you can check the path being exported in the job log at the entry where Environtment Variable: is given. Will be at first few lines.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
lkthoma
Participant
Posts: 21
Joined: Wed Mar 08, 2006 8:47 am

Post by lkthoma »

You can also source the dsenv in the actual script you are executing in your before-routine.
lkthoma
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Your .profile is not executed when a job runs. PATH should be set in dsenv but it is always useful to source it in your .profile.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's also useful - if you don't set it in dsenv - to set it in the .profile of the dsrpcd user.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Another important thing to remember when scripting shell's for jobs is that make sure you explicity call the dsenv in your script. Sourcing it in your own .profile will help as long as your id is running the script. When these jobs get exported to different environments (system test, uat, pre-production, production) they might not/in most cases will not, run with your id. So it is important for you to source the dsenv in your script by explicity firing it.
My 2 cents.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
novice_pgr
Participant
Posts: 8
Joined: Thu Jan 19, 2006 11:45 pm

Post by novice_pgr »

dwblore:

Salil : I dont have the administrator rights for this system. But when i view the environment settings for our project , it is given as
PATH /IBMdb2/home/db2rtcl/sqllib/bin:/IBMdb2/home/db2rtcl/sqllib/adm

DSGuru2B:
This is happenning only when we run via the script. I login through a user called "carduser" and in its .profile sources the dsenv
In this .profile we have set the PATH to be PATH=/usr/bin:/usr/ucb:/etc:/Datastage/DataStage/DSEngine/bin:.

But when i check in the Director ( as kumar_s suggessted ) for the PATH variable value it is given as
PATH=/Datastage/DataStage/Projects/card30/wrapped:/Datastage/DataStage/Projects/card30/buildop:/Datastage/DataStage/Projects/card30/RT_BP1132.O:/Datastage/DataStage/DSCAPIOp:/Datastage/DataStage/RTIOperators:/Datastage/DataStage/DSParallel:/Datastage/DataStage/PXEngine/user_osh_wrappers:/Datastage/DataStage/PXEngine/osh_wrappers:/Datastage/DataStage/PXEngine/bin:/usr/bin:/usr/ucb:/etc:/oraclient/bin:/usr/ccs/bin:/usr/openwin/bin:/IBMdb2/home/db2inst1/sqllib/bin:/IBMdb2/home/db2inst1/sqllib/adm:/IBMdb2/home/db2rtcl/sqllib/bin:/IBMdb2/home/db2rtcl/sqllib/adm


But Kumar , in the log the script is executed & then it shows the environment variables

1065 INFO Mon May 29 04:30:19 2006
jobname..BeforeJob (ExecSH): Executed command: script_name.sh
1066 INFO Mon May 29 04:30:19 2006
Environment variable settings:

Again want to emphasise that we have not set the PATH in dsenv either.

The problem wht i think from the current PATH setting is "IBMdb2/home/db2inst1/sqllib/bin" is been defined before IBMdb2/home/db2rtcl/sqllib/bin ( which is the correct instance name ) and thats why couldnt connect to db2.

So , if there has been any setting for PATH where it appends the IBMdb2/home/db2rtcl/sqllib/bin to the existing PATH ..i would like to alter it to be prefixed than appended.

thnx
dwblore
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

As with all variable settings, the most recent has effect. For DataStage processes the setting made in dsenv should be the most recent, unless overridden within the job design itself. The second message of a job run in the log contains all environment variable settings - did you check there to see what the value of PATH is? To get it right, make sure it's set in the dsenv file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply