Environment variables

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

jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Environment variables

Post by jseclen »

Hi Forum,

In my server exists 2 projects, Desarrollo y Certificacion, and each project access to different oracle database. I set in my jobs the environment variables for each project with diferents values, but, when i open the job in Desarrollo shown the rigth values configured for this project, and when i open the job in the Certificacion show the same values!!!

The variables for each projects are: (was settings with Administrator-->Environment)

Desarrollo
************
USER = U100
PASS = xxxx

Certificacion
*************
USER = U200
PASS = yyyy

why show the values of Desarrollo project when i open the certificacion job???

Thanks !!!
Saludos,

Miguel Seclén
Lima - Peru
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Environment variables

Post by gateleys »

You sure you did not hack into the same DSParams file? I guess so, isnce you have mentioned that you used the Admin client. This is weird.
jseclen wrote: why show the values of Desarrollo project when i open the certificacion job???
What happens when you open the Desarrollo project? Is it that the values for Desarrollo project being shown in both projects, or are they interchanged?

Try leaving some variable values in the Certificacion project as empty, and check what happens?
gateleys
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Re: Environment variables

Post by jseclen »

Hi gateleys

I change the values for empty in Certificacion project user variables, and open my job, view the odbc stage and show me the Desarrollo values again.

Is necessary restart the services to take the last changes????

Thanks.
Saludos,

Miguel Seclén
Lima - Peru
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Environment variables

Post by gateleys »

jseclen wrote:Hi gateleys

I change the values for empty in Certificacion project user variables, and open my job, view the odbc stage and show me the Desarrollo values again.

Is necessary restart the services to take the last changes????

Thanks.
For some reason, it seems that your env variables are being written to the same DSParams file? Can you check the DSParams file for hte Certificacion project and scroll down to the check for the values?
gateleys
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I don't think that's right, because changing to "" in Administrator had no effect.

Are you clicking Cancel (rather than OK) to close the Administrator windows?

It is not necessary to re-start services, but it might be interesting to open a new Administrator client after making these changes.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post by Teej »

Are you hard-coding the values in the jobs itself?

Are those environment variables set in dsenv?
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Post by jseclen »

Hi Ray, thanks for your help, but dont work, i changed the variables in Desarrollo and close the window. open another administrator and set new values for certificacion, and press Ok button ...

In the manager open the job from the Desarrollo and Certificacion projects, but is the same result ... show me the values of desarrollo
Saludos,

Miguel Seclén
Lima - Peru
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Post by jseclen »

Hi Teej,

In my job i'm setting job parameters and load this environment variables to the grid. There aren't hardcore values in the job.

And, this environment variables are news and doesnt exist in the dsenv file
Saludos,

Miguel Seclén
Lima - Peru
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

Did you check the values for the concerned variables in DSParams file of each project?
gateleys
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Post by jseclen »

Hi gateleys,

Both files contains the values defined in this administrator window for each one, in desarrollo and certificacion are differents.

DSParams from Desarrollo
[EnvVarValues]
"XCP_DB"\1\"XCPDWX_odbc"
"XCP_USER"\1\"IU231275"
"XCP_PASS"\1\"LD:@09VDM4K"

DSParams from Certificacion
[EnvVarValues]
"XCP_BD"\1\" ertertert"
"XCP_USER"\1\"ertertertert"
"XCP_PASS"\1\"LDH@9HVH=9;L0O4I4:"

Now, what is the next step???? :shock:

p.d. when i was changing the text value and double-click appear a new window that permit to set this text as $ENV or $UNSET, what is the funcionality for this?
Saludos,

Miguel Seclén
Lima - Peru
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

jseclen wrote: p.d. when i was changing the text value and double-click appear a new window that permit to set this text as $ENV or $UNSET, what is the funcionality for this?
OK, in the job parameter window, set each of those variables to $PROJDEF. Now, see if it points to the right parameter value.

$PROJDEF would assign the value that you defined in the User Variables grid in Administrator.
gateleys
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

$ENV tells DataStage to use the current value defined in the environment.
$UNSET tells it to unset/remove that variable from the environment if it is defined there.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Post by jseclen »

Ok now is working ... thanks.

I have a new question about that.

How create a job will use the values of Environment Variables in the job parameters????

For example:

Job1 in Desarrollo use the follow parameters and values
pXCP_DB = BASE1 (define in XCP_DB in Administrator)
pXCP_USER = u020 (define in XCP_USER in Administrator)
pXCP_PASS = xxx (define in XCP_PASS in Administrator)

my wish is when pass to Certificacion this job must be run using the values defined in the Environment Variables for this project, so, the default value may be take the value of environment at run??

Job1 must be use this values:

XCP_DB = BASE10
XCP_USER = u2000
XCP_PASS = yyy

is there a way to make this????
Saludos,

Miguel Seclén
Lima - Peru
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

1. In your job properties, reference the 3 parameters by adding the environment variables.
2. For the values, double/triple click ... a dialog appears ... choose $PROJDEF.
3. In your job, wherever you are using the parameter, use the parameter name enclosed by #. For example: #$pXCP_DB#
gateleys
jseclen
Participant
Posts: 133
Joined: Wed Mar 05, 2003 4:19 pm
Location: Lima - Peru. Sudamerica
Contact:

Post by jseclen »

gateleys,

Last time did not appear this value $PROJDEF only $ENV and $UNSET ... i change the default value with $PROJDEF, try to view the data and work ok !!!

I export the job to certificacion and try to view again and can see the data...

thanks !!!
Saludos,

Miguel Seclén
Lima - Peru
Post Reply