Page 1 of 1

Waiting for job NoDependentJobs.JOBNAME to finish

Posted: Sun Apr 03, 2011 7:41 pm
by SURA
Hi All

I created a Datastage Sequence Job. The aim of this job is to get the list of job names from a file and trigger the jobs it using loop activity stage unconditional.

Job Design:
Execute Command Activity --> StartLoop -->Job Activity -->EndLoop.

Notes: Job Activity will trigger a server job; code written in Job Control to trigger the jobs as a multiple instance.

This is working fine. But i got a question in my mind when i look into the Datastage Director log.

Hence the trigger condion is unconditional in my Sequence why i am getting a message "Waiting for job NoDependentJobs.TEST_01 to finish"

See the below log for reference.

PassNoDependentJobs.TRF.JobControl (@StartLoop_001): Loop through list (2 items): iteration 1

PassNoDependentJobs -> (NoDependentJobs.TEST_01): Job run requested
Mode (row/warn limits) = 0/0
Job Parameters --->
aJOBNAME=TEST_01

DSJobController=PassNoDependentJobs.TRF

PassNoDependentJobs.TRF.JobControl (DSRunJob): Waiting for job NoDependentJobs.TEST_01 to start

PassNoDependentJobs.TRF.JobControl (DSWaitForJob): Waiting for job NoDependentJobs.TEST_01 to finish

PassNoDependentJobs.TRF.JobControl (DSWaitForJob): Job NoDependentJobs.TEST_01 has finished, status = 1 (Finished OK)

Please help me to understand more about Datastage.

Thanks
DS User.

Posted: Sun Apr 03, 2011 8:17 pm
by ray.wurlod
This message is generated by the call to DSWaitForJob() in your job control routine.

Calls to DSRunJob() are asynchronous - that is, the function issues the run request and returns immediately. A subsequent call to DSWaitForJob() is needed if you need not to do anything more until the job(s) in question finish. DSWaitForJob() can wait for more than one job, returning when any of them finishes.

DSWaitForFile running in sequence

Posted: Mon Apr 04, 2011 12:02 am
by SURA
Hi Ray

Thanks for your reply.

Info: Hence i am getting help it should be good to have a Premium Ac. So just now subscribed my Premium Ac.

But still my company is having Premium AC and i checked your reply.

I checked the director of those specific jobs and it starts almost at the same time. So i understood how it works. But still i have one more question to ask.

Execute Command Activity --> StartLoop -->Job Activity -->EndLoop.

Notes: Job Activity will trigger a server job (Job Name: RunJob) Multiple Instance ; code written in Job Control to trigger the jobs. In the job control i written wait for file command too this time.

Result: It is working, but not as per my expectation!!

My expectation :

Sample Data: (Passing values in loop)
Job1, wForFile1
Job2, wForFile2

In the first iteration it should trigger the job "RunJob" (Multiple Instance) with the param values of Job1 , wForFile1.
My code is enough to understand Job1 is the job name and wForFile1 is Wait for File name.

The same thing will happen at the second iteration.

I am expecting to trigger the first job at first iteration and 2nd should trigger at the 2nd iteration, not to wait till Job1 finish.

Code:
Reply = DSWaitForFile(filepath/wForfileName time:2H)
If Reply = DSJE.NOERROR Then
ErrCode = DSRunJob(hJob, DSJ.RUNNORMAL)
End

But now the 2nd iteration job Job2, wForFile2 is waiting till Job1, wForFile1 completes its run. Please guide me how to trigger the jobs in parallel.


Thanks
DS User

Posted: Mon Apr 04, 2011 12:31 am
by ray.wurlod
In short, not using a sequence with dependencies. Check the job control code on the sequence's properties - it always puts in DSWaitForFile(). If you don't want this you have two choices:
(a) sequence without dependencies (no loop)
(b) write your own job control routine at this level too

Posted: Mon Apr 04, 2011 12:42 am
by SURA
Hi Ray

Thanks for your guidance. I will change my approach.

DS User