Page 1 of 1

passing parameters

Posted: Tue Nov 15, 2011 8:33 am
by MerinaPremaj
how to get parameters from a sequential file and pass those values as parameters to a job?

Posted: Tue Nov 15, 2011 8:46 am
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.

Posted: Tue Nov 15, 2011 10:20 pm
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.

Posted: Wed Nov 16, 2011 12:04 am
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.

Posted: Wed Nov 16, 2011 3:55 am
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??

Posted: Wed Nov 16, 2011 7:02 am
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.