calling environmental varible in transformer stage

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
vinsashi
Participant
Posts: 150
Joined: Mon Aug 20, 2007 4:52 am
Location: singapore

calling environmental varible in transformer stage

Post by vinsashi »

Hi,
I declared one user defined environmetal varible "rec_flag" in administrator.I called that one job parameters in job.and in transformer stage for one column i called that job parameter(derivation is like this:$rec_flag).When compiling it showing error.

Thanks
V................
nayanpatra
Participant
Posts: 41
Joined: Sat Jun 06, 2009 11:13 pm
Location: Kolkata

Post by nayanpatra »

The derivation should not start with $ for job parameters in a transformer stage
Nayan
vinsashi
Participant
Posts: 150
Joined: Mon Aug 20, 2007 4:52 am
Location: singapore

Post by vinsashi »

if we call that jobparameter we will get like that only........
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Use GetEnvironment() to retrieve an environment variable value.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Use GetEnvironment() to retrieve an environment variable value.
And do this as the initial value derivation for a stage variable and then reference the stage variable in the output column. You DON'T want to call GetEnvironment() in an output column derivation...not a good practice.
- james wiles


All generalizations are false, including this one - Mark Twain.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

nayanpatra wrote:The derivation should not start with $ for job parameters in a transformer stage
As an FYI...this has changed with 8x. You can now directly use $-named job parms in a transformer.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

... only if they're in the job as parameters.

GetEnvironment() can reference any environment variable available to the process.
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