Page 1 of 1

How to Set Variables in DataStage?

Posted: Fri Nov 17, 2006 1:09 am
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

Posted: Fri Nov 17, 2006 6:37 am
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.

Posted: Fri Nov 17, 2006 6:55 am
by balajisr
You can also set the value into job's userstatus and read the value in job sequence.

Posted: Fri Nov 17, 2006 7:04 am
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.

Posted: Fri Nov 17, 2006 7:43 am
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?