Hi,
Can anyone tell how the batch in Parallel executes. As i tried with removing the "DSwait for Job" job control to run the batch in parallel. I want the status of the job to show Finish Status
Thanks
Batch in Parallel
Moderators: chulett, rschirm, roy
Welcome aboard. You should consider creating a loop to periodically check the status of the started jobs using the documented APIs. When you notice a job has now finished, take the appropriate action. The DSWaitForJob API is an infinite routine which waits forever for the controlled job to finish. It's not very elegant if you want to start several jobs at once and then wait for them all to finish.
If you don't like the looping structure (best recommendation) then you could move all of the DSWaitForJob statements to the bottom of your Batch job, so that all jobs get started first. At the bottom, you put all of the waiting and checking statements. Not as elegant as the first recommendation, but you will get your block of jobs started and running before waiting.
If you don't like the looping structure (best recommendation) then you could move all of the DSWaitForJob statements to the bottom of your Batch job, so that all jobs get started first. At the bottom, you put all of the waiting and checking statements. Not as elegant as the first recommendation, but you will get your block of jobs started and running before waiting.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re-organize the code in the batch so that, instead of Run Wait Run Wait, it goes with Run Run Wait Wait. It's up to you where you test the exit status (though obviously it must follow the appropriate DSWaitForJob).
Try to start using job sequences. They offer everything the batch mechanism does (except the ability to create in Director) and a whole lot more besides. Also, if "they" ever decide to change the underlying language, you are insulated from that decision.
Try to start using job sequences. They offer everything the batch mechanism does (except the ability to create in Director) and a whole lot more besides. Also, if "they" ever decide to change the underlying language, you are insulated from that decision.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.