Page 1 of 1

environment variable doubt

Posted: Wed May 17, 2006 4:33 am
by rishabh
Hi everyone,

I am using DS server edition 7.5.1 with DB2 running on unix server.

I want to set the environment variable value in one of the jobs as a result of some intermediate calculations. This new value must be used in all the other jobs as the environment variable.

Can this be done and if yes what is the procedure to achieve the same.
Thanks in advance

Re: environment variable doubt

Posted: Wed May 17, 2006 5:26 am
by dprasanth
rishabh wrote:Hi everyone,

I am using DS server edition 7.5.1 with DB2 running on unix server.

I want to set the environment variable value in one of the jobs as a result of some intermediate calculations. This new value must be used in all the other jobs as the environment variable.

Can this be done and if yes what is the procedure to achieve the same.
Thanks in advance
One way of doing it is defining the variable at PROJECT level in ds administrator.
Login to adminstrator , click on the project you want and then properties.
In the bottom you will see enviornment. Click on that and you will see userdefined variables. Define your environment variables there and you can see it in all the jobs in that project.
Say you want to define a SHELL
You will just say SHELL and the value as /bin/ksh.

Posted: Wed May 17, 2006 5:27 am
by evanmaas
HI,

This solution only works for sequence.
You can use the DSSetUserStatus to put the value of your result in a job or routine. Use <jobname>/<routinename>.$Returnvalue as value expression in other Job activity/routine activity.

Regards,

Erik

Posted: Wed May 17, 2006 5:41 am
by rishabh
thanks for the prompt replies..

Let me clarify my exact requirements.
I define an environment variable say VarTry in the administartor with value as say 'abc'

I want to override it in a job X with VarTry being set to 'xyz'
Can this be done?
Also now i want all the subsequent jobs to use VarTry with the new value 'xyz' and not the original value 'abc'.

I tried putting the environment varible VarTry as a stage varibale in the transformer and to reset it to 'xyz'.However this does not change VarTry value in Job Y.

Thanks :)

Posted: Wed May 17, 2006 5:54 am
by evanmaas
rishabh wrote:thanks for the prompt replies..

Let me clarify my exact requirements.
I define an environment variable say VarTry in the administartor with value as say 'abc'

I want to override it in a job X with VarTry being set to 'xyz'
Can this be done?
Also now i want all the subsequent jobs to use VarTry with the new value 'xyz' and not the original value 'abc'.

I tried putting the environment varible VarTry as a stage varibale in the transformer and to reset it to 'xyz'.However this does not change VarTry value in Job Y.

Thanks :)

Environment variables you can't override or change in processes only in DS administrator. Use of environment parameters is never change in the project and you want changes parameters. Why don't you use job parameters? My earlier suggestion works for jobparameters,

Regards,

Erik

Posted: Wed May 17, 2006 6:03 am
by rishabh
ya erik i understand what u have suggested..

Can you please tell me what can be used at the job level,which when once set can be used for all the other jobs which follow.

Something like a global variable in Data stage which is set in a job and then used throughout.

Thanks

Posted: Wed May 17, 2006 6:19 am
by evanmaas
Steps to follow:
Important is use of jobsequence because you have dependency.

1 fill the userstatus of the job with calculated value (dssetuserstatus) in job1
2 In job activity of jobsequece of job2 you use job1.$Returnvalue as value expression for parameter calc_par.
3 job2 will run with value of returnstatus of job1

I've done this several times

Erik