Reading parameter from a file or Table

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
Das
Participant
Posts: 87
Joined: Tue Oct 24, 2006 9:58 pm
Location: india

Reading parameter from a file or Table

Post by Das »

Hi ,

I wanted to pass one parameter to a DS job from file.Actually the scenario is as follows ,I need to run a DS job N times for some different values of some ids which I can store in a file or a table.

Please let me know is it possible ...?
If possible how can i read parameter vlues from file ..?
Which is the better option sequncer or control job.?

Thanks in advance..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'd have more options if you were on a 7.x version, Sequence jobs support looping constructs there. For your version, I'd look into either hand coded job control if you are comfortable with that, or perhaps a job that reads the parameter file/table and leverages the UtilityRunJob function inside the Transformer to run one iteration of your job per record read. You'll need some sort of output from the transformer as well, status of each job run to a flat file would be typical.

Pretty sure that's available in your version.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Das
Participant
Posts: 87
Joined: Tue Oct 24, 2006 9:58 pm
Location: india

Post by Das »

chulett wrote:You'd have more options if you were on a 7.x version, Sequence jobs support looping constructs there. For your version, I'd look into either hand coded job control if you are comfortable with that, or perhaps a job that reads the parameter file/table and leverages the UtilityRunJob function inside the Transformer to run one iteration of your job per record read. You'll need some sort of output from the transformer as well, status of each job run to a flat file would be typical.

Pretty sure that's available in your version.
hi
While using UtilityRunJob(%JobName%, %ParamsAssignments%, %RowLimit%, %WarnLimit%)in transformar.Can i use as below
the input for the transformar is the file which contains the parameters and job name is the job which i need to run .please tell me about
%RowLimit%, %WarnLimit% fields and How can pass more than one parameter .?

thanks
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

You can pass the parameters delimited by | characters. Row limit is the number after which the job need to be stopped. And the Warning is the limit is the number of warning after which thejob will abort.
You can use the input values read from file as argument.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Das
Participant
Posts: 87
Joined: Tue Oct 24, 2006 9:58 pm
Location: india

Post by Das »

kumar_s wrote:You can pass the parameters delimited by | characters. Row limit is the number after which the job need to be stopped. And the Warning is the limit is the number of warning after which thejob will abort.
You can use the input values read from file as argument.
Thanks.
I have two columns Col1 and Col2 in the input parameter file .I need to pass pass both can i use as follows.

UtilityRunJob('DSMyJob',link1.Col1|link1.Col2 ,50,50)
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Actaully I never tried. Perhaps try the following

Code: Select all

UtilityRunJob('DSMyJob','Parameter1=':link1.Col1:'|':'Parameter=':link1.Col2 ,50,50).
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

UtilityRunJob('DSMyJob',link1.Col1|link1.Col2 ,50,50) is not correct.

It should be
UtilityRunJob('DSMyJob','Param1=' : link1.Col1 : '|' :'Param2=' : link1.Col2 ,50,50)

Where Param1, Param2 are the names of the parameter used in DSMyJob.
Success consists of getting up just one more time than you fall.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

loveojha2, Thanks for confirming.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply