JCL is very simple and easy to master. There are only eight different JCL statement Types. JCL is is actually a piece of cake, because you use only three of these JCL statements most often – JOB, EXEC and DD.
You’ll use these very often!
//name |
JOB |
parameters ... |
//name |
EXEC |
parameters ... |
//name |
DD |
parameters ... | You’ll use these to “gift-wrap” and pack your JCLs into PROCs
//name |
PROC |
parameters ... |
//name |
PEND |
parameters ... | These are [optional] -
//* |
comment |
/* |
delimiter |
// |
null ending statement | Now, I shall focus mostly on the 3 important statement types – JOB, EXEC and DD first, so that you can start to write JCL’s and become productive soon. In the later course of this tutorial, I shall also explain to you how to pack JCLs into Procedures using PROC and PEND.
The next figure shows how I use JOB, EXEC and DD Statements to copy a file using IEBGENER Program. Below you shall find a stripped down, bare-bones version of the same.
General format:
//AGY0157A |
JOB |
parameters.. |
//* |
|
|
//STEP01 |
EXEC |
parameters.. |
//SYSUT1 |
DD |
parameters.. |
//SYSUT2 |
DD |
parameters.. |
//SYSPRINT |
DD |
parameters.. |
//SYSIN |
DD |
parameters.. |
// |
|
| I hope you recognized this pattern – JOB, EXEC followed by one or more DD Statements. The JCL for all you Batch Jobs will start with one JOB Statement. Following this, the EXEC statement tells which program to run. And, then you code several DD(Data Device) statements, for specifying the input and output files being used by the program. The DD Statement, would assign a symbolic name to an actual dataset name.
Given below is the JCL that executes the IEBGENER Program to copy the contents of the Physical sequential(PS) file AGY0157.INPUT.DATA to AGY0157.OUTPUT.DATA. Click here to download this Job-listing on your box.
|