How to get value of an Env variable in a stage of a job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
goutam
Premium Member
Premium Member
Posts: 109
Joined: Thu Jul 26, 2007 6:53 am

How to get value of an Env variable in a stage of a job

Post by goutam »

I have an oracle enterprise stage through which i want to load some data to a oracle table . I want to insert the USERID to one of the column of table through which datastage logon to oracle database. This USERID is parametrised and is an environment variable as $ORA_USER_SID. When i tried to insert this value i.e #$ORA_USER_SID# in write mode =upsert and user defined statement it is giving me an error. I also tried to extract this value of env variable thru utility function GetEnv (could not recollect the exact name) in transformer stage .But i am unsuccesful. Any suggestion?It's urgent
Goutam Sahoo
Luciana
Participant
Posts: 60
Joined: Fri Jun 10, 2005 7:22 am
Location: Brasil

Post by Luciana »

Hi Goutam

Try to use the function GetEnvironment('ORA_USER_SID') with this sintaxe.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If it is already 'parameterized' - i.e. a Job Parameter, can you not just refer to the parameter name itself in that column's derivation?
-craig

"You can never have too many knives" -- Logan Nine Fingers
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Re: How to get value of an Env variable in a stage of a job

Post by DeepakCorning »

Did u try to run ur user defined upsert without using the environment variable? Reason to ask this is that may be the error is not because of the parameter but in the User defined Statement.

Also you can try to assign the column the env variable in a transformer prior to the TGT stage.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Procedural Note
We don't do "urgent" here. If you want urgent support, sign up with your support provider for premium support, and learn the true cost of urgent. This is an all-volunteer site; people post as and when they can, and are not paid for doing so.

Personal Note
Anyone marking a post as urgent causes my response to that post to be delayed.
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