0

I have a requirement wherein I have to submit 10 JCL's. Every JCL is coded to give MAXXCC=0 when completed good.

I want to call all the JCL's from a main JCL so that I don't have to submit all the JCL's manually.

If this is not possible through internal reader, please suggest any other workaround.

THIS IS HOW I CODED THEM CURRENTLY:

//*************************************************************
//* STEP 1: Run job 2
//*************************************************************
//*                                                            
//STEP02   EXEC PGM=IEBGENER                                   
//SYSUT1   DD   DISP=SHR,DSN=HLQ.MYPDS(JCL2)   
//SYSUT2   DD   SYSOUT=(,INTRDR)                               
//SYSPRINT DD   SYSOUT=*                                       
//SYSIN    DD   DUMMY                                          
//*                                                            
//*************************************************************
//* STEP 3: Run job 3
//*************************************************************
//*                                                            
//STEP03   EXEC PGM=IEBGENER,COND=(0,EQ,STEP0)                                   
//SYSUT1   DD   DISP=SHR,DSN=HLQ.MYPDS(JCL3)   
//SYSUT2   DD   SYSOUT=(,INTRDR)                               
//SYSPRINT DD   SYSOUT=*                                       
//SYSIN    DD   DUMMY                                          
//*                                                    
SaggingRufus
  • 1,814
  • 16
  • 32
  • You might want to talk to someone at your site. There are scheduling tools available for this. It seems like you are just trying to get around using a scheduling tool like CTM. I would recommend using what ever scheduling tool your site has available and not use the internal reader for this. – SaggingRufus Jan 05 '17 at 11:21
  • Also, Checking for a return code of 0 will effectively do nothing here. You will get a return code for submitting the job, not the actual return code of the job that ran. The JCL you have provided will not wait until 1 JCL is complete then submit the next one, it will submit all 10 at once without checking the return of the last job. – SaggingRufus Jan 05 '17 at 11:28
  • Thanks for the reply, Exactly, all the 10 JCL's are submitted at once. We have ESP scheduler in my application, I've used it a couple of times in scheduling time driven and dataset driven jobs however I'm confused, how can I use ESP to solve this purpose? – Puneet Abichandani Jan 05 '17 at 12:31
  • You should be able to make a schedule to submit all 10 jobs at once. When the schedule loads (probably based on a time parameter, or the completion of another job) it will submit all of the jobs at once. – SaggingRufus Jan 05 '17 at 12:47
  • 2
    Is your need more complicated than just submitting 10 JOBs? If not, put the 10 jobs into the same data set/member, then when you SUBMIT from ISPF Edit of that member (or even the TSO command-line) all 10 JOBs will be submitted. – Bill Woodger Jan 05 '17 at 16:33
  • 1
    Ah, perhaps part of your question is in the title and not the body of your post? That's always a bad thing to do. Please edit (link under your question) if that is the case. If you have access to a Scheduler, that is the way to go (talk to the people who are responsible for it). – Bill Woodger Jan 05 '17 at 16:38
  • Most schedulers and I believe ESP included have the ability to determine and act according to condition codes/abends, if that's the requirement. An alternative to Bill's suggestion of placing all 10 jobs into 1 dataset would be to concatenate the 10 datasets/jobs (or 10 datasets(member) combinations) into a single step e.g. you could have `SYSUT1` with all 10 datasets like `//SYSUT1 DD DISP=SHR.DSN=HLQ.MYPDS(JCL2)` *newline* `// DD DISP=SHR,DSN=HLQ.MYPDS(JCL3)` *etc*. – MikeT Jan 05 '17 at 19:29

1 Answers1

1

Scheduling System

As other suggested use the scheduling system, I would think all mainframe systems would have some sort of scheduler. Running Jobs in sequence is there bread and butter of Scheduling systems.

You do need to learn about scheduling systems and the sooner the better. Ask at work !!!

Other options do exist

JCL Chaining - Each job submit the next job

Basically you can have each job submit the next job e.g.

Job 1:

// --- Job 1 JCL
//*
// --- JCL to submit Job 2

Job 2:

// --- Job 2 JCL
//*
// --- JCL to submit Job 3

If you use this method I would create a JCL proc (say SUBNEXT)

// --- Job 1 JCL
//*
//   EXEC SUBNEXT,NEXT=JOB2

You can use the JCLLIB statement to use your own PROCLIB (PDS where you store SUBNEXT). To use JCLLIB:

//MYJOB1   JOB     ...
//MYLIBS1  JCLLIB  ORDER=MY.PROCS.JCL

Jes 3 scheduling

If using Jes-3; There is in-built job control. Only use this option if you know what you are doing other wise the operation staff will get upset. Basically make sure you use the flush option

Bruce Martin
  • 10,358
  • 1
  • 27
  • 38