960 likes | 1.64k Views
JCL DAY 3. Overview . IBM Utilties . Overview . IBM Utilties. IEFBR14 -> CREATE A DATASET IEBGENER -> CREATE BACKUP OF SEQUENTIAL DATASET IEBCOPY -> COPY DATASET FROM A PDS TO PDS OR MEMBER SORT -> SORT DATA IN ASCENDING/DESCENDING
E N D
JCL DAY 3 Overview
IBM Utilties Overview
IBM Utilties • IEFBR14 -> CREATE A DATASET • IEBGENER -> CREATE BACKUP OF SEQUENTIAL DATASET • IEBCOPY -> COPY DATASET FROM A PDS TO PDS OR MEMBER • SORT -> SORT DATA IN ASCENDING/DESCENDING ORDER • IDCAMS -> CREATE GDG OR VSAM
IEBGENER • Create a backup of a sequential dataset or a member of a partitioned dataset • Produce a partitioned dataset or a member of it from a sequential dataset • Expand an existing Partitioned dataset by creating members and merging them into existing datasets
IEBGENER JCL //JOB Card….. //STEP EXEC PGM=IEBGENER //SYSPRINT DD <Specify dataset for messages> //SYSUT1 DD <Specify input dataset> //SYSUT2 DD <Specify output dataset> //SYSIN DD <Specify control dataset>
Question and Answer • IEBGENER can be used to COPY A Physical sequential Dataset to another Physical Sequential Dataset ( T/F) • IEBGENER can be used to COPY a PDS member to another PDS Member ( T/F) • IEBGENER can be used to COPY a PDS to another PDS ( T/F)
IEBCOMPR oVERVIEW
The IEBCOMPR utility provides the ability to verify that the contents of two datasets are identical. The datasets to be compared may be Physical sequential (PS) Partitioned (PO) organization. Four DD cards are required: The datasets to be compared are specified with the SYSUT1 and SYSUT2 DD cards. Output produced by the utility is written to the SYSPRINT DD card Utility control statements are read from the SYSIN DD card. // JOB CARD STATEMENT //STEP1 EXEC PGM=IEBCOMPR //SYSPRINT DD SYSOUT= * //SYSUT1 DD DSN=DATASET1,UNIT=SYSDA, // VOL=SER=LEM001, DISP=SHR //SYSUT2 DD DSN=DATASET2,UNIT=SYSDA, // VOL=SER=D10040, DISP=SHR //SYSIN DD * COMPARE TYPORG=PS /* // IEBCOMPR Utility
IEBCOPY Overview
IEBCOPY :- • IEBCOPY is a utility program that may be used to copy one or more members from an existing PDS to a new or existing PDS, to make a backup copy of a PDS.
IEBCOPY : Copy only Selected Member Overview
SORT Utility Overview
SORT • Arranges records in a file in ascending or descending sequence • Provides tailoring feature to select a subset of records from file for sorting • Can reformat output file records after sorting • Merges two or more file into a single file
SORT JCL //JOB CARD………. <Specify JOB Card details here> //STEPNAME EXEC PGM=SORT //STEPLIB DD <Specify library containing SORT program here> //SYSOUT DD <Specify the SORT Message dataset here for SORT utility to write messages as it executes> //SORTIN DD <Specify the SORT INPUT dataset here> //SORTWKnn DD <Specify the SORT temporary Work storage dataset here> //SORTOUT DD <Specify the SORT OUTPUT dataset here> //SYSIN DD <Specify SORT control statements here either as instream data or within a dataset to control the way sorting has to be done>
SORT - SYSIN Parameters • Sort statements are coded through SYSIN which can be instream or cataloged • Dataset specified in SYSIN can be either a PS or a PDS • SORT FIELD statement to be preceded by at least one blank space • Format is • SORT FIELD=(<start-pos>,<length-in-bytes>,<field-format>,<sort-sequence>) • <start-pos>, specifies starting position of field on which sorting is to be done • <length-in-bytes>, specifies length of sort field in bytes • <field-format>, specifies data format of the sort field. Field formats are • CH for EBCDIC character sequence • AC for ASCII character sequence • BI for Binary sequence • ZD for Zoned Decimal • PD for Packed Decimal • <sort-sequence> is either “A” or “D” indicating Ascending or Descending sequence
MERGE Overview
This process takes records from up to 16 sorted data sets and combines them in a single sorted output data set. The merge control statement format is similar to that of the sort. Input data sets must already be sorted in the same sequence. //STEP1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=MTPL.SEQ1,DISP=OLD //SORTIN2 DD DSN=MTPL.SEQ2,DISP=OLD //SORTOUT DD DSN=MTPL.SEQ3,DISP=OLD //SYSIN DD * MERGE FIELDS =(21,2,CH,A) /* Merge
Procedures in JCL oVERVIEW
Procedures • Abbreviated as PROC • Consists of pre-tested JCL statements which is given a name • Helps in minimizing duplication of code and hence errors • Two types • Instream Procedures • Cataloged Procedures
Instream Procedures • Coded within the input stream of the JOB • Can be invoked more than once within the JOB • Starts with a PROC statement and ends with a PEND statement • Formats for invoking the PROC are: • EXEC <procname> • EXEC PROC=<procname> • <procname> must be 1 to 8 characters long
Symbolic Parameters • Allows same JCL procedure to be used with different parameters • Very often used in situations where same JCL is used by different programmers with different parameters to access different datasets • Consists of 1 to 8 characters. The first character must be &