Functionality of the -WAIT parameter used along with DSJOB

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
ratuldey
Participant
Posts: 33
Joined: Fri Jul 13, 2007 4:50 pm

Functionality of the -WAIT parameter used along with DSJOB

Post by ratuldey »

Hi,

We have been firing our Datastage sequences in both parallel and sequential mode through Shell Scripts in UNIX as per our earlier design. We would now want to change this format and put some other jobs in Sequential and others in Parallel. For this We would need to completely understand the login behind the -WAIT parameter. Please find the mechanism through which the jobs are being executed -

$DSHOME/bin/dsjob -run -wait ProjectName JobName1
$DSHOME/bin/dsjob -run ProjectName JobName2
$DSHOME/bin/dsjob -run ProjectName JobName3
$DSHOME/bin/dsjob -run ProjectName JobName4
$DSHOME/bin/dsjob -run ProjectName JobName5
$DSHOME/bin/dsjob -run -wait ProjectName JobName6
$DSHOME/bin/dsjob -run -wait ProjectName JobName7

where $DSHOME points to the Datastage HOME directory.
We would like to know whether the -WAIT parameter prevents the job following this job to wait or does it imply that the job which has the -WAIT parameter actually waits for the preceding job.

As the order in which we fire the jobs might imply that the job - JobName1 is executed first with a WAIT parameter. Thus does this make the jobs - JobName2, JobName3, JobName4 and JobName5 to wait? If so, then ideally when JobName1 completes, the jobs that start running are - JobName2, JobName3, JobName4, JobName5 and JobName6 (which itself contains the WAIT parameter).
If otherwise then I guess JobName6 would wait till the jobs preceding it complete.
If the former case is true, then do you consider there is any utility in keeping the -WAIT parameter in the last job - JobName7, since it is the job and no other jobs following this need to be run?

Thanks!
Ratul.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If -wait or -jobstatus is specified dsjob -run does not return until the job status changes from "Running".

In your example JobName1 runs first, then JobName2 through JobName6 run simultaneously. JobName7 runs only after JobName6 finishes (irrespective of the run status of JobName2 through JobName5).

There is no particular utility in having a -wait option for JobName7, except to prevent this entire script from finishing until JobName7 finishes. However, it may still be the case that any combination of JobName2 through JobName5 may still be running at this time.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Functionality of the -WAIT parameter used along with DSJ

Post by chulett »

ratuldey wrote:We would like to know whether the -WAIT parameter prevents the job following this job to wait or does it imply that the job which has the -WAIT parameter actually waits for the preceding job.
Neither. It means the job you initiate with the -wait option will not return control to the shell script until the job completes. Wait for it to finish before doing anything else, in other words.
-craig

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