Page 1 of 1

Functionality of the -WAIT parameter used along with DSJOB

Posted: Fri Sep 19, 2008 4:22 pm
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.

Posted: Fri Sep 19, 2008 5:38 pm
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.

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

Posted: Fri Sep 19, 2008 6:58 pm
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.