execute multiple jobs trough single JCL

All sort of Mainframes Interview Questions.
Post Reply
Sumit Mehra
Registered Member
Posts: 22
Joined: Sun Feb 21, 2016 5:43 pm
India

execute multiple jobs trough single JCL

Post by Sumit Mehra »

Hello,

How to execute multiple jobs trough single JCL
User avatar
zum13
Active Member
Posts: 113
Joined: Thu May 04, 2023 12:58 am

Re: execute multiple jobs trough single JCL

Post 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.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 841
Joined: Wed Sep 11, 2013 3:57 pm

Re: execute multiple jobs trough single JCL

Post by enrico-sorichetti »

REMEMBER ...
depending on the system setup
the jobs might not be executed in the sequence you see in the submitted file
 
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
Sumit Mehra
Registered Member
Posts: 22
Joined: Sun Feb 21, 2016 5:43 pm
India

Re: execute multiple jobs trough single JCL

Post by Sumit Mehra »

Thank you for all the help.

I have tried using INTRDR. This is great.
Sumit Mehra
Registered Member
Posts: 22
Joined: Sun Feb 21, 2016 5:43 pm
India

Re: execute multiple jobs trough single JCL

Post 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?
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”