SlideShare una empresa de Scribd logo
1 de 82
Z/OS IBM Utilities
    Complete Overview
Course Objectives

 Appreciate the use of Utilities

 Know the Types of Utilities

 Have an in-depth knowledge of common IBM Utilities

 Know the purpose and structure of each Utility

 Know the usage of the various parameters of different
  Utilities

 Be able to write Utilities and execute them
                                                          2
Sessions Outline

 Session 1:
   Overview of IBM Utilities
   Main Types of Dataset Utilities
   IDCAMS
 Session 2:
   IEBGENER, IEFBR14 , IEBCOPY
 Session 3:
   SORT, IEBCOMPR, IKJEFT01, ADRDSSU

                                        3
OS/390 & z/OS - Utilities
        Session 1




                            4
Session 1 - Coverage

 Introduction – Utilities

 Types of Utilities

   Dataset Utilities

   System Utilities

   Access Method Services


                                   5
Introduction - Utilities
•   Frequently performed function:
 Copy sequential files / partitioned datasets / VSAM
 Catalog / Uncatalog datasets
 Rename datasets
 Compress partitioned datasets
 Include / Exclude members to partitioned datasets when a copy
  transaction is implemented
 Compare sequential and partitioned datasets
 Generate generation data groups
 Create/delete datasets allocate/deallocate space on datasets or
  code other functions on the DD statement, without having to
  execute a program

                                                                    6
What is a UTILITY?
 A UTILITY program performs a basic function, i.e., it does a routine job
   which is required repeatedly in an installation.
 IBM provides a number of prewritten utility programs to assist users in
   organizing and maintaining data
 Each utility program falls into one of the two classes, based on the
   function performed and the type of control of the utility. The three
   classes are:
     Dataset utilities
     System utilities and
     Access Method Services


                                                                         7
Dataset Utilities

 Dataset Utility Programs,

    Can be used to create, reorganize, change or compare data at

      the dataset or record level.

    Can be executed as jobs or be invoked as subroutines of a calling

      program.




                                                                     8
Dataset Utility Programs

 To Create and Copy datasets

    IEFBR14 (null program)

    IEBGENER

    IEBCOPY

    SORT




                                       9
System Utilities

 System Utility Programs:

    System utility programs    can   be used   to   maintain and
      manipulate system and user datasets

    These programs must reside in an authorized library

    They can be executed as jobs or be invoked as subroutines of
      an authorized program




                                                               10
Access Method Services

 High performance access method to process
 both VSAM and non-VSAM datasets
   Virtual Storage Access Method (VSAM)




                                              11
Session 1 - Summary

 Frequently performed functions – Requirement for utilities

 Types of Utilities

     Dataset Utilities - Operate on the data at dataset or record level

     System Utilities – Operate on the user datasets




                                                                       12
Functions of Utilities

     Session 2




                         13
Session 2 - Coverage

 IEFBR14 - Null Program

 IEBCOPY – Copy datasets

 IEBGENER – Work on PDS members




                                   14
IEFBR14




          15
IEFBR14

 Purpose:

    Carries out no processing of its own

    Used to Create and Catalog empty datasets

    Delete datasets that are no longer required




                                                   16
IEFBR14: Create and Catalog a Dataset
 Example 1:
//JOBCARD…
//STEP01 EXEC PGM=IEFBR14
//FILE1 DD DSN=XYZ.EMP.MASTER,
//      DISP=(NEW,CATLG,DELETE),
//      UNIT=DISK,VOL=SER=TRG001,
//      SPACE=(CYL,(10,10),RLSE),
//      DCB=(RECFM=FB,LRECL=500)




                                    17
IEFBR14: Uncatalog and Delete a
                 Dataset
 Example 2:
//JOBCARD…
//STEP01 EXEC PGM=IEFBR14
//FILE1   DD DSN=XYZ.EMP.MASTER,
//        DISP=(OLD,UNCATLG)
//*
//STEP02 EXEC PGM=IEFBR14
//FILE2 DD DSN=XYZ.EMP.MASTER
//        DISP=(OLD,DELETE),UNIT=DISK
//


                                        18
IEBCOPY




          19
IEBCOPY
 Purpose:

    To perform functions on Partitioned Datasets

    To copy a Partitioned Dataset to a DASD Volume

    Compress Partitioned datasets

    Merge datasets

    Copy PDS to another PDS or PS (unloading)

    Restore a PDS from a tape backup to a DASD (loading)

    Select / Exclude members of a PDS in a Copy operation

                                                             20
IEBCOPY: Job Control Statements
• //JOBCARD…
• //STEP01 EXEC PGM=IEBCOPY
• //SYSPRINT DD  Defines a sequential dataset for messages
• //SYSUT1 DD            or anyname1 Defines an INPUT partitioned dataset
• //SYSUT2 DD            or anyname2 Defines an OUTPUT partitioned dataset
• //SYSUT3 DD  Defines a spill dataset on a direct access device. It is
                used when there is no space in virtual storage for some
           or all of the current directory entries of the input PDS.
• //SYSUT4 DD             Defines a spill dataset on a direct access device. It is
                 used when there is no space in virtual storage for some
            or all of the current directory entries of the output PDS.
• //SYSIN DD       Defines the CONTROL dataset

                                                                                 21
IEBCOPY: Example 1
    To copy members from three partitioned datasets DATASET1, DATASET2, DATASET3
     to an existing partitioned dataset DATASET4.

//JOBCARD…
//STEP01    EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=A
//INOUT1    DD DSN=DATASET1,DISP=OLD
//INOUT2    DD DSN=DATASET2,DISP=OLD
//INOUT3    DD DSN=DATASET3,DISP=OLD
//INOUT4    DD DSN=DATASET4,DISP=OLD
//SYSUT3    DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSUT4    DD UNIT=SYSDA,SPACE=(TRK,(1))
//SYSIN     DD *
 COPYOPER COPY OUTDD=INOUT4,
          INDD=INOUT1,
          INDD=INOUT2,
          INDD=INOUT3
/*

                                                                                22
IEBCOPY: Example 2
 To copy all the members of INOUT6 (PDS) to
  INOUT2 (PDS) replacing identically named
  members.

  //SYSIN DD *
    COPYOPER COPY OUTDD=INOUT2
          INDD=((INOUT6,R))
 /*

                                               23
IEBCOPY: Example 3
 To copy members C,D,E,A and G from INOUT6 and INOUT2 to
  INOUT4.
 (INOUT6, INOUT2 and INOUT4 are partitioned datasets)

  //SYSIN DD *
 COPYOPER COPY OUTDD=INOUT4
          INDD=INOUT6
          INDD=INOUT2
        SELECT MEMBER=(C,D,E,A,G)




                                                            24
IEBCOPY: Example 4
 In example 3, if members E and G can replace identically named
  member of INOUT4, the control statements are as follows:

 //SYSIN DD *
COPYOPER COPY OUTDD=INOUT4
          INDD=INOUT6,INOUT2
   SELECT MEMBER=(C,D,(E,,R),A,(G,,R))




                                                                   25
IEBCOPY: Example 5
 In example 4 the members C and D are renamed as J and K
  respectively and G replaces identically named member of output
  PDS
 E is renamed T and replaces identically named member of output
  PDS

   //SYSIN DD *
 COPYOPER COPY OUTDD=INOUT4
         INDD=INOUT6,INOUT2
    SELECT MEMBER=((C,J),(D,K),(E,T,R),A,(G,,R))




                                                                   26
IEBCOPY: Example 6
 Suppose in a copy operation from INOUT1 to INOUT2, members A,
  B, C and D have to be excluded

  //SYSIN DD *
    COPYOPER COPY
       OUTDD=INOUT2,INDD=INOUT1
        EXCLUDE MEMBER=(A,B,C,D)
   /*




                                                                  27
IEBCOPY: Example 7
 To Compress a partitioned dataset, assign the same dataset name
  to INDD and OUTDD

  //SYSIN DD *
   COPY OUTDD=DATASET1,INDD=DATASET1
  /*




                                                                    28
IEBCOPY: Example 8
    Multiple COPY operations to copy members A and B from DATASET1 and all
     members of DATASET2 except C and G to DATASET3
    All members copied from DATASET2 are permitted to replace identically named
     members of DATASET3
//SYSIN DD *
 COPYOPER COPY OUTDD=DATASET3,
          INDD=DATASET1
          SELECT MEMBER=(A,B)
           COPY O=DATASET3,
                 I=(DATASET2,R)
      EXCLUDE MEMBER=(C,G)
/*
                                                                                   29
IEBGENER




           30
IEBGENER
 Purpose:
    To copy sequential datasets
    Create a backup of a sequential dataset or a member of a
     partitioned dataset
    Produce a partitioned dataset or a member of a partitioned
     dataset, from a sequential input dataset
    Expand an existing partitioned dataset by creating partitioned
     members and merging them into the existing dataset
    Produce an edited sequential of partitioned dataset
    Convert data formats, rearrange input fields and change the
     logical record length of a dataset

                                                                      31
IEBGENER: Job Control Statements
• //JOBCARD…
• //STEP01 EXEC PGM=IEBGENER
• //SYSPRINT DD  Defines a sequential dataset for messages
                (System output device / Tape volume / DASD
            volume)
• //SYSUT1 DD  Defines the INPUT dataset (Sequential dataset
  /             Member of a PDS)
• //SYSUT2 DD  Defines the OUTPUT dataset (Sequential
  dataset /            PDS / Member of a PDS)
• //SYSIN DD  Defines the CONTROL dataset (Very often
                DUMMY)



                                                            32
IEBGENER: Example 1
 To copy a Tape file XYZ.EMP.MASTER of VOL SER 007311, to a DASD
  file XYZ.EMP.MST.DISK. The Input Employee master record is 500
  bytes in length

//JOBCARD…
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DSN=XYZ.EMP.MASTER,UNIT=TAPE,DISP=OLD,
// VOL=SER=007311,LABEL=(,SL)
//SYSUT2 DD DSN=XYZ.EMPMST.DISK,UNIT=DISK,
// VOL=SER=XYZ3010,DISP=(NEW,CATLG),
// SPACE=(TRK,(10,10)),DCB=(RECFM=FB,LRECL=500)
//SYSPRINT DD SYSOUT=A
//SYSIN DD DUMMY

                                                                33
Utility Control Statements
 Used to create a copy of a dataset in which:

       The fields of each record have been rearranged, omitted or
        replaced by a literal, and/or

       The logical record length has been changed

 The Control Statements most commonly used in IEBGENER are:

       GENERATE

       RECORD

       MEMBER


                                                                     34
GENERATE, RECORD & MEMBER
              Statements
 Generate Statement used to tell IEBGENER that editing is to be
   performed
 Record Statement used to define the fields and literals for editing
 Member Statement identifies the names to be assigned to the
   members generated in the PDS
 Syntax :
GENERATE (MAXFLDS=M, MAXLITS=N, MAXNAME=X,
    MAXGPS=Y)
RECORD FIELD=(l,il,,ol)
RECORD IDENT=(l,’name’,il)
MEMBER NAME=(member,alias)                                              35
GENERATE Statement parameters
 MAXFLDS – total number of field operands in the RECORD
  statements

 MAXLITS – total number of characters in the literals in the RECORD
  statements

 MAXNAME – number of member names in all subsequent MEMBER
  statements

 MAXGPS – number of times the IDENT parameter appears in
  subsequent RECORD statements

                                                                       36
Record Statement: FIELD Parameters
   Length - Length in bytes of the input field or literal to be processed.
    Default is 80 bytes. If a literal is to be processed, a length of 40 or less
    must be specified
 Input-location or literal
      Specifies the starting byte of the field to be processed. Default is 1
      Specifies a literal to be placed in the specified output location
 Conversion: specifies a two-byte code that indicates the type of
    conversion to be performed on this field. Default (NO conversion)
 Output-location: Specifies the starting location of this field in the output
    records. Default is 1.


                                                                                   37
IEBGENER: Example 2
•   //JOBCARD…
•   //EXEC PGM=IEBGENER
•   //SYSIN DD *
•    GENERATE MAXFLDS=1
•    RECORD FIELD=(35,1,,1)
•   /*
•   //SYSPRINT DD SYSOUT=*
•   //SYSUT1 DD *
•   Dataset to be copied
•   /*
•   //SYSUT2 DD DSN=name,UNIT=DASD,
•   // DISP=(NEW,CATLG,DELETE),SPACE=(TRK,(3,1),RLSE),
•   // DCB=(LRECL=35,RECFM=FB)

                                                         38
IEBGENER: Example 3
• //SYSIN DD *
•   GENERATE MAXFLDS=3,MAXLITS=11
•   RECORD FIELD=(10,'**********',,1),
•        FIELD=(5,1,,11,),               FIELD=(1,'=',,16)
• /*




                                                             39
Record Statement: IDENT Parameters

   Identifies the last record of a collection of records in the input
    dataset

      Length: in bytes of the identifying names; cannot exceed 8
       bytes

      Name: Exact literal that identifies the last input record of each
       record group (include in quotes)

      Input-location: Starting byte of the field that contains the
       identifying name in the input records

                                                                         40
IEBGENER: Example 4
 Create a partitioned dataset consisting of three members,
  MEMBER1, MEMBER2, MEMBER3 from sequential input

 The sequential input has FIRSTMEM as the first 8 characters of the
  last record of the first member, and SECNDMEM for the second
  member




                                                                       41
IEBGENER: Example 4
•   //JOBCARD…
•   //STEP01 EXEC PGM=IEBGENER
•   //SYSPRINT DD SYSOUT=A
•   //SYSUT1 DD DSN=INSET,DISP=OLD
•   //SYSUT2 DD DSN=NEWSET,UNIT=DISK,DISP=(NEW CATLG),
•   // VOL=SER=TRG001,SPACE=(TRK,(5,5,5)),DCB=(RECFM=FB,LRECL=80)
•   //SYSIN DD *
•    GENERATE MAXNAME=3,MAXGPS=2
•    MEMBER NAME=MEMBER1
•    GROUP1 RECORD IDENT=(8,'FIRSTMEM',1)
•    MEMBER NAME=MEMBER2
•    GROUP2 RECORD IDENT (8,'SECNDMEM',1)
•    MEMBER NAME=MEMBER3
                                                              42
Session 2 - Summary

 IEFBR14 - Null Program

 IEBCOPY – Copy datasets

 IEBGENER – Work on PDS members




                                      43
Functions of Utilities

      Session 3




                         44
Session 3 - Coverage

 Sort / Merge Utility

 IEBCOMPR

 IKJEFT01

 ADRDSSU



                                    45
Sort/Merge Utility




                     46
Sort/Merge Basics

 Sort/Merge Utility used to

    Sort records in ascending or descending order within a file

    Merge two or more files into a single file

    Select a subset of records from an input file

    SUM values in records

    Reformat records




                                                                   47
Job Control Statements for SORT

• //JOBCARD…
• //STEPNAME EXEC PGM=SORT
• //STEPLIB DD <Defines the library containing the DFSORT pgm>
• //SYSOUT DD <Defines the message dataset>
• //SORTIN DD <Defines the INPUT dataset>
• //SORTWKnn DD <Defines a WORK storage dataset>
• //SORTOUT DD <Defines the OUTPUT dataset>
• //SYSIN DD <Contains DFSORT program control statements>
•




                                                                 48
SORT Statement Basics
 Write the fields in parentheses, separated by commas
    The starting position of the key field
    Length of the key field in bytes
    A code for data format
    Letter 'A' for Ascending order or 'D' for Descending order
 Example:

1 2......................................................71

   SORT FIELDS=(110,5,CH,A)



                                                                  49
Data Format Codes
• Data Format          Code
•   EBCDIC Character   CH
•   ASCII Character           AC
•   Binary             BI
•   Zoned Decimal             ZD
•   Packed Decimal            PD




                                      50
SORT: Example 1

 Now let us consider sorting by multiple fields like COURSE
  DEPARTMENT, COURSE NUMBER and BOOK TITLE. Then,

   SORT FIELDS=(110,5,CH,A,115,5,CH,A,1,75,CH,A)

 This is EQUIVALENT to:

   SORT FIELDS=(110,10,CH,A,1,75,CH,A)

 When all the control fields are of the same data format, then

   SORT FIELDS=(110,10,A,1,75,A),FORMAT=CH



                                                                  51
SORT JCL: Example 2
 Sort the book store file records in ASCENDING order of COURSE
  DEPARTMENT and COURSE NUMBER and DESCENDING order of
  NUMBER IN STOCK

 Assume that the program SORT is available in a partitioned dataset
  IBM.UTIL.LOADLIB




                                                                       52
SORT JCL: Example 2
•   //JOBCARD…
•   //STEP01 EXEC PGM=SORT
•   //STEPLIB DD DSN=IBM.UTIL.LOADLIB,DISP=SHR
•   //SYSOUT DD SYSOUT=*
•   //SORTIN DD DSN= BOOK.STORE.INPUT,DISP=OLD
•   //SORTWK01 DD UNIT=3380,SPACE=(TRK,(1,1))
•   //SORTOUT DD DSN=BOOK.STORE.OUT,
•   // DISP=(NEW,CATLG,DELETE),UNIT=DISK,
•   // VOL=SER=TRG001,SPACE=(CYL,(10,1),RLSE),
•   // DCB=(RECFM=FB,LRECL=173,BLKSIZE=1730)
•   //SYSIN DD *
•    SORT FIELDS=(110,10,CH,A,162,4,BI,D)
•   /*

                                                 53
Example 3
Sample Data
 MOHANK   23423423434534300    KIRAN
 MOHANK   13342345345345300   RAJEEV
 ARAMES   34535345325354300   SURESH
 SURESH   98347385385934000     PULI
 RAMESH   67575789769876800   MADHU
 KRISHN   50830948530859300    OIIED
 KRISHN   30495849572938500   MADHU
 SURESH   98347385385934000     PULI
                                       54
Sort JCL
•   //STEP10 EXEC PGM=SORT,REGION=1024K,PARM=parameters
•   //SYSOUT DD SYSOUT=*           Output messages from SORT
•   //SORTIN DD DSN=...,DISP=SHR Input if SORT request
•   //SORTOUT DD DSN=...          Output for SORT request
•   //SORTOFxx DD DSN=...        OUTFILE output data sets
•   //SORTXSUM DD DSN=...          Output eliminated by the SUM stm
•   //SORTWKnn DD UNIT=SYSDA,          Work files if SORT request
•   //SYSIN DD *            Control statement input data set
•      SORT FIELDS=(1,3,CH,A,9,3,CH,A)
•   /*




                                                                  55
Output
ARAMES   34535345325354300   SURESH
KRISHN   30495849572938500   MADHU
KRISHN   50830948530859300   OIIED
MOHANK   13342345345345300   RAJEEV
MOHANK   23423423434534300   KIRAN
RAMESH   67575789769876800   MADHU
SURESH   98347385385934000   PULI
SURESH   98347385385934000   PULI
                                      56
EXPLANATION
•Above syntax of SORT sorted the records, depends
•on keys we have provided
•(we have provided two keys in FIELDS parameter)

•FIRST KEY
•1,3,CH,A - first key started at col 1 , its length is 3

•SECOND KEY
•9,3,CH,A - second key started at col 9, its length is 3
•In the above example,

•CH- means character we may use BI for binary
•A - Ascending order
•
                                                           57
MERGE Files

 Files to be merged should be sorted on the same set
  of keys on which they are being merged

 Do not use SORTWKnn DD statement

 Instead of SORTIN DD, use SORTINnn DD; one
  SORTINnn DD statement for each input file nn --> 01
  to 16

 In Utility Control Statements, MERGE replaces SORT

                                                        58
MERGE JCL: Example 1

   Merge 3 files that have been sorted in

     ASCENDING order of COURSE DEPARTMENT

     ASCENDING order of COURSE NUMBER

     DESCENDING order of NUMBER IN STOCK




                                             59
MERGE JCL: Example 1
•   //JOBCARD…
•   //STEP01 EXEC PGM = SORT
•   //STEPLIB DD DSN=IBM.UTIL.LOADLIB,DISP=SHR
•   //SYSOUT DD SYSOUT=*
•   //SORTIN01 DD DSN=BOOK.STORE.INPUT1,DISP=OLD
•   //SORTIN02 DD DSN=BOOK.STORE.INPUT2,DISP=OLD
•   //SORTIN03 DD DSN=BOOK.STORE.INPUT3,DISP=OLD
•   //SORTOUT DD
    DSN=BOOK.STORE.OUT,DISP=(NEW,CATLG,DELETE),
•   //UNIT=DISK,VOL=SER=TRG001,SPACE=(CYL,(10,1),RLSE),DCB=(RE
    CFM=FB,LRECL=173,BLKSIZE=1730)
•   //SYSIN DD *
•    MERGE FIELDS=(110,10,CH,A,162,4,BI,D)
•   /*                                                        60
Other Sort/Merge Control Statements
 INCLUDE and OMIT
    Improves the Sort/Merge Efficiency by letting sort or merge just
     the records that need to be processed
 INREC and OUTREC
    Improves the Sort/Merge efficiency by letting sort or merge only
     the fields of the input records that need to be included in the
     output file
 SUM statement
    Lets you add up numeric data in sorted records that have the
     same control field values and writes just one output record for
     each value
    SUM FIELDS=NONE to eliminate duplicate records from a file

                                                                   61
Tailoring the input file
 Inclusion and Omission can be done by comparing the contents of a record
   field with either

     Another field or

     A constant (Character string / Decimal Number / Hexadecimal string)

 Two or more conditions can be combined by logical 'AND' and 'OR'

 Both INCLUDE and OMIT cannot be used together




                                                                        62
How to write INCLUDE/OMIT
                statements
 Syntax:
  INCLUDE COND=(field,comparison,,field -, * ,AND-, +…)
              {constant} {OR }
  OMIT COND=(field,comparison,,field -, * ,AND-, +…)
                 {constant} {OR }
 Write in parentheses, and separated by commas:
    the position, length, and data format of the   field to be
     compared
    comparison operator
    the position, length, and data format of the field compared
     against OR a constant

                                                                   63
List of Comparison operators
 Operators
EQ     Equal To
NE     Not Equal To
GT     Greater Than
GE     Greater Than Or Equal To
LT Less Than
LE Less Than Or Equal To




                                       64
INCLUDE statement: Example
 Suppose in a Book store file we want only the books (in ascending
  order of book title) for which the number of copies sold YTD that
  has exceeded 250

 The SORT Control statements are:

   INCLUDE COND=(166,4,BI,GT,250)

   SORT FIELDS=(1,75,CH,A)




                                                                      65
OMIT statement: Example

 Suppose only those books for which NUMBER SOLD YTD exceeds

  125 and the LAST NAME of the author is MARTIN are to appear in

  the descending order of Price

 The corresponding SORT control statements are

  OMIT COND=(166,4,BI,LE,125,OR,76,15,CH,NE,C'MARTIN')

  SORT FIELDS=(170,4,BI,D)




                                                                   66
Rules for padding/truncation
 In a field-to-field comparison, the shorter field is padded as
   appropriate with blanks or zeroes

 In a field-to-constant comparison, the constant is padded or
   truncated to the length of the field

 Note:

     The decimal constants are padded or truncated on the left

     Character and Hexadecimal constants are padded or truncated
      on the right


                                                                    67
Reformatting
 Reformatting records with OUTREC: After records are sorted they
  can be reformatted by using OUTREC control statement.

    Fields can be deleted

    Order of the fields can be rearranged

    Zeroes or blanks can be inserted BEFORE, BETWEEN or AFTER
      fields

 If record length gets changed in the process of using OUTREC
  statement, the new record length has to be specified on the
  SORTOUT DD statement

                                                                    68
How to write the OUTREC statement?
 Syntax:
  INREC FIELDS=([c:][separation-fld,+position,length*,align,+…)
  OUTREC FIELDS=([c:][separation-fld,]position,length[,align,]…)
 Specify the input location and length of the fields to appear, in the
  desired order (data format is not specified)
 Write in parentheses and separated by commas:
     c: Specifies the column (byte) in which a data field or separation field
      should be placed, relative to the start of the record
     align tells the sort/merge utility to align the field on a halfword (H),
      fullword (F), or doubleword (D) boundary

                                                                            69
Reformatting the Output Record:
                Example 1
 Suppose only the BOOK TITLE, NUMBER IN STOCK, are to appear in
  ASCENDING order of BOOK TITLE, the output record becomes 79 bytes
  long
 The SORTOUT DD Statement becomes
//SORTOUT DD DSN=BOOK.OUTPUT, DISP=(NEW,CATLG,),
// UNIT=DISK,VOL=SER=TRG001,DCB =(RECFM=FB,
// LRECL=79,BLKSIZE=790),SPACE=(TRK,(5,))
 DFSORT control statements are
   //SYSIN DD *
    SORT FIELDS=(1,75,CH,A)
    OUTREC FIELDS=(1,75,162,4)


                                                                      70
OUTREC: Example 2
   If it is required to add a 4-byte Binary field between BOOK TITLE
    and NUMBER IN STOCK and fill it up with ZEROES, the following
    control statement has to be given:
    OUTREC FIELDS=(1,75,4Z,162,4)
 LRECL on the SORTOUT DD statement should be 83




                                                                        71
OUTREC: Example 3

 Suppose a 20 character blank field is to be prefixed to the output
  records, the following control statement has to be given:

  OUTREC FIELDS=(20X,1,75,4Z,162,4)

 LRECL on the SORTOUT DD statement should be 103




                                                                       72
Reformatting records with INREC
 The INREC control statement allows to reformat the input records
  before they are processed
 Reformatting is performed before SORT/MERGE
 Note:
    If reformatting using INREC changes the location of key fields,
      the new location has to be specified in the SORT statement




                                                                       73
INREC: Example
 If only the BOOK TITLE and NUMBER SOLD YTD are to appear in
  descending order of NUMBER SOLD YTD the following control
  statement has to be given:
  //SYSIN DD *
 INREC FIELDS=(1,75,166,4)
 SORT FIELDS=(76,4,BI,D)
  /*




                                                                74
IEHPROGM
 A dataset can be uncataloged using the UNCATLG statement.
 Syntax:

//SYSIN DD *
   UNCATLG DSN=data-set-name
/*
//

SYSUT2 is not coded




                                                              75
ADRDSSU




          76
ADRDSSU

 Purpose:
    To move huge data from one volume to another




                                                    77
ADRDSSU
   Example:
      INDD is the input, or the volume from which the datasets need to be moved
      OUTDD is the output volume
      The include option can be used to mention different qualifiers (say HLQ.** or
        HLQ.NEXT.** or ** - for all)
//MOVE01 EXEC PGM=ADRDSSU,REGION=0M
//SYSPRINT DD SYSOUT=*
//INDD DD VOL=SER=Y2KZ02,UNIT=3390,DISP=SHR
//OUTDD DD VOL=SER=DEVZ20,UNIT=3390,DISP=SHR
//SYSIN DD *
  COPY DS(INCLUDE(**)) -
     LIDD(INDD) -
     OUTDD(OUTDD) -
     ALLDATA(*) -
     CATALOG DELETE
//


                                                                                       78
Session 3 - Summary

 Sort / Merge Utility

 IEBCOMPR – Compare datasets

 IKJEFT01 – Issue TSO Commands

 ADRDSSU – Move Volumes of data




                                      79
Course Summary
 Purpose of Utilities
 Main Types of Utilities
 Functions of each type of Utility
     IEBGENER, IEFBR14, IEBCOPY
     Sort/Merge Operations
     INCLUDE/OMIT and INREC/OUTREC Control Statements




                                                         80
References

 Murach’s OS/390 and z/OS JCL by Raul Menendez and Dough Lowe

 System 390 Job Control Language by Gary DeWard Brown




                                                             81
THANK YOU




            82

Más contenido relacionado

La actualidad más candente

DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1ReKruiTIn.com
 
Top jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsTop jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsjcltutorial
 
Db2 for z os trends
Db2 for z os trendsDb2 for z os trends
Db2 for z os trendsCuneyt Goksu
 
Jcl interview questions
Jcl interview questionsJcl interview questions
Jcl interview questionsganjigirish
 
Job Control Language
Job Control LanguageJob Control Language
Job Control Languagekapa rohit
 
Mainframe JCL Part - 1
Mainframe JCL Part - 1Mainframe JCL Part - 1
Mainframe JCL Part - 1janaki ram
 
Resource Access Control Facility (RACF) in Mainframes
Resource Access Control Facility (RACF) in MainframesResource Access Control Facility (RACF) in Mainframes
Resource Access Control Facility (RACF) in MainframesAayush Singh
 
Basic concept of jcl
Basic concept of jclBasic concept of jcl
Basic concept of jclAnil Bharti
 
A First Look at the DB2 10 DSNZPARM Changes
A First Look at the DB2 10 DSNZPARM ChangesA First Look at the DB2 10 DSNZPARM Changes
A First Look at the DB2 10 DSNZPARM ChangesWillie Favero
 
Db2 Important questions to read
Db2 Important questions to readDb2 Important questions to read
Db2 Important questions to readPrasanth Dusi
 
TSO Productivity
TSO ProductivityTSO Productivity
TSO ProductivityDan O'Dea
 
JCL UTILITIES IEBCOPY
JCL UTILITIES IEBCOPYJCL UTILITIES IEBCOPY
JCL UTILITIES IEBCOPYjanaki ram
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM
 
DB2 for z/OS Architecture in Nutshell
DB2 for z/OS Architecture in NutshellDB2 for z/OS Architecture in Nutshell
DB2 for z/OS Architecture in NutshellCuneyt Goksu
 

La actualidad más candente (20)

Tso and ispf
Tso and ispfTso and ispf
Tso and ispf
 
Skillwise JCL
Skillwise JCLSkillwise JCL
Skillwise JCL
 
SKILLWISE-DB2 DBA
SKILLWISE-DB2 DBASKILLWISE-DB2 DBA
SKILLWISE-DB2 DBA
 
DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1
 
MVS ABEND CODES
MVS ABEND CODESMVS ABEND CODES
MVS ABEND CODES
 
Top jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tipsTop jcl interview questions and answers job interview tips
Top jcl interview questions and answers job interview tips
 
Db2 for z os trends
Db2 for z os trendsDb2 for z os trends
Db2 for z os trends
 
Jcl interview questions
Jcl interview questionsJcl interview questions
Jcl interview questions
 
Job Control Language
Job Control LanguageJob Control Language
Job Control Language
 
Skillwise cics part 1
Skillwise cics part 1Skillwise cics part 1
Skillwise cics part 1
 
Mainframe JCL Part - 1
Mainframe JCL Part - 1Mainframe JCL Part - 1
Mainframe JCL Part - 1
 
Resource Access Control Facility (RACF) in Mainframes
Resource Access Control Facility (RACF) in MainframesResource Access Control Facility (RACF) in Mainframes
Resource Access Control Facility (RACF) in Mainframes
 
Basic concept of jcl
Basic concept of jclBasic concept of jcl
Basic concept of jcl
 
A First Look at the DB2 10 DSNZPARM Changes
A First Look at the DB2 10 DSNZPARM ChangesA First Look at the DB2 10 DSNZPARM Changes
A First Look at the DB2 10 DSNZPARM Changes
 
Db2 Important questions to read
Db2 Important questions to readDb2 Important questions to read
Db2 Important questions to read
 
TSO Productivity
TSO ProductivityTSO Productivity
TSO Productivity
 
JCL UTILITIES IEBCOPY
JCL UTILITIES IEBCOPYJCL UTILITIES IEBCOPY
JCL UTILITIES IEBCOPY
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration Basics
 
DB2 for z/OS Architecture in Nutshell
DB2 for z/OS Architecture in NutshellDB2 for z/OS Architecture in Nutshell
DB2 for z/OS Architecture in Nutshell
 
Db2
Db2Db2
Db2
 

Destacado

Hadoop HDFS by rohitkapa
Hadoop HDFS by rohitkapaHadoop HDFS by rohitkapa
Hadoop HDFS by rohitkapakapa rohit
 
Integrating ibm tivoli workload scheduler with tivoli products sg246648
Integrating ibm tivoli workload scheduler with tivoli products sg246648Integrating ibm tivoli workload scheduler with tivoli products sg246648
Integrating ibm tivoli workload scheduler with tivoli products sg246648Banking at Ho Chi Minh city
 
DB2 V8 - For Developers Only
DB2 V8 -  For Developers OnlyDB2 V8 -  For Developers Only
DB2 V8 - For Developers OnlyCraig Mullins
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!Anas Mohammed
 
Jcl tutor
Jcl tutorJcl tutor
Jcl tutorshivas
 
Sneak Peek into the New ChangeMan ZMF Release
Sneak Peek into the New ChangeMan ZMF ReleaseSneak Peek into the New ChangeMan ZMF Release
Sneak Peek into the New ChangeMan ZMF ReleaseSerena Software
 
American Family Insurance Case Study - Dreamers (1)
American Family Insurance Case Study - Dreamers (1)American Family Insurance Case Study - Dreamers (1)
American Family Insurance Case Study - Dreamers (1)Martha Nechvatal
 
What's New in File-AID 16.03
What's New in File-AID 16.03What's New in File-AID 16.03
What's New in File-AID 16.03Compuware
 
Database Archiving - Managing Data for Long Retention Periods
Database Archiving - Managing Data for Long Retention PeriodsDatabase Archiving - Managing Data for Long Retention Periods
Database Archiving - Managing Data for Long Retention PeriodsCraig Mullins
 

Destacado (16)

Jcl faqs
Jcl faqsJcl faqs
Jcl faqs
 
Hadoop HDFS by rohitkapa
Hadoop HDFS by rohitkapaHadoop HDFS by rohitkapa
Hadoop HDFS by rohitkapa
 
Integrating ibm tivoli workload scheduler with tivoli products sg246648
Integrating ibm tivoli workload scheduler with tivoli products sg246648Integrating ibm tivoli workload scheduler with tivoli products sg246648
Integrating ibm tivoli workload scheduler with tivoli products sg246648
 
New designs
New designsNew designs
New designs
 
DB2 V8 - For Developers Only
DB2 V8 -  For Developers OnlyDB2 V8 -  For Developers Only
DB2 V8 - For Developers Only
 
My cool new Slideshow!
My cool new Slideshow!My cool new Slideshow!
My cool new Slideshow!
 
Spufi
SpufiSpufi
Spufi
 
Jcl tutor
Jcl tutorJcl tutor
Jcl tutor
 
An Hour of DB2 Tips
An Hour of DB2 TipsAn Hour of DB2 Tips
An Hour of DB2 Tips
 
Vsam
VsamVsam
Vsam
 
Sneak Peek into the New ChangeMan ZMF Release
Sneak Peek into the New ChangeMan ZMF ReleaseSneak Peek into the New ChangeMan ZMF Release
Sneak Peek into the New ChangeMan ZMF Release
 
Mainframe – CONTROL-M
Mainframe – CONTROL-MMainframe – CONTROL-M
Mainframe – CONTROL-M
 
American Family Insurance Case Study - Dreamers (1)
American Family Insurance Case Study - Dreamers (1)American Family Insurance Case Study - Dreamers (1)
American Family Insurance Case Study - Dreamers (1)
 
What's New in File-AID 16.03
What's New in File-AID 16.03What's New in File-AID 16.03
What's New in File-AID 16.03
 
Database Archiving - Managing Data for Long Retention Periods
Database Archiving - Managing Data for Long Retention PeriodsDatabase Archiving - Managing Data for Long Retention Periods
Database Archiving - Managing Data for Long Retention Periods
 
Job scheduling
Job schedulingJob scheduling
Job scheduling
 

Similar a Z OS IBM Utilities

UGIF 12 2010 - features11.70
UGIF 12 2010 - features11.70UGIF 12 2010 - features11.70
UGIF 12 2010 - features11.70UGIF
 
Informix User Group France - 30/11/2010 - Fonctionalités IDS 11.7
Informix User Group France - 30/11/2010 - Fonctionalités IDS 11.7Informix User Group France - 30/11/2010 - Fonctionalités IDS 11.7
Informix User Group France - 30/11/2010 - Fonctionalités IDS 11.7Nicolas Desachy
 
DB2UDB_the_Basics Day 5
DB2UDB_the_Basics Day 5DB2UDB_the_Basics Day 5
DB2UDB_the_Basics Day 5Pranav Prakash
 
Aae oop xp_12
Aae oop xp_12Aae oop xp_12
Aae oop xp_12Niit Care
 
Data Tracking: On the Hunt for Information about Your Database
Data Tracking: On the Hunt for Information about Your DatabaseData Tracking: On the Hunt for Information about Your Database
Data Tracking: On the Hunt for Information about Your DatabaseMichael Rosenblum
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLCommand Prompt., Inc
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLMark Wong
 
software design principles
software design principlessoftware design principles
software design principlesCristal Ngo
 
Data structure week 1
Data structure week 1Data structure week 1
Data structure week 1karmuhtam
 
NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.ppt
NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.pptNEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.ppt
NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.pptMuraleedharanTV2
 
6048618 cloning-procedure-of-r12-single-tier
6048618 cloning-procedure-of-r12-single-tier6048618 cloning-procedure-of-r12-single-tier
6048618 cloning-procedure-of-r12-single-tierbalaji29
 
Mainframe Technology Overview
Mainframe Technology OverviewMainframe Technology Overview
Mainframe Technology OverviewHaim Ben Zagmi
 
IMSBufferpool Tuning concept AMS presentation v01
IMSBufferpool Tuning concept AMS presentation v01IMSBufferpool Tuning concept AMS presentation v01
IMSBufferpool Tuning concept AMS presentation v01Manoj Kaveri
 
Managing console of I/o operations & working with files
Managing console of I/o operations & working with filesManaging console of I/o operations & working with files
Managing console of I/o operations & working with fileslalithambiga kamaraj
 

Similar a Z OS IBM Utilities (20)

Oops recap
Oops recapOops recap
Oops recap
 
DB2UDB_the_Basics
DB2UDB_the_BasicsDB2UDB_the_Basics
DB2UDB_the_Basics
 
UGIF 12 2010 - features11.70
UGIF 12 2010 - features11.70UGIF 12 2010 - features11.70
UGIF 12 2010 - features11.70
 
Informix User Group France - 30/11/2010 - Fonctionalités IDS 11.7
Informix User Group France - 30/11/2010 - Fonctionalités IDS 11.7Informix User Group France - 30/11/2010 - Fonctionalités IDS 11.7
Informix User Group France - 30/11/2010 - Fonctionalités IDS 11.7
 
DB2UDB_the_Basics Day 5
DB2UDB_the_Basics Day 5DB2UDB_the_Basics Day 5
DB2UDB_the_Basics Day 5
 
Jcl
JclJcl
Jcl
 
Aae oop xp_12
Aae oop xp_12Aae oop xp_12
Aae oop xp_12
 
Data Tracking: On the Hunt for Information about Your Database
Data Tracking: On the Hunt for Information about Your DatabaseData Tracking: On the Hunt for Information about Your Database
Data Tracking: On the Hunt for Information about Your Database
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
software design principles
software design principlessoftware design principles
software design principles
 
Data structure week 1
Data structure week 1Data structure week 1
Data structure week 1
 
NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.ppt
NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.pptNEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.ppt
NEDb2UG_Db2 13 for zOS install and migration using zOSMF workflows_032223.ppt
 
6048618 cloning-procedure-of-r12-single-tier
6048618 cloning-procedure-of-r12-single-tier6048618 cloning-procedure-of-r12-single-tier
6048618 cloning-procedure-of-r12-single-tier
 
Mainframe Technology Overview
Mainframe Technology OverviewMainframe Technology Overview
Mainframe Technology Overview
 
IMSBufferpool Tuning concept AMS presentation v01
IMSBufferpool Tuning concept AMS presentation v01IMSBufferpool Tuning concept AMS presentation v01
IMSBufferpool Tuning concept AMS presentation v01
 
Mc7404 np final
Mc7404 np finalMc7404 np final
Mc7404 np final
 
AdminKit
AdminKitAdminKit
AdminKit
 
DataBase Management System Lab File
DataBase Management System Lab FileDataBase Management System Lab File
DataBase Management System Lab File
 
Managing console of I/o operations & working with files
Managing console of I/o operations & working with filesManaging console of I/o operations & working with files
Managing console of I/o operations & working with files
 

Último

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Último (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Z OS IBM Utilities

  • 1. Z/OS IBM Utilities Complete Overview
  • 2. Course Objectives  Appreciate the use of Utilities  Know the Types of Utilities  Have an in-depth knowledge of common IBM Utilities  Know the purpose and structure of each Utility  Know the usage of the various parameters of different Utilities  Be able to write Utilities and execute them 2
  • 3. Sessions Outline  Session 1:  Overview of IBM Utilities  Main Types of Dataset Utilities  IDCAMS  Session 2:  IEBGENER, IEFBR14 , IEBCOPY  Session 3:  SORT, IEBCOMPR, IKJEFT01, ADRDSSU 3
  • 4. OS/390 & z/OS - Utilities Session 1 4
  • 5. Session 1 - Coverage  Introduction – Utilities  Types of Utilities  Dataset Utilities  System Utilities  Access Method Services 5
  • 6. Introduction - Utilities • Frequently performed function:  Copy sequential files / partitioned datasets / VSAM  Catalog / Uncatalog datasets  Rename datasets  Compress partitioned datasets  Include / Exclude members to partitioned datasets when a copy transaction is implemented  Compare sequential and partitioned datasets  Generate generation data groups  Create/delete datasets allocate/deallocate space on datasets or code other functions on the DD statement, without having to execute a program 6
  • 7. What is a UTILITY?  A UTILITY program performs a basic function, i.e., it does a routine job which is required repeatedly in an installation.  IBM provides a number of prewritten utility programs to assist users in organizing and maintaining data  Each utility program falls into one of the two classes, based on the function performed and the type of control of the utility. The three classes are:  Dataset utilities  System utilities and  Access Method Services 7
  • 8. Dataset Utilities  Dataset Utility Programs,  Can be used to create, reorganize, change or compare data at the dataset or record level.  Can be executed as jobs or be invoked as subroutines of a calling program. 8
  • 9. Dataset Utility Programs  To Create and Copy datasets  IEFBR14 (null program)  IEBGENER  IEBCOPY  SORT 9
  • 10. System Utilities  System Utility Programs:  System utility programs can be used to maintain and manipulate system and user datasets  These programs must reside in an authorized library  They can be executed as jobs or be invoked as subroutines of an authorized program 10
  • 11. Access Method Services  High performance access method to process both VSAM and non-VSAM datasets  Virtual Storage Access Method (VSAM) 11
  • 12. Session 1 - Summary  Frequently performed functions – Requirement for utilities  Types of Utilities  Dataset Utilities - Operate on the data at dataset or record level  System Utilities – Operate on the user datasets 12
  • 13. Functions of Utilities Session 2 13
  • 14. Session 2 - Coverage  IEFBR14 - Null Program  IEBCOPY – Copy datasets  IEBGENER – Work on PDS members 14
  • 15. IEFBR14 15
  • 16. IEFBR14  Purpose:  Carries out no processing of its own  Used to Create and Catalog empty datasets  Delete datasets that are no longer required 16
  • 17. IEFBR14: Create and Catalog a Dataset  Example 1: //JOBCARD… //STEP01 EXEC PGM=IEFBR14 //FILE1 DD DSN=XYZ.EMP.MASTER, // DISP=(NEW,CATLG,DELETE), // UNIT=DISK,VOL=SER=TRG001, // SPACE=(CYL,(10,10),RLSE), // DCB=(RECFM=FB,LRECL=500) 17
  • 18. IEFBR14: Uncatalog and Delete a Dataset  Example 2: //JOBCARD… //STEP01 EXEC PGM=IEFBR14 //FILE1 DD DSN=XYZ.EMP.MASTER, // DISP=(OLD,UNCATLG) //* //STEP02 EXEC PGM=IEFBR14 //FILE2 DD DSN=XYZ.EMP.MASTER // DISP=(OLD,DELETE),UNIT=DISK // 18
  • 19. IEBCOPY 19
  • 20. IEBCOPY  Purpose:  To perform functions on Partitioned Datasets  To copy a Partitioned Dataset to a DASD Volume  Compress Partitioned datasets  Merge datasets  Copy PDS to another PDS or PS (unloading)  Restore a PDS from a tape backup to a DASD (loading)  Select / Exclude members of a PDS in a Copy operation 20
  • 21. IEBCOPY: Job Control Statements • //JOBCARD… • //STEP01 EXEC PGM=IEBCOPY • //SYSPRINT DD  Defines a sequential dataset for messages • //SYSUT1 DD  or anyname1 Defines an INPUT partitioned dataset • //SYSUT2 DD  or anyname2 Defines an OUTPUT partitioned dataset • //SYSUT3 DD  Defines a spill dataset on a direct access device. It is used when there is no space in virtual storage for some or all of the current directory entries of the input PDS. • //SYSUT4 DD  Defines a spill dataset on a direct access device. It is used when there is no space in virtual storage for some or all of the current directory entries of the output PDS. • //SYSIN DD  Defines the CONTROL dataset 21
  • 22. IEBCOPY: Example 1  To copy members from three partitioned datasets DATASET1, DATASET2, DATASET3 to an existing partitioned dataset DATASET4. //JOBCARD… //STEP01 EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=A //INOUT1 DD DSN=DATASET1,DISP=OLD //INOUT2 DD DSN=DATASET2,DISP=OLD //INOUT3 DD DSN=DATASET3,DISP=OLD //INOUT4 DD DSN=DATASET4,DISP=OLD //SYSUT3 DD UNIT=SYSDA,SPACE=(TRK,(1)) //SYSUT4 DD UNIT=SYSDA,SPACE=(TRK,(1)) //SYSIN DD * COPYOPER COPY OUTDD=INOUT4, INDD=INOUT1, INDD=INOUT2, INDD=INOUT3 /* 22
  • 23. IEBCOPY: Example 2  To copy all the members of INOUT6 (PDS) to INOUT2 (PDS) replacing identically named members. //SYSIN DD * COPYOPER COPY OUTDD=INOUT2 INDD=((INOUT6,R)) /* 23
  • 24. IEBCOPY: Example 3  To copy members C,D,E,A and G from INOUT6 and INOUT2 to INOUT4.  (INOUT6, INOUT2 and INOUT4 are partitioned datasets) //SYSIN DD * COPYOPER COPY OUTDD=INOUT4 INDD=INOUT6 INDD=INOUT2 SELECT MEMBER=(C,D,E,A,G) 24
  • 25. IEBCOPY: Example 4  In example 3, if members E and G can replace identically named member of INOUT4, the control statements are as follows: //SYSIN DD * COPYOPER COPY OUTDD=INOUT4 INDD=INOUT6,INOUT2 SELECT MEMBER=(C,D,(E,,R),A,(G,,R)) 25
  • 26. IEBCOPY: Example 5  In example 4 the members C and D are renamed as J and K respectively and G replaces identically named member of output PDS  E is renamed T and replaces identically named member of output PDS //SYSIN DD * COPYOPER COPY OUTDD=INOUT4 INDD=INOUT6,INOUT2 SELECT MEMBER=((C,J),(D,K),(E,T,R),A,(G,,R)) 26
  • 27. IEBCOPY: Example 6  Suppose in a copy operation from INOUT1 to INOUT2, members A, B, C and D have to be excluded //SYSIN DD * COPYOPER COPY OUTDD=INOUT2,INDD=INOUT1 EXCLUDE MEMBER=(A,B,C,D) /* 27
  • 28. IEBCOPY: Example 7  To Compress a partitioned dataset, assign the same dataset name to INDD and OUTDD //SYSIN DD * COPY OUTDD=DATASET1,INDD=DATASET1 /* 28
  • 29. IEBCOPY: Example 8  Multiple COPY operations to copy members A and B from DATASET1 and all members of DATASET2 except C and G to DATASET3  All members copied from DATASET2 are permitted to replace identically named members of DATASET3 //SYSIN DD * COPYOPER COPY OUTDD=DATASET3, INDD=DATASET1 SELECT MEMBER=(A,B) COPY O=DATASET3, I=(DATASET2,R) EXCLUDE MEMBER=(C,G) /* 29
  • 30. IEBGENER 30
  • 31. IEBGENER  Purpose:  To copy sequential datasets  Create a backup of a sequential dataset or a member of a partitioned dataset  Produce a partitioned dataset or a member of a partitioned dataset, from a sequential input dataset  Expand an existing partitioned dataset by creating partitioned members and merging them into the existing dataset  Produce an edited sequential of partitioned dataset  Convert data formats, rearrange input fields and change the logical record length of a dataset 31
  • 32. IEBGENER: Job Control Statements • //JOBCARD… • //STEP01 EXEC PGM=IEBGENER • //SYSPRINT DD  Defines a sequential dataset for messages (System output device / Tape volume / DASD volume) • //SYSUT1 DD  Defines the INPUT dataset (Sequential dataset / Member of a PDS) • //SYSUT2 DD  Defines the OUTPUT dataset (Sequential dataset / PDS / Member of a PDS) • //SYSIN DD  Defines the CONTROL dataset (Very often DUMMY) 32
  • 33. IEBGENER: Example 1  To copy a Tape file XYZ.EMP.MASTER of VOL SER 007311, to a DASD file XYZ.EMP.MST.DISK. The Input Employee master record is 500 bytes in length //JOBCARD… //STEP1 EXEC PGM=IEBGENER //SYSUT1 DD DSN=XYZ.EMP.MASTER,UNIT=TAPE,DISP=OLD, // VOL=SER=007311,LABEL=(,SL) //SYSUT2 DD DSN=XYZ.EMPMST.DISK,UNIT=DISK, // VOL=SER=XYZ3010,DISP=(NEW,CATLG), // SPACE=(TRK,(10,10)),DCB=(RECFM=FB,LRECL=500) //SYSPRINT DD SYSOUT=A //SYSIN DD DUMMY 33
  • 34. Utility Control Statements  Used to create a copy of a dataset in which:  The fields of each record have been rearranged, omitted or replaced by a literal, and/or  The logical record length has been changed  The Control Statements most commonly used in IEBGENER are:  GENERATE  RECORD  MEMBER 34
  • 35. GENERATE, RECORD & MEMBER Statements  Generate Statement used to tell IEBGENER that editing is to be performed  Record Statement used to define the fields and literals for editing  Member Statement identifies the names to be assigned to the members generated in the PDS  Syntax : GENERATE (MAXFLDS=M, MAXLITS=N, MAXNAME=X, MAXGPS=Y) RECORD FIELD=(l,il,,ol) RECORD IDENT=(l,’name’,il) MEMBER NAME=(member,alias) 35
  • 36. GENERATE Statement parameters  MAXFLDS – total number of field operands in the RECORD statements  MAXLITS – total number of characters in the literals in the RECORD statements  MAXNAME – number of member names in all subsequent MEMBER statements  MAXGPS – number of times the IDENT parameter appears in subsequent RECORD statements 36
  • 37. Record Statement: FIELD Parameters  Length - Length in bytes of the input field or literal to be processed. Default is 80 bytes. If a literal is to be processed, a length of 40 or less must be specified  Input-location or literal  Specifies the starting byte of the field to be processed. Default is 1  Specifies a literal to be placed in the specified output location  Conversion: specifies a two-byte code that indicates the type of conversion to be performed on this field. Default (NO conversion)  Output-location: Specifies the starting location of this field in the output records. Default is 1. 37
  • 38. IEBGENER: Example 2 • //JOBCARD… • //EXEC PGM=IEBGENER • //SYSIN DD * • GENERATE MAXFLDS=1 • RECORD FIELD=(35,1,,1) • /* • //SYSPRINT DD SYSOUT=* • //SYSUT1 DD * • Dataset to be copied • /* • //SYSUT2 DD DSN=name,UNIT=DASD, • // DISP=(NEW,CATLG,DELETE),SPACE=(TRK,(3,1),RLSE), • // DCB=(LRECL=35,RECFM=FB) 38
  • 39. IEBGENER: Example 3 • //SYSIN DD * • GENERATE MAXFLDS=3,MAXLITS=11 • RECORD FIELD=(10,'**********',,1), • FIELD=(5,1,,11,), FIELD=(1,'=',,16) • /* 39
  • 40. Record Statement: IDENT Parameters  Identifies the last record of a collection of records in the input dataset  Length: in bytes of the identifying names; cannot exceed 8 bytes  Name: Exact literal that identifies the last input record of each record group (include in quotes)  Input-location: Starting byte of the field that contains the identifying name in the input records 40
  • 41. IEBGENER: Example 4  Create a partitioned dataset consisting of three members, MEMBER1, MEMBER2, MEMBER3 from sequential input  The sequential input has FIRSTMEM as the first 8 characters of the last record of the first member, and SECNDMEM for the second member 41
  • 42. IEBGENER: Example 4 • //JOBCARD… • //STEP01 EXEC PGM=IEBGENER • //SYSPRINT DD SYSOUT=A • //SYSUT1 DD DSN=INSET,DISP=OLD • //SYSUT2 DD DSN=NEWSET,UNIT=DISK,DISP=(NEW CATLG), • // VOL=SER=TRG001,SPACE=(TRK,(5,5,5)),DCB=(RECFM=FB,LRECL=80) • //SYSIN DD * • GENERATE MAXNAME=3,MAXGPS=2 • MEMBER NAME=MEMBER1 • GROUP1 RECORD IDENT=(8,'FIRSTMEM',1) • MEMBER NAME=MEMBER2 • GROUP2 RECORD IDENT (8,'SECNDMEM',1) • MEMBER NAME=MEMBER3 42
  • 43. Session 2 - Summary  IEFBR14 - Null Program  IEBCOPY – Copy datasets  IEBGENER – Work on PDS members 43
  • 44. Functions of Utilities Session 3 44
  • 45. Session 3 - Coverage  Sort / Merge Utility  IEBCOMPR  IKJEFT01  ADRDSSU 45
  • 47. Sort/Merge Basics  Sort/Merge Utility used to  Sort records in ascending or descending order within a file  Merge two or more files into a single file  Select a subset of records from an input file  SUM values in records  Reformat records 47
  • 48. Job Control Statements for SORT • //JOBCARD… • //STEPNAME EXEC PGM=SORT • //STEPLIB DD <Defines the library containing the DFSORT pgm> • //SYSOUT DD <Defines the message dataset> • //SORTIN DD <Defines the INPUT dataset> • //SORTWKnn DD <Defines a WORK storage dataset> • //SORTOUT DD <Defines the OUTPUT dataset> • //SYSIN DD <Contains DFSORT program control statements> • 48
  • 49. SORT Statement Basics  Write the fields in parentheses, separated by commas  The starting position of the key field  Length of the key field in bytes  A code for data format  Letter 'A' for Ascending order or 'D' for Descending order  Example: 1 2......................................................71 SORT FIELDS=(110,5,CH,A) 49
  • 50. Data Format Codes • Data Format Code • EBCDIC Character CH • ASCII Character AC • Binary BI • Zoned Decimal ZD • Packed Decimal PD 50
  • 51. SORT: Example 1  Now let us consider sorting by multiple fields like COURSE DEPARTMENT, COURSE NUMBER and BOOK TITLE. Then, SORT FIELDS=(110,5,CH,A,115,5,CH,A,1,75,CH,A)  This is EQUIVALENT to: SORT FIELDS=(110,10,CH,A,1,75,CH,A)  When all the control fields are of the same data format, then SORT FIELDS=(110,10,A,1,75,A),FORMAT=CH 51
  • 52. SORT JCL: Example 2  Sort the book store file records in ASCENDING order of COURSE DEPARTMENT and COURSE NUMBER and DESCENDING order of NUMBER IN STOCK  Assume that the program SORT is available in a partitioned dataset IBM.UTIL.LOADLIB 52
  • 53. SORT JCL: Example 2 • //JOBCARD… • //STEP01 EXEC PGM=SORT • //STEPLIB DD DSN=IBM.UTIL.LOADLIB,DISP=SHR • //SYSOUT DD SYSOUT=* • //SORTIN DD DSN= BOOK.STORE.INPUT,DISP=OLD • //SORTWK01 DD UNIT=3380,SPACE=(TRK,(1,1)) • //SORTOUT DD DSN=BOOK.STORE.OUT, • // DISP=(NEW,CATLG,DELETE),UNIT=DISK, • // VOL=SER=TRG001,SPACE=(CYL,(10,1),RLSE), • // DCB=(RECFM=FB,LRECL=173,BLKSIZE=1730) • //SYSIN DD * • SORT FIELDS=(110,10,CH,A,162,4,BI,D) • /* 53
  • 54. Example 3 Sample Data MOHANK 23423423434534300 KIRAN MOHANK 13342345345345300 RAJEEV ARAMES 34535345325354300 SURESH SURESH 98347385385934000 PULI RAMESH 67575789769876800 MADHU KRISHN 50830948530859300 OIIED KRISHN 30495849572938500 MADHU SURESH 98347385385934000 PULI 54
  • 55. Sort JCL • //STEP10 EXEC PGM=SORT,REGION=1024K,PARM=parameters • //SYSOUT DD SYSOUT=* Output messages from SORT • //SORTIN DD DSN=...,DISP=SHR Input if SORT request • //SORTOUT DD DSN=... Output for SORT request • //SORTOFxx DD DSN=... OUTFILE output data sets • //SORTXSUM DD DSN=... Output eliminated by the SUM stm • //SORTWKnn DD UNIT=SYSDA, Work files if SORT request • //SYSIN DD * Control statement input data set • SORT FIELDS=(1,3,CH,A,9,3,CH,A) • /* 55
  • 56. Output ARAMES 34535345325354300 SURESH KRISHN 30495849572938500 MADHU KRISHN 50830948530859300 OIIED MOHANK 13342345345345300 RAJEEV MOHANK 23423423434534300 KIRAN RAMESH 67575789769876800 MADHU SURESH 98347385385934000 PULI SURESH 98347385385934000 PULI 56
  • 57. EXPLANATION •Above syntax of SORT sorted the records, depends •on keys we have provided •(we have provided two keys in FIELDS parameter) •FIRST KEY •1,3,CH,A - first key started at col 1 , its length is 3 •SECOND KEY •9,3,CH,A - second key started at col 9, its length is 3 •In the above example, •CH- means character we may use BI for binary •A - Ascending order • 57
  • 58. MERGE Files  Files to be merged should be sorted on the same set of keys on which they are being merged  Do not use SORTWKnn DD statement  Instead of SORTIN DD, use SORTINnn DD; one SORTINnn DD statement for each input file nn --> 01 to 16  In Utility Control Statements, MERGE replaces SORT 58
  • 59. MERGE JCL: Example 1  Merge 3 files that have been sorted in  ASCENDING order of COURSE DEPARTMENT  ASCENDING order of COURSE NUMBER  DESCENDING order of NUMBER IN STOCK 59
  • 60. MERGE JCL: Example 1 • //JOBCARD… • //STEP01 EXEC PGM = SORT • //STEPLIB DD DSN=IBM.UTIL.LOADLIB,DISP=SHR • //SYSOUT DD SYSOUT=* • //SORTIN01 DD DSN=BOOK.STORE.INPUT1,DISP=OLD • //SORTIN02 DD DSN=BOOK.STORE.INPUT2,DISP=OLD • //SORTIN03 DD DSN=BOOK.STORE.INPUT3,DISP=OLD • //SORTOUT DD DSN=BOOK.STORE.OUT,DISP=(NEW,CATLG,DELETE), • //UNIT=DISK,VOL=SER=TRG001,SPACE=(CYL,(10,1),RLSE),DCB=(RE CFM=FB,LRECL=173,BLKSIZE=1730) • //SYSIN DD * • MERGE FIELDS=(110,10,CH,A,162,4,BI,D) • /* 60
  • 61. Other Sort/Merge Control Statements  INCLUDE and OMIT  Improves the Sort/Merge Efficiency by letting sort or merge just the records that need to be processed  INREC and OUTREC  Improves the Sort/Merge efficiency by letting sort or merge only the fields of the input records that need to be included in the output file  SUM statement  Lets you add up numeric data in sorted records that have the same control field values and writes just one output record for each value  SUM FIELDS=NONE to eliminate duplicate records from a file 61
  • 62. Tailoring the input file  Inclusion and Omission can be done by comparing the contents of a record field with either  Another field or  A constant (Character string / Decimal Number / Hexadecimal string)  Two or more conditions can be combined by logical 'AND' and 'OR'  Both INCLUDE and OMIT cannot be used together 62
  • 63. How to write INCLUDE/OMIT statements  Syntax: INCLUDE COND=(field,comparison,,field -, * ,AND-, +…) {constant} {OR } OMIT COND=(field,comparison,,field -, * ,AND-, +…) {constant} {OR }  Write in parentheses, and separated by commas:  the position, length, and data format of the field to be compared  comparison operator  the position, length, and data format of the field compared against OR a constant 63
  • 64. List of Comparison operators  Operators EQ Equal To NE Not Equal To GT Greater Than GE Greater Than Or Equal To LT Less Than LE Less Than Or Equal To 64
  • 65. INCLUDE statement: Example  Suppose in a Book store file we want only the books (in ascending order of book title) for which the number of copies sold YTD that has exceeded 250  The SORT Control statements are: INCLUDE COND=(166,4,BI,GT,250) SORT FIELDS=(1,75,CH,A) 65
  • 66. OMIT statement: Example  Suppose only those books for which NUMBER SOLD YTD exceeds 125 and the LAST NAME of the author is MARTIN are to appear in the descending order of Price  The corresponding SORT control statements are OMIT COND=(166,4,BI,LE,125,OR,76,15,CH,NE,C'MARTIN') SORT FIELDS=(170,4,BI,D) 66
  • 67. Rules for padding/truncation  In a field-to-field comparison, the shorter field is padded as appropriate with blanks or zeroes  In a field-to-constant comparison, the constant is padded or truncated to the length of the field  Note:  The decimal constants are padded or truncated on the left  Character and Hexadecimal constants are padded or truncated on the right 67
  • 68. Reformatting  Reformatting records with OUTREC: After records are sorted they can be reformatted by using OUTREC control statement.  Fields can be deleted  Order of the fields can be rearranged  Zeroes or blanks can be inserted BEFORE, BETWEEN or AFTER fields  If record length gets changed in the process of using OUTREC statement, the new record length has to be specified on the SORTOUT DD statement 68
  • 69. How to write the OUTREC statement?  Syntax: INREC FIELDS=([c:][separation-fld,+position,length*,align,+…) OUTREC FIELDS=([c:][separation-fld,]position,length[,align,]…)  Specify the input location and length of the fields to appear, in the desired order (data format is not specified)  Write in parentheses and separated by commas:  c: Specifies the column (byte) in which a data field or separation field should be placed, relative to the start of the record  align tells the sort/merge utility to align the field on a halfword (H), fullword (F), or doubleword (D) boundary 69
  • 70. Reformatting the Output Record: Example 1  Suppose only the BOOK TITLE, NUMBER IN STOCK, are to appear in ASCENDING order of BOOK TITLE, the output record becomes 79 bytes long  The SORTOUT DD Statement becomes //SORTOUT DD DSN=BOOK.OUTPUT, DISP=(NEW,CATLG,), // UNIT=DISK,VOL=SER=TRG001,DCB =(RECFM=FB, // LRECL=79,BLKSIZE=790),SPACE=(TRK,(5,))  DFSORT control statements are //SYSIN DD * SORT FIELDS=(1,75,CH,A) OUTREC FIELDS=(1,75,162,4) 70
  • 71. OUTREC: Example 2  If it is required to add a 4-byte Binary field between BOOK TITLE and NUMBER IN STOCK and fill it up with ZEROES, the following control statement has to be given: OUTREC FIELDS=(1,75,4Z,162,4)  LRECL on the SORTOUT DD statement should be 83 71
  • 72. OUTREC: Example 3  Suppose a 20 character blank field is to be prefixed to the output records, the following control statement has to be given: OUTREC FIELDS=(20X,1,75,4Z,162,4)  LRECL on the SORTOUT DD statement should be 103 72
  • 73. Reformatting records with INREC  The INREC control statement allows to reformat the input records before they are processed  Reformatting is performed before SORT/MERGE  Note:  If reformatting using INREC changes the location of key fields, the new location has to be specified in the SORT statement 73
  • 74. INREC: Example  If only the BOOK TITLE and NUMBER SOLD YTD are to appear in descending order of NUMBER SOLD YTD the following control statement has to be given: //SYSIN DD * INREC FIELDS=(1,75,166,4) SORT FIELDS=(76,4,BI,D) /* 74
  • 75. IEHPROGM  A dataset can be uncataloged using the UNCATLG statement.  Syntax: //SYSIN DD * UNCATLG DSN=data-set-name /* // SYSUT2 is not coded 75
  • 76. ADRDSSU 76
  • 77. ADRDSSU  Purpose:  To move huge data from one volume to another 77
  • 78. ADRDSSU  Example:  INDD is the input, or the volume from which the datasets need to be moved  OUTDD is the output volume  The include option can be used to mention different qualifiers (say HLQ.** or HLQ.NEXT.** or ** - for all) //MOVE01 EXEC PGM=ADRDSSU,REGION=0M //SYSPRINT DD SYSOUT=* //INDD DD VOL=SER=Y2KZ02,UNIT=3390,DISP=SHR //OUTDD DD VOL=SER=DEVZ20,UNIT=3390,DISP=SHR //SYSIN DD * COPY DS(INCLUDE(**)) - LIDD(INDD) - OUTDD(OUTDD) - ALLDATA(*) - CATALOG DELETE // 78
  • 79. Session 3 - Summary  Sort / Merge Utility  IEBCOMPR – Compare datasets  IKJEFT01 – Issue TSO Commands  ADRDSSU – Move Volumes of data 79
  • 80. Course Summary  Purpose of Utilities  Main Types of Utilities  Functions of each type of Utility  IEBGENER, IEFBR14, IEBCOPY  Sort/Merge Operations  INCLUDE/OMIT and INREC/OUTREC Control Statements 80
  • 81. References  Murach’s OS/390 and z/OS JCL by Raul Menendez and Dough Lowe  System 390 Job Control Language by Gary DeWard Brown 81
  • 82. THANK YOU 82