Passing Environment variable in Parameters

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
neeraj
Participant
Posts: 107
Joined: Tue May 24, 2005 4:09 am

Passing Environment variable in Parameters

Post by neeraj »

Hi,

We have a RCP jobs which is connecting to multiple source systems. We have created the Parameterset in the job and the values are hardcoded(DSN,USER,PASSWORD etc).

It has been decided to remove the hardcoded values from the parameterset.

We tried few mentioned setps
Defined the environment variables as
$Tuser=Tax
$Ruser=Wax

Created Parameter Set
Variable name =Username

Values
t1 $Tuser
t2 $Ruser

But when I am reading the values in my job and passing t1/t2 of parameterset, I am getting the output as $Tuser or $Ruser instead of Tax and Wax..

Please suggest

Regards
Neeraj
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Post by BI-RMA »

The parameter set you are using does not know what $Tuser is in your context. If $Tuser was one of the parameters of your parameter set, you could set the value to $PROJDEF and the parameter set would take the value defined on the respective project at runtime.

But the way you defined it, Username is simply set to the string "$Tuser" or "$Ruser" at runtime, depending on the value-file you choose. DataStage does not recognize this string to be a parameter defined in the project.

If you absolutely have to find a different solution than to store the "hardcoded" values in the value-files directly, you'll have to find a different approach to this topic altogether.

But using the value-files is one of the best solutions available in DataStage, because by using them you avoid having to recompile your jobs when passing them to another project.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
prasannakumarkk
Participant
Posts: 117
Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India

Post by prasannakumarkk »

Am not sure whether it will work. When giving value in parameter set try giving hash in front and back of environment variable
Thanks,
Prasanna
neeraj
Participant
Posts: 107
Joined: Tue May 24, 2005 4:09 am

Post by neeraj »

Thanks for the reply...

As mentioned in my post, I am using RCP Job and have to pass the database credentials at run time..That is the reason we used parameterset. But due to process point of view, we have to either delete the patameterset or parameterize the parameterset...

Design change in the jobs will have a big impact. :(

Please suggest the best approach.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Are you using values files in conjunction with your Parameter Sets? It seems to me that this is the ideal way to make your design as dynamic as possible.
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