What is the difference between JOB and EXEC statements in JCL and how are they used?

1 Answers
Answered by suresh

Difference between JOB and EXEC statements in JCL

What is the difference between JOB and EXEC statements in JCL?

In JCL (Job Control Language), JOB and EXEC statements are used to define and execute different parts of a job.

JOB Statement:

The JOB statement is used to define the entire job including job name, accounting information, job class, and other important job-wide parameters. It is the first statement in the JCL and it marks the beginning of a job stream.

EXEC Statement:

The EXEC statement is used to define and execute individual job steps within a job. It specifies the name of the program or procedure to be executed, along with any associated parameters and attributes. EXEC statements are part of the job's step stream and are used to perform specific tasks within the job.

Key Differences:

  • The JOB statement defines the entire job, while the EXEC statement defines individual job steps.
  • The JOB statement is required at the beginning of a job, while EXEC statements are used within the job to execute specific tasks.
  • Multiple EXEC statements can be included within a single JOB statement to create complex job streams with multiple steps.

Overall, the JOB and EXEC statements in JCL work together to define and execute mainframe job streams, with the JOB statement defining the overall job and the EXEC statements specifying individual job steps.

Answer for Question: What is the difference between JOB and EXEC statements in JCL and how are they used?