Env Variables in Transformer

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
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Env Variables in Transformer

Post by pravin1581 »

Hi All,

Is it not possible to insert Env variables in the stage variables of Transformer , we are receiving compilation error on doing the same.

Thanks.
dsnovice
Participant
Posts: 38
Joined: Thu Jul 22, 2004 11:56 pm
Location: Mclean, VA
Contact:

Post by dsnovice »

You can insert Env variable. $ENV_VARIABLE there are no '#' . there must be some other error, like a missing ':'.

thank you,
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

dsnovice wrote:You can insert Env variable. $ENV_VARIABLE there are no '#' . there must be some other error, like a missing ':'.

thank you,
My insertion was absoltely fine, in fact i have inserted it from the ellipsis and then job parameter.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Use the transform function GetEnv() I believe. Double check its name, it will be the last transform function category and the only function in that category.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

DSguru2B wrote:Use the transform function GetEnv() I believe. Double check its name, it will be the last transform function category and the only function in that category.
Thanks for the answer, we have tried out that option, but the result is same, no error when we write in the Transformer but we are getting compilation error.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Can you post your derivation?
Also, you need to give the environment variable inside GetEnv() and not the job parameter.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

DSguru2B wrote:Can you post your derivation?
Also, you need to give the environment variable inside GetEnv() and not the job parameter.
We are invoking the function GetEnvironment from the Transformer and as the argument to it passing the Env Variable that has been declared in the job prop-parameters tab.We are chhosing the env variables from the ellipsis and then JobParameter.

Thanks.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Well, it should work. Thats why it is there. I am not at a px site so cannot check that for you.
If you have the value defined in the job properties, then you can just specify the environment variable. You do not even need to invoke the GetEnvironment() function.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

DSguru2B wrote:Well, it should work. Thats why it is there. I am not at a px site so cannot check that for you.
If you have the value defined in the job properties, then you can just specify the environment variable. You do not even need to invoke the GetEnvironment() function.
Initially I was trying that way, without the function.
Post Reply