JCL DAY 3

Overview

IBM Utilties

Overview

IBM Utilties
 IEFBR14  IEBGENER
-> CREATE A DATASET

-> CREATE BACKUP OF SEQUENTIAL DATASET

 IEBCOPY
 SORT  IDCAMS

-> COPY DATASET FROM A PDS TO PDS OR MEMBER -> SORT DATA IN ASCENDING/DESCENDING ORDER -> 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 .

. //STEP //SYSPRINT //SYSUT1 //SYSUT2 //SYSIN EXEC DD DD DD DD PGM=IEBGENER <Specify dataset for messages> <Specify input dataset> <Specify output dataset> <Specify control dataset> .IEBGENER JCL //JOB Card….

.

INPUT FILE (SYSUT1) .

OUTPUT FILE GENERATED AFTER Running IEBGENER Utility .

SPOOL Message .

Exercise: COPY A PDS member to Physical Sequential Dataset .

Exercise : Copy a PDS Member to Another PDS member .

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 .

UNIT=SYSDA. Four DD cards are required: The datasets to be compared are specified with the SYSUT1 and SYSUT2 DD cards. // VOL=SER=LEM001. The datasets to be compared may be Physical sequential (PS) Partitioned (PO) organization. DISP=SHR //SYSUT2 DD DSN=DATASET2. // JOB CARD STATEMENT //STEP1 EXEC PGM=IEBCOMPR //SYSPRINT DD SYSOUT= * //SYSUT1 DD DSN=DATASET1.UNIT=SYSDA.IEBCOMPR Utility         The IEBCOMPR utility provides the ability to verify that the contents of two datasets are identical. Output produced by the utility is written to the SYSPRINT DD card Utility control statements are read from the SYSIN DD card. // VOL=SER=D10040. DISP=SHR //SYSIN DD * COMPARE TYPORG=PS /* // .

.

SPOOL Message .

Exercise: Compare Two PDS using 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 Utility .

SPOOL Message .

IEBCOPY : Copy only Selected Member Overview .

SELECT MEMBERS .

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………. //STEPNAME //STEPLIB //SYSOUT DD <Specify JOB Card details here> EXEC DD PGM=SORT <Specify library containing SORT program here> <Specify the SORT Message dataset here for SORT utility to write messages as it executes> //SORTIN //SORTWKnn //SORTOUT //SYSIN or DD DD DD DD <Specify the SORT INPUT dataset here> <Specify the SORT temporary Work storage dataset here> <Specify the SORT OUTPUT dataset here> <Specify SORT control statements here either as instream data within a dataset to control the way sorting has to be done> .

SORT . 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 .<field-format>. specifies starting position of field on which sorting is to be done <length-in-bytes>.<sort-sequence>) <start-pos>. specifies length of sort field in bytes <field-format>. specifies data format of the sort field.<length-in-bytes>.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>.

Input File .

Output File BEFORE Executing Utility .

SORT UTILITY .

SPOOL MESSAGE .

OUTPUT FILE GNERATED AFTER RUNNING SORT UTILITY .

Remove Duplicate Rows While Sorting Data using SORT UTILITY .

INPUT DATA WITH DUPLICATE ROWS .

OUTPUT FILE BEFORE RUNNING Utility .

SORT Utility .

Output file after running Utility .

MERGE Overview .

//STEP1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=MTPL.CH. The merge control statement format is similar to that of the sort.SEQ3.DISP=OLD //SORTOUT DD DSN=MTPL. Input data sets must already be sorted in the same sequence.DISP=OLD //SYSIN /* DD * MERGE FIELDS =(21.2.A) .SEQ1.SEQ2.Merge   This process takes records from up to 16 sorted data sets and combines them in a single sorted output data set.DISP=OLD //SORTIN2 DD DSN=MTPL.

INPUT FILE 1 .

INPUT FILE 2 .

MERGE .

OUTPUT FILE AFTER MERGE OPERATION .

JCL DAY 4 .

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 .

The first character must be & .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.

Instream procedure .

SPOOL MESSAGE

OUTPUT

Cataloged Procedure  Consists of a set of JCL statements that are grouped together. given a name and cataloged as a member of a Partitioned dataset   Procedure name must be unique within the procedure library PEND statement is not required .

Cataloged Procedure

 

Library to search the cataloged statements is specified through the JCLLIB operator One or more libraries can be specified in the JCLLIB

In the visual, the procedure named SAMPLE is invoked. It exists as a member in the Partitioned dataset P390B97.PROCLIB that is specified in the JCLLIB

CATALOG PROCEDURE

PROCEDURE AND MEMBER (SAME NAME)

PROCEDURE CALLING IN OTHER JCL (JCLLIB) .

SPOOL MESSAGE .

OUTPUT .

IDCAMS Utility Overview .

IDCAMS Utility     Utiltiy is used for Creation VSAM Dataset NON VSAM GDG (Generation Data Group ) .

A data set in a GDG is called a generation. .What is GDG  A Generation Data Group (GDG) consists of like-named data sets that are chronologically or functionally related.

They are: LIMIT Maximum number of generations allowed for this GDG entry EMPTY When limit is exceeded.GDG There are five control statement parameters which are used in creating a GDG base catalog entry. and it cannot be cataloged. NOEMPTY SCRATCH NOSCRATCH When limit is exceeded. The model DSCB (//DSCB in the example above) ensures that the same DCB and EXPDT information is used to create all generations. Do not delete any uncataloged generation. uncatalog all generations. uncatalog oldest entry only Delete any uncataloged generation. This ensures greater consistency among generations. The model DSCB must be allocated with Zero space. The model DSCB must also lie on the same volume where the base catalog entry is cataloged. .

DEFINE GDG .

OUTPUT .

Example: Use IEBGENER utility to copy data from PS to GDG VERSION Overview .

INPUT FILE .

GDG VERSION .

IEBGENER .

OUTPUT FILE .

to replace the damaged generation.DISP=OLD //OUTDD DD DSN=NAME. The version number is set to V00 with the first generation.G0052V01.CATLG) .G0003V00 NAME.G0052V00.GDG.GDG. If a generation is damaged and needs to be replaced.GDG.GDG(-2) ABSOLUTE NAME NAME.GDG.GDG. For Example: RELATIVE NAME NAME.G0001V00 current generation current generation -1 current generation -2 IBM does not use the V00 or Version number.GDG(-1) NAME.DSNAME specification (Continued) The generation number starts with G0001 for the first generation and is incremented by the value coded in the relative data set name.G0002V00 NAME.GDG. an installation can code the absolute name with a new version number.GDG(+0) NAME.DISP=(. such as //INDD DD DSN=NAME.

Creating New Generation Example .

CREATING NEW GENERATION .

OUTPUT .

SCRATCH AND EMPTY Option Example .

Parameters of DEFINE GDG There are five control statement parameters which are used in creating a GDG base catalog entry. They are: LIMIT Maximum number of generations allowed for this GDG entry EMPTY When limit is exceeded. NOEMPTY SCRATCH When limit is exceeded. NOSCRATCH Do not delete any uncataloged generation. uncatalog oldest entry only Delete any uncataloged generation. uncatalog all generations. .

SCRATCH AND EMPTY .

GDG CREATION .

GENERATION OF NEW VERSION .

.

REPRO COMMAND IN IDCAMS Utility .

INPUT DATASET .

OUTPUT DATASET BEFORE REPRO .

REPRO COMMAND .

OUTPUT DATASET .

DELETE GDG .

GDG VERSION .

DELETE GDG VERSION – FORCE OPTION .

SPOOL MESSAGE .

DELETE GDG – WITH GDG OPTION .

END .

9..8 .3389.0/.4/0/39070.2..078433:2-07 94705.7989 1479017890307..943 4393:0/ %00307.3/83..1.20 47.943  .0307.:0.0/0307.0/ . $850.250 #%' $ &%      '    '    ' .2.078433:2-07880994' 990 17890307...943 1.-84:903.0/.:77039 0307.8093.209.:77039 0307.943 .30.943.4/0 90.9.943..3/300/894-0705.:77039 0307.943 8:.090/.943        /408349:8090' 47'078433:2-07 %0.7020390/ -90.9438/.9433:2-0789.3.

.

 .

.

&%  $   ' $!   $   '  $! % .

.9..5!59.65 .473 .

%'!!!%'"! .

"'#' .

473 .&%'! #' "7.65 .

93.9:6! %070.40/0307.9.0307.4397489.9.701.7.2:23:2-07410307.943 4349/0090.9.9020395.80 .9438.44/089039743 0090.9.9438  !% $#%  $#% 032980.70:80/3..00/0/ :3.3:3.#..70 % ....9..40/147980397 !% 032980.70.943 .4.40/0307.00/0/ :3.9.209078.0.4.-.40397 %0.3:3.

&%'! #' .

%'"! .

!%'"!"!%&"! .

.

3.%#%"" !!  &. .

!#''&' .

"'#''&'"%%#%" .

%#%"" ! .

"'#''&' .

' .

%&"! .

'%&"! "%"#'"! .

&#"" && .

' '"#'"! .

! .

Sign up to vote on this title
UsefulNot useful