passing a value from a db2 table to a datastage parameter

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
ep_datastage
Participant
Posts: 24
Joined: Wed Apr 16, 2014 11:11 am
Location: United States

passing a value from a db2 table to a datastage parameter

Post by ep_datastage »

I am new to DS and need to read a table and pass the retrieved value to a DS parameter value.

For example, I read the table and get the file path and file location, I need to be able to pass that value to the SEQ File at the end of the process. How can I accomplish that?


Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard.

You can't do that in a single job. You need one job to read and store the value (perhaps in its user status area) and the controlling sequence can pass the value to a job parameter in the second job. The Sequential File stage's File property is set to a reference to that job parameter.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ep_datastage
Participant
Posts: 24
Joined: Wed Apr 16, 2014 11:11 am
Location: United States

Post by ep_datastage »

I have a job set up to read the DB2 table and write the value to a file.

I have added that to the SEQ job as the first job, then added a Exec_Command stage to attempt to read the file. But not sure at this point how to get the value I had read into a DS parameter
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The result of the Execute Command activity is available as an activity variable that you can use to populate the job parameter in the Job activity.

Note that you may need to trim a trailing field mark character.

Code: Select all

Trim(MyCommand.$CommandOutput, @FM)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ep_datastage
Participant
Posts: 24
Joined: Wed Apr 16, 2014 11:11 am
Location: United States

Post by ep_datastage »

Thanks. Got it working.


Thanks again
Post Reply