MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Wait for previous step to be completed before exe next Step?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
nguyenh
Beginner


Joined: 09 Mar 2004
Posts: 52
Topics: 6

PostPosted: Thu May 12, 2005 9:24 am    Post subject: Wait for previous step to be completed before exe next Step? Reply with quote

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:
Code:

 //******************************************************
 //OUTPT  DD  UNIT=SYSDA,DISP=(NEW,CATLG),
 //       DSN=&USERID..TEMP1,
 //       DCB=(RECFM=FB,LRECL=080,BLKSIZE=23440),
 //       SPACE=(CYL,(6,10),RLSE)
 /*
 //OUTEMP DD  UNIT=SYSDA,DISP=(NEW,CATLG),
 //       DSN=&USERID..TEMP2,
 //       DCB=(RECFM=FB,LRECL=080,BLKSIZE=23440),
 //       SPACE=(CYL,(6,10),RLSE)
 /*
 //PUTOUT DD  UNIT=SYSDA,DISP=(NEW,CATLG),
 //       DSN=&USERID..OLDLIST,
 //       DCB=(RECFM=FB,LRECL=086,BLKSIZE=23392),
 //       SPACE=(CYL,(20,10),RLSE)
 /*
 //OUTLST DD  UNIT=SYSDA,DISP=(NEW,CATLG),
 //       DSN=&USERID..NEWLIST,
 //       DCB=(RECFM=FB,LRECL=086,BLKSIZE=23392),
 //       SPACE=(CYL,(20,10),RLSE)
 /*
 //OUTCMP DD  UNIT=SYSDA,DISP=(NEW,CATLG),
 //       DSN=&USERID..PDTCMP.CMP,
 //       DCB=(RECFM=FB,LRECL=132,BLKSIZE=0),
 //       SPACE=(CYL,(55,10),RLSE)
 /*
 )SET CNTR = 0
 )DOT &TAB
 )SET CNTR = &CNTR + 1
 //RDWRT&CNTR  EXEC PGM=RDWRT80,REGION=256K
 )IM STEPOLTS
 //RECINN   DD  UNIT=SYSDA,DISP=(SHR),
 //         DSN=&Q9ODSN.(&TTLEN.)
 //RECOUT   DD  UNIT=SYSDA,DISP=(MOD),
 //         DSN=&USERID..TEMP1
 //SYSOUT   DD  SYSOUT=*,DCB=(RECFM=FBA,LRECL=121,BLKSIZE=12100)
 //SYSPRINT DD  SYSOUT=*,DCB=(RECFM=FBA,LRECL=121,BLKSIZE=12100)
 //SYSDBOUT DD  SYSOUT=*,DCB=(RECFM=FBA,LRECL=121,BLKSIZE=12100)
 //MEMBER   DD  *
 &TTLEN
 /*
 )ENDDOT
/*
/*****>>>this is where I need to insert SLEEP() ******************************
 )SET DSN1 = 1
 )SET DSN2 = OLDLIST
 )IM SORTPDT
 /*
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu May 12, 2005 9:31 am    Post subject: Reply with quote

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
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Thu May 12, 2005 9:34 am    Post subject: Reply with quote

nguyenh,

Your job steps will run serially. You don't need a Sleep step at all.
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
nguyenh
Beginner


Joined: 09 Mar 2004
Posts: 52
Topics: 6

PostPosted: Thu May 12, 2005 10:12 am    Post subject: Reply with quote

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???
Code:

//RDWRT&CNTR  EXEC PGM=RDWRT80,REGION=256K
)IM STEPOLTS
//RECINN   DD  UNIT=SYSDA,DISP=(SHR),
//         DSN=&Q9ODSN.(&TTLEN.)
//RECOUT   DD  UNIT=SYSDA,DISP=(MOD),
//         DSN=&USERID..TEMP1
//SYSOUT   DD  SYSOUT=*,DCB=(RECFM=FBA,LRECL=121,BLKSIZE=12100)
//SYSPRINT DD  SYSOUT=*,DCB=(RECFM=FBA,LRECL=121,BLKSIZE=12100)
//SYSDBOUT DD  SYSOUT=*,DCB=(RECFM=FBA,LRECL=121,BLKSIZE=12100)
//MEMBER   DD  *
&TTLEN
/*
)ENDDOT
/*
//COND01 IF (RDWRT&CNTR..RC EQ 0) THEN
)SET DSN1 = 1
)SET DSN2 = OLDLIST
)IM SORTPDT
/*
//COND01 ENDIF
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Thu May 12, 2005 5:01 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group