aa4c37c6023f26d774cb989d1bdf8e22.ppt
- Количество слайдов: 61
Batch Processing, JCL and SDSF
Objectives You should be able to: • Give an overview of batch processing and how work is initiated and managed in the system • Explain how the job entry subsystem (JES) governs the flow of work through a z/OS system • Explain how JCL works with the system, give an overview of JCL coding techniques, and know a few of the more important statements and keywords • Create a simple job and submit it for execution • Check the output of your job through SDSF © Copyright IBM Corp. , 2008. All rights reserved.
Key terms • batch processing • concatenation • DD statement • job control language (JCL) • JOB statement • EXEC statement • initiator • job entry subsystem (JES) • job name • procedure (PROC) • record format (RECFM) • system display and search facility (SDSF) • step name • system catalog • system library • utility © Copyright IBM Corp. , 2008. All rights reserved.
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. © Copyright IBM Corp. , 2008. All rights reserved.
What is JES? In the z/OS operating system, JES manages the input and output job queues and data. JES handles the following aspects of batch processing for z/OS: • Receives jobs into the operating system • Schedules them for processing by z/OS • Controls their output processing z/OS offers two types: JES 2 and JES 3: • Accept and queue jobs submitted for execution • Queue jobs for an initiator -- a JES program that requests the next job in the queue • Accept output from a job while it is running and queue the output • Can print the output, or save it on spool for an output manager to retrieve. © Copyright IBM Corp. , 2008. All rights reserved.
JES 2 compared to JES 3 In a multi-processor configuration: • JES 2: • Each JES 2 processor controls its own job input, job scheduling, and job output processing. • It is possible to configure JES 2 to share spool and checkpoint data sets with other JES 2 systems (multi-access spool or MAS). • JES 3: • Centralized control over processing through a single global JES 3 processor, which does job selection, scheduling, and device allocation the other JES 3 systems. • The centralized control of JES 3 provides increased job scheduling control, deadline scheduling capabilities, and increased control by providing its own device allocation. Most installations use JES 2. © Copyright IBM Corp. , 2008. All rights reserved.
JES Functions INPUT DEVICES z/OS OUTPUT DEVICES © Copyright IBM Corp. , 2008. All rights reserved.
JCL Related Actions © Copyright IBM Corp. , 2008. All rights reserved.
Batch flow (simplified) © Copyright IBM Corp. , 2008. All rights reserved.
What is spooling? (Simultaneous Peripheral Operations On. Line) • Spooling is a method for queuing and holding data for input or output. • JES uses one or more disk data sets for spooling. • Input jobs and printed output from many jobs are stored in the single (conceptual) spool data set. © Copyright IBM Corp. , 2008. All rights reserved.
Spooling process flow © Copyright IBM Corp. , 2008. All rights reserved.
What does an initiator? To run multiple jobs asynchronously, z/OS uses initiators to: • Ensure that jobs do not conflict in data set usage • Ensure that single-user devices (tape drives) are allocated correctly • Find executable programs requested by jobs • Clean up after the job ends and request the next job Preventing two users from accessing the same data at the same time is critical to z/OS and the ability to do this is one of the defining characteristics of the operating system. © Copyright IBM Corp. , 2008. All rights reserved.
What is JCL? Job control language (JCL) • tells the system what program to execute and provides a description of program inputs and outputs. • is the language used by a batch job to request resources and services from the operating system There are three basic JCL statements: • JOB statement (who you are) • EXEC statement (what program to run) • DD statement (where input/output is located) Indirect (symbolic) references to files © Copyright IBM Corp. , 2008. All rights reserved.
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. © Copyright IBM Corp. , 2008. All rights reserved.
How a symbolic file system is used * The DSNAME can be changed and the same program used for different companies © Copyright IBM Corp. , 2008. All rights reserved.
Batch and job submission example © Copyright IBM Corp. , 2008. All rights reserved.
Basic JCL coding syntax © Copyright IBM Corp. , 2008. All rights reserved.
JCL example //MYJOB 1 Identify yourself to the operating system //MYSORT EXEC PGM=SORT What program to execute //SORTIN DD DISP=SHR, DSN=IBMUSER. AREA. CODES //SORTOUT DD SYSOUT=A //SYSOUT DD SYSOUT=A Use this input dataset Output //SYSIN DD * Class Write to this output dataset SORT FIELDS=(1, 3, CH, A) /* Parameters used at runtime © Copyright IBM Corp. , 2008. All rights reserved.
In the preceding example… MYJOB MYSORTIN SORTOUT SYSIN Job name Step name DD name for program input DD name for program output Where to send system output messages (such as a data set) Specifies whether the input will be data or control statements. SYSOUT=* defaults to the JOB MSGCLASS output class. © Copyright IBM Corp. , 2008. All rights reserved.
JCL: JOB statement © Copyright IBM Corp. , 2008. All rights reserved.
JCL: EXEC statement In addition to the positional parameter indicating the program or procedure to run, the EXEC statement also may contain keyword parameters. - COND (test return codes) - PARM (pass variable information) - REGION (override default storage space) © Copyright IBM Corp. , 2008. All rights reserved.
JCL: DD statement //NEWDD DD DSN=MIRIAM. IEFBR 14. TEST. NEWDD, DISP=OLD Entry in the catlg © Copyright IBM Corp. , 2008. All rights reserved.
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. © Copyright IBM Corp. , 2008. All rights reserved.
Submitting the JCL job to create a dataset © Copyright IBM Corp. , 2008. All rights reserved.
Uses of the DISP= operand DISP=(status, normal end, abnormal end) DISP=(status, normal end) DISP=status normal end NEW DELETE OLD KEEP SHR CATLG MOD UNCATLG PASS abnormal end DELETE KEEP CATLG UNCATLG is ignored for SMS-managed data sets and VSAM data sets, (KEEP is implied). © Copyright IBM Corp. , 2008. All rights reserved.
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. © Copyright IBM Corp. , 2008. All rights reserved.
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. © Copyright IBM Corp. , 2008. All rights reserved.
Example: Continuation //ZCPO 001 A JOB 1, NOTIFY=&SYSUID, MSGLEVEL=(1, 1) //STEP 1 EXEC PGM=IEFBR 14 //A DD DSN=ZCPO 001. SOURCE. LIB, // DISP=(NEW, CATLG), // VOL=SER=S 8 WRK 1, UNIT=3390, // SPACE=(CYL, (3, 1, 25) //B DD DSN=OGDEN. OLD. DATA, DISP=(OLD, DELETE) JCL statement continuation rules: • • • Interrupt before column 71 // in columns 1 and 2 Continue the parameter in any column from 4 through 16 © Copyright IBM Corp. , 2008. All rights reserved.
Example: Concatenation A single ddname can have multiple DD statements //ZCPO 001 A JOB 1, NOTIFY=&SYSUID, MSGLEVEL=(1, 1) //STEP 1 EXEC PGM=IEFBR 14 //A DD DISP=OLD, DSN=MY. INPUT 1 // DD DISP=OLD, DSN=MY. INPUT 2 // DD DISP=OLD, DSN=YOUR. DATA //B DD DSN=OGDEN. OLD. DATA, DISP=(OLD, DELETE) © Copyright IBM Corp. , 2008. All rights reserved.
Example: Creating a JCL procedure PROC name is MYJOB //MYJOB 1 //MYPROC //MYSORT EXEC PGM=SORT //SORTIN DD DISP=SHR, DSN=&SORTDSN //SORTOUT DD SYSOUT=* //SYSOUT DD SYSOUT=* // PEND • PROC and PEND statements are used to identify the beginning and end of the JCL procedure • JCL variable substitution © Copyright IBM Corp. , 2008. All rights reserved.
Example: In-Stream JCL Procedure Step 1: Use an in-stream procedure to test a procedure before placing it in the system or installation-defined procedure library //MYJOB 1 //*-----------------* //MYPROC //MYSORT EXEC PGM=SORT //SORTIN DD DISP=SHR, DSN=&SORTDSN //SORTOUT DD SYSOUT=* Resources are defined at //SYSOUT DD SYSOUT=* execution time // PEND //*-----------------* //STEP 1 EXEC MYPROC, SORTDSN=IBMUSER. AREA. CODES //SYSIN DD * SORT FIELDS=(1, 3, CH, A) © Copyright IBM Corp. , 2008. All rights reserved.
Example: Cataloged JCL Procedure STEP 2: JCL PROC placed in system or installation-defined procedure library //MYSORT //SORTIN //SORTOUT //SYSOUT EXEC PGM=SORT DD DISP=SHR, DSN=&SORTDSN DD SYSOUT=* STEP 3: Create JCL to execute the procedure //MYJOB 1 //STEP 1 EXEC MYPROC, // SORTDSN=ZCPOVPN 6. CUSTOMER (NEW YORK) //SYSIN DD * SORT FIELDS=(1, 3, CH, A) © Copyright IBM Corp. , 2008. All rights reserved.
JCL procedures -- statement override //MYJOB 1 //*-----------------* //MYPROC //MYSORT EXEC PGM=SORT //SORTIN DD DISP=SHR, DSN=&SORTDSN //SORTOUT DD SYSOUT=* Override at //SYSOUT DD SYSOUT=* execution time // 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) © Copyright IBM Corp. , 2008. All rights reserved.
Example: Backward Reference Example 1 (references in same step) //JOB 1 JOB. . . //STEPA EXEC. . . //DD 1 DD DSNAME=REPORT. . //DD 4 DD DSNAME=*. DD 1 Example 2 (references in different steps, same job) //JOB 2 JOB. . . //STEP 1 EXEC. . . //DDA DD DSNAME=D 58. POK. PUBS 01. . //STEP 2 EXEC. . . //DDB DD DSNAME=*. STEP 1. DDA © Copyright IBM Corp. , 2008. All rights reserved.
UNIX System Services: JCL For USS File Systems //OMVSCPGM JOB //OMVSEXEC //STDOUT // //STDERR EXEC PGM=BPXBATCH, PARM='pgm cprog a 1 a 2' DD PATH='/DIR 1/DIR 2/STD. OUTPUT', Note: UNIX PATHOPTS=(OWRONLY, OCREATE), Directory PATHMODE=(SIRWXV), structure PATHDISP=KEEP use in JCL DD PATH='/DIR 1/DIR 2/STD. ERROR', // // // USER=username PATHOPTS=(OWRONLY, OCREATE), PATHMODE=(SIRWXV), PATHDISP=KEEP // NEW JCL PARMS FOR HFS/z. FS FILES See v 18 DSNs next slide © Copyright IBM Corp. , 2008. All rights reserved. }
New z. OS v 1. 8 BPXBATCH Enhancements We can use standard MVS datasets Step 1 Step 2 © Copyright IBM Corp. , 2008. All rights reserved.
UNIX System Services: MVS Batch Environment //OPENBATC JOB Start of job //S 1 EXEC PGM=MVSPROG 1 MVS batch program //S 2 EXEC PGM=BPXBATCH, Open. MVS batch program // PARM='pgm cprog a 1 a 2' //S 3 EXEC PGM=MVSPROG 2 MVS batch program /* // End of job © Copyright IBM Corp. , 2008. All rights reserved.
Using SDSF After submitting a job, z/OS users use System Display and Search Facility (SDSF) to review the job output for successful completion or JCL errors. SDSF allows users to: • • View and search the system log Enter system commands Hold, release, cancel, and purge jobs Monitor jobs while they are processed Display job output before deciding to print it Control the order in which jobs are processed Control the order in which output is printed Control printers and initiators © Copyright IBM Corp. , 2008. All rights reserved.
Tasks and SDSF Panels © Copyright IBM Corp. , 2008. All rights reserved.
SDSF panel hierarchy © Copyright IBM Corp. , 2008. All rights reserved.
System Display and Search Facility (SDSF) © Copyright IBM Corp. , 2008. All rights reserved.
SDSF. Log © Copyright IBM Corp. , 2008. All rights reserved.
SDSF. DA © Copyright IBM Corp. , 2008. All rights reserved.
© Copyright IBM Corp. , 2008. All rights reserved.
© Copyright IBM Corp. , 2008. All rights reserved.
Viewing the JES 2 output files © Copyright IBM Corp. , 2008. All rights reserved.
MIRIAM 2 Job output © Copyright IBM Corp. , 2008. All rights reserved.
SDSF: Display active users (DA) © Copyright IBM Corp. , 2008. All rights reserved.
SDSF: Display active users (DA) - PREFIX your tsoid © Copyright IBM Corp. , 2008. All rights reserved.
SDSF: Input queue panel © Copyright IBM Corp. , 2008. All rights reserved.
SDSF: Output queue panel MORE + PF 8 © Copyright IBM Corp. , 2008. All rights reserved.
SDSF: Held output queue panel © Copyright IBM Corp. , 2008. All rights reserved.
SDSF: Status panel © Copyright IBM Corp. , 2008. All rights reserved.
Utilities • z/OS includes a number of programs useful in batch processing called utilities. • Utilities provide many small, obvious, and useful functions. • A basic set of system-provided utilities. • Customer sites often write their own utility programs, many of which are shared by the z/OS user community. • Some examples of utilities: • IEBGENER • IEBCOPY • IDCAMS Copies a sequential data set Copies a partitioned data set Works with VSAM data sets See Handout © Copyright IBM Corp. , 2008. All rights reserved.
IEBGENER (Sequential Copy / Generate Dataset) You can use IEBGENER to perform the following tasks: * Create a backup copy of a sequential data set, a member of a partitioned data set or PDSE or a UNIX system services (USS) file such as a HFS file. * Produce a partitioned data set or PDSE, or a member of a partitioned data set or PDSE, from a sequential data set or a USS file. * Expand an existing partitioned data set or PDSE by creating partitioned members and merging them into the existing data set. * Produce an edited sequential or partitioned data set or PDSE. * Manipulate data sets containing double-byte character set data. * Print sequential data sets, members of partitioned data sets or PDSEs or USS files. * Reblock or change the logical record length of a data set. * Copy user labels on sequential output data sets . //PRINT JOB. . . Print a sequential dataset to printer //STEP 1 EXEC PGM=IEBGENER or back to terminal //SYSPRINT DD SYSOUT=A //SYSIN DD DUMMY //SYSUT 1 DD DSNAME=ZUSER 01. D 80. DATA, DISP=SHR //SYSUT 2 DD SYSOUT=A //*SYSUT 2 DD SYSOUT=T Note: comment card in JCL © Copyright IBM Corp. , 2008. All rights reserved.
IEBCOPY (Library Copy) Utility IEBCOPY is a data set utility that is used to copy or merge members between one or more partitioned data sets, or partitioned data sets extended (PDSEs), in full or in part. You can also use IEBCOPY to create a backup of a partitioned data set into a sequential data set (called an unload data set or PDSU), and to copy members from the backup into a partitioned data set. //COMPRESS EXEC PGM=IEBCOPY //* //A DD DSNAME=‘ZUSER 01. JCL. CNTL', DISP=OLD //B DD DSNAME=‘ZUSER 01. JCL. CNTL', DISP=OLD //* //SYSIN DD * COPY OUTDD=B, INDD=A /* // © Copyright IBM Corp. , 2008. All rights reserved.
VSAM – Access Method Services (IDCAMS) When you want to use an access method services function, you issue a command specify its parameters. Your request is decoded, one command at a time, and the appropriate functional routines are then called to perform all services required by that command. You can invoke the access method services program in three ways: Ø As a job or job step Ø From a TSO terminal Ø From within your own program You can execute the IDCAMS program and include the command its parameters as input to the program. You can also call the IDCAMS program from within another program and pass the command its parameters to the IDCAMS program. //YOURJOB YOUR INSTALLATION'S JOB=ACCOUNTING DATA //JOBCAT DD DSNAME=YOUR. CATALOG, DISP=SHR //STEP 1 EXEC PGM=IDCAMS One utility does it all ! //STEPCAT DD DSNAME=ANOTHER. CATALOG, DISP=SHR //SYSPRINT DD SYSOUT=A //SYSIN DD * (access method services commands and their parameters) ===> See next slide for commands /* // © Copyright IBM Corp. , 2008. All rights reserved.
Examples of IDCAMS Commands © Copyright IBM Corp. , 2008. All rights reserved.
System Libraries z/OS has many standard system libraries, including: • SYS 1. PROCLIB • SYS 1. PARMLIB • SYS 1. LINKLIB • SYS 1. LPALIB JCL procedures distributed with z/OS Control parameters for z/OS and some program products. Many of the basic execution modules of the system. System execution modules that are loaded into the link pack area at z/OS initialization. Note high level qualifier © Copyright IBM Corp. , 2008. All rights reserved.
Summary • Batch processing is a fundamental function of z/OS. • z/OS shares with JES the management of jobs and resources. • JES receives jobs into the system, schedules them for processing, and controls their output. • JES manages jobs in queues. • An initiator sets up the necessary environment for running a batch job. Multiple initiators permit the parallel execution of batch jobs. • During the life of a job, both JES and the z/OS base control program control different phases of the overall processing. • Basic JCL contains three statements: JOB, EXEC, and DD. • A program can access different groups of data sets in different jobs by changing the JCL for each job. © Copyright IBM Corp. , 2008. All rights reserved.
Summary - continued • New data sets can be created through JCL by using the DISP=NEW parameter. • Users normally use JCL procedures for more complex jobs. A cataloged procedure is written once and can then be used by many users. • z/OS supplies many JCL procedures, and locally-written ones can be added easily. • A user must understand how to override or extend statements in a JCL procedure to supply the parameters (usually DD statements) needed for a specific job. • SDSF is a panel interface for viewing the system log and the list of active users and controlling and monitoring jobs and resources. • Utility programs make operating on data sets easier • System libraries contain JCL procedures, control parameters, and system execution modules. © Copyright IBM Corp. , 2008. All rights reserved.
aa4c37c6023f26d774cb989d1bdf8e22.ppt