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 

Job Stream

 
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
neoframer
Beginner


Joined: 28 Jun 2003
Posts: 10
Topics: 6

PostPosted: Sat Jun 28, 2003 5:23 am    Post subject: Job Stream Reply with quote

I have 4 jobs , which are to be run one after another in order :
Job1,job2, job3 and at end job4.

1. JOb2 and all subsequent jobs are to be excuted only if job 1 was completed with RC of 04 or less

2. similarly job3 and subsequent jobs are to be executed only if job1 ended with RC of 4 or less and job2 ended with RC of 8 or less

3. Similarly Job 4 has to be executed only when job1 ended with RC of 4 or less , job 2 ended with RC of 8 or less and job3 ended with RC of 4 or less.

4. I want to create a job stream for all the 4 jobs .i.e. I only require to submit one job and all other jobs are trigerred and hence executed with all above conditions automatically. I've heard of internal reader being used for this purpose but know not much.

Please suggest , solutions to create this job stream. All jobs:
JOB1,JOB2,JOB3 and JOB4 are members of one PDS.
Back to top
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Sat Jun 28, 2003 11:38 am    Post subject: Reply with quote

Hi

Code:

//job cards.....
//*
//JOB01    EXEC PGM=IKJEFT1B,DYNAMNBR=20                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSTSPRT DD SYSOUT=*                                                 
//SYSTSIN  DD *                                                         
  SUB 'your.pds(job01)'                                           
/*                                                                     
//       IF (RC <=4) THEN
//JOB02    EXEC PGM=IKJEFT1B,DYNAMNBR=20                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSTSPRT DD SYSOUT=*                                                 
//SYSTSIN  DD *                                                         
  SUB 'your.pds(job02)'                                           
/*                                                                     
//      ENDIF
//     IF (JOB01.RC <= 4) & (JOB02.RC <=8) THEN
//JOB03    EXEC PGM=IKJEFT1B,DYNAMNBR=20                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSTSPRT DD SYSOUT=*                                                 
//SYSTSIN  DD *                                                         
  SUB 'your.pds(job03)'                                           
/*                                                                     
//       ENDIF
.....
Etc........                                                                     

________
M21


Last edited by ofer71 on Sat Feb 05, 2011 10:57 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Sun Jun 29, 2003 5:24 pm    Post subject: Reply with quote

Ofer,
unfortunately what you have given looks as though it will not work as the condition code chekcing is checking the condition code issued by the IKJEFT01 program that is used to submit the subsequent jobs, as opposed to checking the condition codes issued by the submitted jobs. Furthrmore it appears that an endless loop may be generated as JOB01 is submitting itself.

Neoframer,
somehting like the following would work (you could use IKJEFT01 steps, like ofer has shown instead of the IEBGENER steps (it's just a different method of submitting the jobs):-
Code:

//JOB1 JOB ....... rest of the job card .....
//ST01 EXEC PGM=.....
//ST02 EXEC PGM=.....
//CHKEND IF (RC <= 4) THEN
//NEXTJOB EXEC PGM=IEBGENER
//SYSIN     DD DUMMY
//SYSUT1   DD DISP=SHR,DSN=YOUR.JOB.PDS(JOB2)
//SYSUT2   DD SYSOUT=(,INTRDR)
//SYSPRINT DD SYSOUT=*
//CHKEND ENDIF



//JOB2 JOB ...... rest of the job card .....
//ST01 EXEC PGM=.....
//ST02 EXEC PGM=.....
//CHKEND IF (RC <= 8) THEN
//NEXTJOB EXEC PGM=IEBGENER
//SYSIN     DD DUMMY
//SYSUT1   DD DISP=SHR,DSN=YOUR.JOB.PDS(JOB3)
//SYSUT2   DD SYSOUT=(,INTRDR)
//SYSPRINT DD SYSOUT=*
//CHKEND ENDIF


and so on



Please note that the above code is written from memory and has not been check, so there could well be the odd error or two within the code.
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sun Jun 29, 2003 10:45 pm    Post subject: Reply with quote

Hi Mike,

When I first read this thread, I thought this is made to order for MikeT from that other forum. Then I read your reply; there can't be that many Mikes in Sydney that belong to both these forums. 8)

Regards, Jack.
Back to top
View user's profile Send private message
Kathi
Beginner


Joined: 14 May 2003
Posts: 25
Topics: 0
Location: Mission Viejo, California

PostPosted: Mon Jun 30, 2003 6:47 am    Post subject: Reply with quote

Isn't this what a job scheduler does?

Have you talked with the schedulers at your place to see if it can be done?
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Mon Jun 30, 2003 5:11 pm    Post subject: Reply with quote

Slade,
you've blown my cover Smile Embarassed

Kathi,
it appears that there are many sites that don't have schedulers.
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
neoframer
Beginner


Joined: 28 Jun 2003
Posts: 10
Topics: 6

PostPosted: Wed Jul 02, 2003 10:08 pm    Post subject: Reply with quote

Mike,
The solution worked fine.

Thanks
Back to top
View user's profile Send private message
neoframer
Beginner


Joined: 28 Jun 2003
Posts: 10
Topics: 6

PostPosted: Fri Jul 11, 2003 8:59 am    Post subject: Reply with quote

Mike ,
Your solution allows JOB1 and JOB2 run simultaneously. But my requirement is that I want JOB2 to be executed only when JOB1 is fully completed , because JOB2 has got some dependencies over JOB1.
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Sun Jul 13, 2003 4:42 pm    Post subject: Reply with quote

If the step that submits the following job is the last step then there should be no dependency, even though the jobs will, for a short while run along side each other. You could code DISP=OLD on a dataset used in both jobs, however both jobs will be within JES at the same time (the second being held due to dataset disposition).
Alternately you could have an intermediate job which checks for the completion of the first, for example via a a Rexx/CLIST program using the STATUS command, and then submits the second job (although it would then be the third). This intermediate job could also be delayed by using dataset disposition as an alternative to checking the status.
_________________
Regards,
Mike.
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