Posted: Thu May 12, 2005 9:24 am Post subject: Wait for previous step to be completed before exe next Step?
Like in modern programming languages we have statement like SLEEP(#second), Can I do similar in JCL Skeleton, I have a JCL, that prepares input file TEMP1 then next step is to sort TEMP1. But the step that prepares input file TEMP1 may take a little bit longer depending on length of the input files, So I want to make sure that it is completed befor execute the SORT step. What is the appropriate way to do this? I am wondering if there is a way to put a sleep() type, or time loop in between, but dont know how this is done, could someone please help! Thank you so much!
here is excert of my JCL:
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu May 12, 2005 9:31 am Post subject:
Quote:
I have a JCL, that prepares input file TEMP1 then next step is to sort TEMP1. But the step that prepares input file TEMP1 may take a little bit longer depending on length of the input files, So I want to make sure that it is completed befor execute the SORT step.
Let me get this straight. YOu have 2 steps. Step1 is a pgm which creates a file which will later be used in step2 . Is that right?
If that is the case then you don't have to implement any special logic to wait. Step2 WILL NOT run untill step1 ran successfully.
Kolusu and Mervyn, Man you guys are quick! Thanks!
kolusu wrote:
Let me get this straight. YOu have 2 steps. Step1 is a pgm which creates a file which will later be used in step2 . Is that right?
If that is the case then you don't have to implement any special logic to wait. Step2 WILL NOT run untill step1 ran successfully.
Kolusu
Well that is what I thought too but, When I ran the job and I look at the TEMP1, it only contains 133438 records, but I expected it to have 136292 records. and the missing record seems to be the one at the end of the file.
After write that message, I tried this And it seams to work ok, do you all know why???
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
Posted: Thu May 12, 2005 5:01 pm Post subject:
I think we need to see your expanded JCL, not just the skeleton code. You're asking us to judge without seeing all the evidence.
Please confirm that you delete the TEMP1 file between runs. I'm a little concerned that by specifying UNIT=SYSDA for the RECOUT dataset in RDWRT80 you may be bypassing the catalog, and you could actually have more than one version of TEMP1, so it's arbitrary which version is being expanded. _________________ The day you stop learning the dinosaur becomes extinct
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum