Introduction to zOS Job Control Language JCL Copyright

Introduction to z/OS Job Control Language (JCL) © Copyright IBM Corp. , 2008. All rights reserved.

Introduction to System z Operating System – z/OS JCL – Job Control Language Ø Job Control Language (JCL) is a sequential collection of 80 character records beginning with // which the operating system can read and interpret to request resources and services from the operating system. Ø JCL is used to • Assign the task a name and authority level • Assign resources (programs, files, memory) and services needed from the operating system to process a task. Ø JCL can be viewed as a list of statements to be ‘submitted’ for background (batch) processing or ‘started’ foreground (started task) processing. 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 2

Introduction to System z Operating System – z/OS JCL - What is ‘batch’ processing? Ø Much of the work running on z/OS consists of programs called batch jobs. Ø Batch processing is used for programs that can be executed: • With minimal human interaction • At a scheduled time or on an as-needed basis. Ø After a batch job is submitted to the system for execution, there is normally no further human interaction with the job until it is complete. 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 3

Introduction to System z Operating System – z/OS JCL - What is ‘started task’ processing? Ø A started task is typically a workload used for interactive processing such as a transaction processing environment. Ø The operating system consists of numerous started tasks. Ø A started task will typically remain in the system until some action is taken to stop the task. 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 4

Introduction to System z Operating System – z/OS JCL - What is JES? Job Entry Subsystem Ø In the z/OS operating system, JES manages the input and output job queues and data. Ø JES handles the following aspects of JCL processing for z/OS: § Reads JCL job into the operating system § Interprets the JCL (variable substition, etc. ) § Schedules job for processing § Controls job output processing 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 5

Introduction to System z Operating System – z/OS JCL, JES & Batch Processing 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 6

Introduction to System z Operating System – z/OS JCL - Batch Flow 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 7

Introduction to System z Operating System – z/OS Symbolic references to files z/OS normally uses symbolic references to files (data sets) rather than actual file names. The use of symbolic references provides a naming redirection between a data set-related name used in a program and the actual data set used during execution of that program. 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 8

Introduction to System z Operating System – z/OS How a symbolic file system is used 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 9

Introduction to System z Operating System – z/OS How a symbolic file system is used (continued) 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 10

Introduction to System z Operating System – z/OS What does JCL look like? Ø The 3 basic JCL statements: 1) JOB statement ……. who wants to process work 2) EXEC statement …. . . what program or procedure will be used 3) DD statement ………. what are the program inputs and outputs Ø Other useful JCL statements: 1) PROC and PEND statement …. execute a JCL predefined procedure 2) INCLUDE statement ………. …. include predefined JCL statements 3) IF – THEN – ELSE - ENDIF …. provides JCL conditional processing 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 11

Introduction to System z Operating System – z/OS JCL - Basic syntax 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 12

Introduction to System z Operating System – z/OS JCL – example //MYJOB 1 //MYSORT EXEC PGM=SORT //SORTIN DD DISP=SHR, DSN=ZIBM 000. JCL(AREACODE) //SORTOUT DD SYSOUT=* //SYSIN DD * SORT FIELDS=(1, 3, CH, A) /* MYJOB is the jobname MYSORT is the stepname SORTIN is program input SORTOUT is program output SYSOUT is system output messages SYSIN is control or data program input 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 13

Introduction to System z Operating System – z/OS JCL - procedures (PROC to PEND) //MYJOB //MYPROC //MYSORT //SORTIN //SORTOUT //SYSOUT // 10/6/2020 JOB 1 PROC EXEC PGM=SORT DD DISP=SHR, DSN=&SORTDSN DD SYSOUT=* PEND © Copyright IBM Corp. , 2008. All rights reserved. 14

Introduction to System z Operating System – z/OS JCL - procedures (continued) //MYJOB 1 //*-----------------* //MYPROC //MYSORT EXEC PGM=SORT //SORTIN DD DISP=SHR, DSN=&SORTDSN //SORTOUT DD SYSOUT=* //SYSOUT DD SYSOUT=* // PEND //*-----------------* //STEP 1 EXEC MYPROC, SORTDSN=ZIBM 000. JCL(AREACODE) //SYSIN DD * SORT FIELDS=(1, 3, CH, A) 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 15

Introduction to System z Operating System – z/OS JCL - procedures – PROC statement override //MYJOB 1 //*-----------------* //MYPROC //MYSORT EXEC PGM=SORT //SORTIN DD DISP=SHR, DSN=&SORTDSN //SORTOUT DD SYSOUT=* //SYSOUT DD SYSOUT=* // PEND //*-----------------* //STEP 1 EXEC MYPROC, SORTDSN=IBMUSER. AREA. CODES //MYSORTOUT DD DSN=IBMUSER. MYSORT. OUTPUT, // DISP=(NEW, CATLG), SPACE=(CYL, (1, 1)), // UNIT=SYSDA, VOL=SER=SHARED, // DCB=(LRECL=20, BLKSIZE=0, RECFM=FB, DSORG=PS) //SYSIN DD * SORT FIELDS=(1, 3, CH, A) 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 16

Introduction to System z Operating System – z/OS JCL - Specifying a data set disposition: Ø DISP is an operand of the DD statement Ø DISP indicates what to do with the data set (the disposition) at step start, end, or abnormal end (if the job fails) Ø DISP helps to prevent unwanted simultaneous access to data sets, which is very important for general system operation. 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 17

Introduction to System z Operating System – z/OS JCL - Using the DD statement DISP= operand DISP=status DISP=(status, normal_end) DISP=(status, normal_end, abnormal_end) where ‘status’ can be Ø NEW Ø OLD where ‘normal_end’ can be: Ø SHR Ø DELETE Ø MOD Ø KEEP where ‘abnormal_end’ can be: Ø PASS Ø DELETE Ø CATLG Ø KEEP Ø UNCATLG 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 18

Introduction to System z Operating System – z/OS JCL - Creating a new data set Ø New data sets can be created through JCL by using the DISP=NEW parameter. Ø For a DISP=NEW request, you need to supply more information, including: § A data set name, DSN= § The type of device for the data set, UNIT=3390 § If a disk is used, the amount of space to be allocated for the primary extent must be specified, SPACE= § If it is a partitioned data set, the size of the directory must be specified within the SPACE parameter § Optionally, DCB parameters can be specified. 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 19

Introduction to System z Operating System – z/OS JCL - Continuation and concatenation Ø Needed to overcome the limitations of the 80 -column punched cards used in earlier systems. • Continuation allows a JCL statement to span multiple records. • Concatenation allows a single ddname to have multiple DD statements. 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 20

Introduction to System z Operating System – z/OS JCL - Continuation and Concatenation Continuation //JOBCARD JOB 1, // REGION=8 M, // NOTIFY=IBMUSER Concatenation //DATAIN DD DISP=OLD, DSN=MY. INPUT 1 // DD DISP=OLD, DSN=MY. INPUT 2 // DD DISP=SHR, DSN=YOUR. DATA 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 21

Introduction to System z Operating System – z/OS JCL - Utilities Ø z/OS includes a number of programs useful in batch processing called utilities. Ø Utilities provide many small, obvious, useful and often critical functions. Ø Some examples of system utilities: § § § 10/6/2020 IEBGENER Copies a sequential data set IEBCOPY Copies a partitioned data set IDCAMS Works with VSAM data sets IEFBR 14 Dummy program IKJEFT 01 Run any TSO workload in batch © Copyright IBM Corp. , 2008. All rights reserved. 22

Introduction to System z Operating System – z/OS Key JCL & Utility Manuals Ø MVS JCL User’s Guide Ø MVS JCL Reference Ø DFSMSdfp Utilities 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 23

Introduction to System z Operating System – z/OS Wikipedia. org 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 24

Introduction to System z Operating System – z/OS Lab #2 Ø Use JCL Sort Data Ø Use JCL Procedure (PROC) to sort data Ø Use JCL to Compile, Link and Execute COBOL Ø Use JCL to Define VSAM data set and copy data to the VSAM data set Ø Use JCL to Compile, Link and Execute COBOL program - VSAM input 10/6/2020 © Copyright IBM Corp. , 2008. All rights reserved. 25
- Slides: 25