Page 1 of 1

execute multiple jobs trough single JCL

Posted: Tue Nov 12, 2024 10:03 pm
by Sumit Mehra
Hello,

How to execute multiple jobs trough single JCL

Re: execute multiple jobs trough single JCL

Posted: Wed Nov 13, 2024 3:39 am
by zum13
Hello.

There are a couple of things I think this could refer to.

You can put multiple jobs in the same file and submit them, for instance:

Code: Select all

//JOB1     JOB 1,'Job 1',MSGCLASS=A,CLASS=A,PRTY=6
//*********************************************************************
//STEP1   EXEC PGM=IEFBR14                                             
//                                                                     
//JOB2     JOB 1,'Job 2',MSGCLASS=A,CLASS=A,PRTY=6
//*********************************************************************
//STEP1   EXEC PGM=IEFBR14                                            
//
Alternatively, you can get a job to submit other jobs by writing to the internal reader:

Code: Select all

//STEP1   EXEC PGM=IEBGENER                    
//SYSPRINT  DD SYSOUT=*                        
//SYSIN     DD DUMMY                           
//SYSUT1    DD DSN=jcl-dataset(member),DISP=SHR
//SYSUT2    DD SYSOUT=(A,INTRDR)              
This can be done multiple times within the job to submit many other jobs, or it can be used to chain jobs, e.g. JOB1 submits JOB2 on completion, JOB2 submits JOB3, and so on.

Re: execute multiple jobs trough single JCL

Posted: Wed Nov 13, 2024 5:54 pm
by enrico-sorichetti
REMEMBER ...
depending on the system setup
the jobs might not be executed in the sequence you see in the submitted file
 

Re: execute multiple jobs trough single JCL

Posted: Mon Nov 18, 2024 10:57 am
by Sumit Mehra
Thank you for all the help.

I have tried using INTRDR. This is great.

Re: execute multiple jobs trough single JCL

Posted: Mon Nov 18, 2024 10:57 am
by Sumit Mehra
enrico-sorichettiREMEMBER ...
depending on the system setup
the jobs might not be executed in the sequence you see in the submitted file
 
Thank you enrico, I noticed that. Why does that happen?