Batch script

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
naren6876
Participant
Posts: 233
Joined: Mon Feb 07, 2005 7:19 pm

Batch script

Post by naren6876 »

I would like to run the same job 5 times with different parameter values.
I want to do this with a batch script.

I want to write something like below.

dsjob -run -wait -param ParamName=Value1 Myproject Myjob

dsjob -run -wait -param ParamName=Value2 Myproject Myjob

dsjob -run -wait -param ParamName=Value3 Myproject Myjob

dsjob -run -wait -param ParamName=Value4 Myproject Myjob

dsjob -run -wait -param ParamName=Value5 Myproject Myjob

Is that good approach or not?.
any input would be greatly appreciated.

Thanks in advance.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Thats a fine approach. Make sure you put enough error handling mechanisms in there.
A suggestion: If the running of one job will not affect the running of another then you can probably make this job a multi-instance job and call the instance with different parameters.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

For example:

dsjob -run -wait -param ParamName=Value1 Myproject Myjob.1

dsjob -run -wait -param ParamName=Value2 Myproject Myjob.2

dsjob -run -wait -param ParamName=Value3 Myproject Myjob.3

dsjob -run -wait -param ParamName=Value4 Myproject Myjob.4

dsjob -run -wait -param ParamName=Value5 Myproject Myjob.5

If you run them at the same time, make sure they're not all trying to write to the same sequential file, or lock the same row in any database table.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If you are planning to run in parallel, you can remove the "-wait" option in the suggest command list.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
naren6876
Participant
Posts: 233
Joined: Mon Feb 07, 2005 7:19 pm

Post by naren6876 »

kumar_s wrote:If you are planning to run in parallel, you can remove the "-wait" option in the suggest command list. ...
My requirement is First one should be finished before second one starts. That's why i put 'wait' option.

am i in the right path?. and Myjob is not multi instance one.

Thanks in advance
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

If you have to run them one by one then your good.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

As per your requirement you command is correct. If you are done with it, you can mark topic as resolved.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply