How to Set Variables in DataStage?

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
sasikiran
Participant
Posts: 17
Joined: Wed Dec 14, 2005 3:20 am
Location: Australia
Contact:

How to Set Variables in DataStage?

Post by sasikiran »

Hi All,

I have a requirement like I have to set the variable based on output of the some logic, how to do this?


In Detail:

I have a table, from that table I have to fetch the value of one column based on date and state, I have to store this value in one variable which I will use further in my jobs. Please help me out on this.


Thanks in Advance

Thanks for Reply
SasiKiran
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I land the values in a hashed file. I use the utility hash read routine to read it into a variable in a sequence to load it into a parameter.
Mamu Kim
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

You can also set the value into job's userstatus and read the value in job sequence.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

As Kim suggested, do your select and load it into a hashed file with a dummy key. Then read that value where ever you want, in the transformer or set it as a default value of a parameter etc.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A User Variables activity in a job sequence allows each variable to be set based on an expression.

A stage variable in a Transformer stage similarly allows initialization using an expression. If this variable needs to remain unchanged for each row processed, leave its Derivation field empty.

Where is your variable?
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