View previous topic :: View next topic |
Author |
Message |
neoframer Beginner

Joined: 28 Jun 2003 Posts: 10 Topics: 6
|
Posted: Sat Jun 28, 2003 5:23 am Post subject: Job Stream |
|
|
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 |
|
 |
ofer71 Intermediate
Joined: 12 Feb 2003 Posts: 358 Topics: 4 Location: Israel
|
Posted: Sat Jun 28, 2003 11:38 am Post subject: |
|
|
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 |
|
 |
Mike Beginner

Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
|
Posted: Sun Jun 29, 2003 5:24 pm Post subject: |
|
|
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 |
|
 |
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Sun Jun 29, 2003 10:45 pm Post subject: |
|
|
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 |
|
 |
Kathi Beginner

Joined: 14 May 2003 Posts: 25 Topics: 0 Location: Mission Viejo, California
|
Posted: Mon Jun 30, 2003 6:47 am Post subject: |
|
|
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 |
|
 |
Mike Beginner

Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
|
Posted: Mon Jun 30, 2003 5:11 pm Post subject: |
|
|
Slade,
you've blown my cover
Kathi,
it appears that there are many sites that don't have schedulers. _________________ Regards,
Mike. |
|
Back to top |
|
 |
neoframer Beginner

Joined: 28 Jun 2003 Posts: 10 Topics: 6
|
Posted: Wed Jul 02, 2003 10:08 pm Post subject: |
|
|
Mike,
The solution worked fine.
Thanks |
|
Back to top |
|
 |
neoframer Beginner

Joined: 28 Jun 2003 Posts: 10 Topics: 6
|
Posted: Fri Jul 11, 2003 8:59 am Post subject: |
|
|
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 |
|
 |
Mike Beginner

Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
|
Posted: Sun Jul 13, 2003 4:42 pm Post subject: |
|
|
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 |
|
 |
|
|