Running all jobs in a project from command line

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
sumesh.abraham
Participant
Posts: 153
Joined: Thu May 11, 2006 1:52 am
Location: Bangalore

Running all jobs in a project from command line

Post by sumesh.abraham »

Hi All,

I'm unable to search the forum. So I'm posting it.

How can all the jobs in a project be ran from command line. Can dsjob or dsadmin commands do it?

Thanks,
Sumesh
sonal
Premium Member
Premium Member
Posts: 8
Joined: Tue Jun 07, 2005 1:10 am
Location: India

Post by sonal »

Yes, jobs can be run form command line using the command

dsjobs -run option.

You could write a shell script that calls the run command and repalces the job name with a new one everytime it runs.
sumesh.abraham
Participant
Posts: 153
Joined: Thu May 11, 2006 1:52 am
Location: Bangalore

Post by sumesh.abraham »

Hi Sonal,
Thanks for the reply.

Do u mean to say that other than writing a shell script, no direct commands are available?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In what order do you want to run them?

There is no command like dsjob -run * if that's what you're looking for. But you could do something like

Code: Select all

for j in `dsjob -ljobs project`
do
   dsjob -run -jobstatus options project ${j}
done
(all on one line if desired). Of course you will have no control over the order of execution (probably alphabetical order!).
Last edited by ray.wurlod on Fri Mar 30, 2007 11:13 am, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

ray.wurlod wrote:In what order do you want to run them?
Ray's solution will work for you if the answer to his question is, "It does'nt matter", which is rarely the case.
Build a file which has all the job names in the order in which they need to be run. Cat the file, read it one by one and pass it to the dsjob -run command.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply