passing parameters

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
MerinaPremaj
Participant
Posts: 4
Joined: Thu Oct 20, 2011 4:33 am

passing parameters

Post by MerinaPremaj »

how to get parameters from a sequential file and pass those values as parameters to a job?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Welcome.

What exactly is in the ssequential file? Name/value pairs, I assume? Regardless, what you'll basically need is something to read the file and then assign those values to the parameters either before you run the job or as you launch it. The former approach would all be handled via the API in "job control" code that you write using functions like DSAttachJob, DSSetParam and DSRunJob.

The latter approach would be something you script, where the values are read from the file and a "parameter string" built for all of the pairs. Meaning, a series of "-param XXXX=YYYY" statements that you then pass along with all of the other required parameters to the dsjob command when you launch the job from the command line.

Now, all of this can be automated (to a large degree) by leveraging "value files" for your parameters via a Parameter Set. The Designer Client Guide pdf has all the details on that approach.
-craig

"You can never have too many knives" -- Logan Nine Fingers
MerinaPremaj
Participant
Posts: 4
Joined: Thu Oct 20, 2011 4:33 am

Post by MerinaPremaj »

Hi,
The sequential file contains......
ID PATH SOURCE DESTINATION
1 C:\info src.csv dest.csv
2 C:\info src1.csv dest1.csv

I need to fetch these values and pass it as parameters to a job..
I dont know how to retrieve these values and and pass it as parameter to a job..

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

Post by ray.wurlod »

Create a Parameter Set (separate from the job).
In the Parametet Set create the three parameter names, just as you would in a job.
Create two "values files". Put the values into these values files (easiest for you is manually in the Parameter Set dialog).
Add the Parameter Set to your job.

Anything else involves tedious programming that is no longer necessary.

If you're invoking the job from the dsjob command line interface in version 8.7 there is a parameter file option, but the structure of the file is different from the one you have.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
MerinaPremaj
Participant
Posts: 4
Joined: Thu Oct 20, 2011 4:33 am

Post by MerinaPremaj »

Actually the sequential file is taken from the database table which will change.
Then how those changed values will get reflected in the parameter set?
I want it to be dynamic. Can u pls let me know any solution??
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Create a job that reads the table and writes the values out to the appropriate value set file(s) in the appropriate format.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply