1 / 41

How To Use Utility Programs Including Sort/Merge

How To Use Utility Programs Including Sort/Merge . Chapter 18-19. Objectives. Knowledge objectives List the MVS utilities: IEBGENER, IEHMOVE, IEBPTPCH, IEBCOPY, IEHLIST, IBCOMPR, IEBDG. List two other ways you can do functions. Describe how control statements run a utilities

jett
Download Presentation

How To Use Utility Programs Including Sort/Merge

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How To Use Utility Programs Including Sort/Merge Chapter 18-19 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  2. Objectives • Knowledge objectives • List the MVS utilities: IEBGENER, IEHMOVE, IEBPTPCH, IEBCOPY, IEHLIST, IBCOMPR, IEBDG. • List two other ways you can do functions. • Describe how control statements run a utilities • Give the rules for coding them. • Distinguish between a sort and a merge operation. • Explain CH and PD format codes. • Explain when to use the RECORD control statement in a sort/merge. • Describe the INCLUDE, OMIT, INREC, and OUTREC control statements. • Distinguish between a standalone sort/merge and an internal sort/merge. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  3. Objectives • Applied objectives • Given reference material, code: • an IEBGENER job to copy or print a sequential data set. • an IEHMOVE job to copy or move data sets. • an IEBPTPCH job to print a data set. • an IEBCOPY job to copy or compress a partitioned data set. • an IEHLIST job to list VTOC entries or PDS members. • an IEBCOMPR job to compare two data sets. • an IEBDG job to create a sequential data set. The data in each record can include a numeric field that’s incremented by a certain value for each record and fixed data specified by a PICTURE parameter in an FD statement. • Given reference material: • Code a standalone sort/merge job to sort or merge data from one or more files using one or more control fields. • Code JCL necessary to invoke an application program that performs an internal sort/merge. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  4. Utilities, Functions, and Commands • Basic MVS utilities in Chapter 18 • AMS commands for similar functions • TSO commands and ISPF options Name Function IEBGENER Copies or prints sequential data sets. IEHMOVE Copies or moves sequential data sets. IEBPTPCH Prints or punches the contents of sequential data sets. IEBCOPY Copies, merges, compresses, backs up, or restores partitioned data sets. IEHLIST Lists system information for PDS directories or VTOC entries. IEBCOMPR Compares the contents of sequential data sets. IEBDG Generates test data. Name Function REPRO Copies or moves VSAM or non-VSAM data sets. PRINT Prints the contents of VSAM or non-VSAM data sets. Name ISPF option Function COPY 3.3 (Move/Copy utility) Copies a data set or member. LIST 1 (Browse) Displays the contents of a data set or member. PRINTDS 3.6 (Hardcopy utility) Prints the contents of a data set or member. LISTCAT 3.4 (DSLIST utility) Lists catalog entries. LISTDS 3.2 or 3.4 (Data set/DSLIST) Lists data set information. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  5. Coding Rules • Typical DD statements required by MVS utilities • DD statements required by IEBGENER utility • Look Familiar? • Syntax Samples; • Using IEBGENER to copy a sequential file • Using IEBGENER to print a sequential file ddname Use SYSPRINT Output messages or printed output. SYSUT1 The input file. SYSUT2 The output file. SYSIN The control statement file. ddname Use SYSPRINT Output messages or printed output. SYSUT1 The input file. SYSUT2 The output file. SYSIN The control statement file. //COPY EXEC PGM=IEBGENER//SYSPRINT DD SYSOUT=*//SYSUT1 DD DSNAME=MM01.CUSTMAST,DISP=SHR//SYSUT2 DD DSNAME=MM01.CUSTMAST.BACKUP,// DISP=(NEW,CATLG),// UNIT=SYSDA,SPACE=(CYL,(1,1))//SYSIN DD DUMMY //PRINT EXEC PGM=IEBGENER//SYSPRINT DD SYSOUT=*//SYSUT1 DD DSNAME=MM01.CUSTMAST,DISP=SHR//SYSUT2 DD SYSOUT=*//SYSIN DD DUMMY © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  6. //COPY EXEC PGM=IEBGENER//SYSPRINT DD SYSOUT=*//SYSUT1 DD DSNAME=MM01.CUSTMAST,DISP=SHR//SYSUT2 DD DSNAME=MM01.CUSTMAST.TEST,DISP=(NEW,CATLG),// UNIT=SYSDA,SPACE=(CYL,(1,1)),// DCB=(RECFM=FB,LRECL=40,BLKSIZE=800)//SYSIN DD * GENERATE MAXFLDS=5,MAXLITS=4 RECORD FIELD=(5,1,,1),FIELD=(20,21,,6),FIELD=(9,61,ZP,26), X FIELD=(9,70,ZP,31),FIELD=(4,'TEST',,36)/* Col 72 Syntax Control Statments • GENERATE control statement • RECORD control statement • Sample job step using IEBGENER to copy a sequential file with reformatting GENERATE MAXFLDS=n, [ ,MAXLITS=n ] • RECORD FIELD=(length,in-loc | 'literal',conv,out-loc]) [ ,FIELD=(length,in-loc | 'literal',conv,out-loc) ]... © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  7. REPRO { INDATASET(entry-name) } { INFILE(ddname) } { OUTDATASET(entry-name) } • { OUTFILE(ddname) } [ SKIP(count) | FROMKEY(key) | FROMNUMBER(number) | FROMADDRESS(address) ] [ COUNT(count) | TOKEY(key) | TONUMBER(number) | TOADDRESS(address) ] [ REUSE | NOREUSE ] [ REPLACE | NOREPLACE ] Syntax Command • The AMS utility REPRO command • Job to Copy The First 1000 Records In a Data Set // EXEC PGM=IDCAMS//SYSPRINT DD SYSOUT=*//INDD DD DSNAME=MM01.CUSTMAST,DISP=SHR//OUTDD DD DSNAME=MM01.CUSTMAST.TEST, // DISP=(NEW,CATLG),// UNIT=SYSDA,SPACE=(CYL,(1,1)),// DCB=(RECFM=FB,LRECL=40,BLKSIZE=800)//SYSIN DD * REPRO INFILE(INDD) - OUTFILE(OUTDD) - COUNT(1000) /* © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  8. COPY | MOVE { DSNAME=data-set-name } { PDS=library-name } { DSGROUP=name } { VOLUME=unit=serial } [ ,FROM=unit=serial ] ,TO=unit=serial [ ,UNCATLG ] [ ,RENAME=new-name ] [ ,EXPAND=number ] //COPYSEQ EXEC PGM=IEHMOVE//SYSPRINT DD SYSOUT=*//SYSUT1 DD UNIT=SYSDA,VOL=SER=WORK01,DISP=OLD//SYSRES DD UNIT=SYSDA,VOL=REF=SYS1.SVCLIB,DISP=OLD//DDUT1 DD UNIT=SYSDA,VOL=SER=TSO001,DISP=OLD//DDUT2 DD UNIT=SYSDA,VOL=SER=TSO002,DISP=OLD//SYSIN DD * COPY DSNAME=MM01.CUSTMAST,FROM=SYSDA=TSO001,TO=SYSDA=TSO002, X RENAME=MM01.CUSTOMER.MASTER/* Col 72 Syntax Copy and Move • Optional Commands • Move|Copy • Job Step Copying And Renaming A Sequential File © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  9. //MOVEPDS EXEC PGM=IEHMOVE//SYSPRINT DD SYSOUT=*//SYSUT1 DD UNIT=SYSDA,VOL=SER=WORK01,DISP=OLD//SYSRES DD UNIT=SYSDA,VOL=REF=SYS1.SVCLIB,DISP=OLD//DDUT1 DD UNIT=SYSDA,VOL=SER=TSO001,DISP=OLD//DDUT2 DD UNIT=SYSDA,VOL=SER=TSO001,DISP=OLD//SYSIN DD *MOVE PDS=MM01.COPYLIB.COB,FROM=SYSDA=TSO001,TO=SYSDA=TSO001, X RENAME=MM01.COPYINV.COB EXCLUDE MEMBER=PRODMSTR EXCLUDE MEMBER=PROMSTR EXCLUDE MEMBER=BFREC EXCLUDE MEMBER=TRREC/* Col 72 Syntax SELECT and EXCLUDE • SELECT control statement • EXCLUDE control statement • Job Step - Moves & Renames PDS With Exclusions SELECT MEMBER=(name[,name...]) EXCLUDE MEMBER=(name) © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  10. PRINT { INDATASET(entry-name) } { INFILE(ddname) } [ CHARACTER | HEX | DUMP ] [ OUTFILE ] [ SKIP(count) | FROMKEY(key) | FROMNUMBER(number) | FROMADDRESS(address) ] [ COUNT(count) | TOKEY(key) | TONUMBER(number) | TOADDRESS(address) ] Col 72 PRINT INDATASET(MM01.CUSTOMER.MASTER) - CHARACTER - SKIP(28) - COUNT(3) Syntax Of The AMS Utility • PRINT Command • Here Are Some Examples • Prints Records 29, 30, And 31 Of A Non-VSAM File In Character Format • Prints Records From Key 1000 To 1200 Of A VSAM File In Hex Format • What Output Looks Like… The start of a listing in character format RECORD SEQUENCE NUMBER – 29287760JOHN WARDS AND ASSOC5600 N CLARKE CHICAGO IL603002027 0102 The start of the same listing in hex format KEY OF RECORD - F2F8F7F7F6F0F2F8F7F7F6F0D1D6C8D540E6C1D9C4E240C1D5C440C1E2E2D6C3F5F6F0F040D540C3D3C1D9D2 PRINT INDATASET(MM01.CUSTOMER.VSAM) - HEX - FROMKEY(1000) - TOKEY(1200) © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  11. The IEBPTPCH Utility • Print First 100 Records Of A Sequential Data Set • Syntax Of The PRINT Control Statement //PRINT EXEC PGM=IEBPTPCH//SYSPRINT DD SYSOUT=*//SYSUT1 DD DSN=MM01.CUSTOMER.MASTER,DISP=SHR//SYSUT2 DD SYSOUT=*//SYSIN DD *PRINT TYPORG=PS,TOTCONV=PZ,STOPAFT=100,MAXLINE=60/* • PRINT [ PREFORM= A | M ] [ ,TYPORG= PS | PO ] [ ,TOTCONV= XE | PZ ] [ ,CNTRL= 1 | 2 | 3 ] [ ,STRTAFT=n ] [ ,STOPAFT=n ] [ ,SKIP=n ] [ ,MAXNAME=n ] [ ,MAXFLDS=n ] [ ,INITPG=n ] [ ,MAXLINE=n ] © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  12. TITLE, MEMBER, RECORD Control Statements //PRINT EXEC PGM=IEBPTPCH//SYSPRINT DD SYSOUT=*//SYSUT1 DD DSN=MM01.CUSTOMER.MASTER,DISP=SHR//SYSUT2 DD SYSOUT=*//SYSIN DD * PRINT MAXFLDS=5 TITLE ITEM=('LISTING OF CUSTOMER MASTER FILE',20) RECORD FIELD(5,1,,1),FIELD(5,6,,8),FIELD=(20,11,,15), X FIELD(5,61,PZ,37),FIELD=(5,66,PZ,48)/* //PRINT EXEC PGM=IEBPTPCH//SYSPRINT DD SYSOUT=*//SYSUT1 DD DSN=MM01.COPYLIB.COBOL,DISP=SHR//SYSUT2 DD SYSOUT=*//SYSIN DD * PRINT MAXNAME=2,MAXFLDS=2,TYPORG=PO MEMBER NAME=CUSTMAST RECORD FIELD(80) MEMBER NAME=ORDTRAN RECORD FIELD(80)/* • TITLE Control Statement • MEMBER Control Statement • RECORD Control Statement • Prints Two Members Of A PDS • Prints A Sequential Data Set TITLE ITEM=('literal'[,out-loc]) MEMBER NAME=name RECORD FIELD=(length[,in-loc][,conv][,out-loc]) [,FIELD=(length[,in-loc][,conv][,out-loc])]... © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  13. IEBCOPY Utility Commands //MERGE EXEC PGM=IEBCOPY//SYSPRINT DD SYSOUT=*//DDIN DD DSN=MM01.COPYLIBX.COB,DISP=OLD//DDOUT DD DSN=MM01.COPYLIB.COB,DISP=OLD//SYSUT3 DD UNIT=SYSDA,SPACE=(TRK,(1,1))//SYSUT4 DD UNIT=SYSDA,SPACE=(TRK,(1,1))//SYSIN DD * COPY OUTDD=DDOUT,INDD=DDIN/* //COMPRESS EXEC PGM=IEBCOPY//SYSPRINT DD SYSOUT=*//COMPFILE DD DSN=MM01.COPYLIB.COB,DISP=OLD//SYSUT3 DD UNIT=SYSDA,SPACE=(TRK,(1,1))//SYSUT4 DD UNIT=SYSDA,SPACE=(TRK,(1,1))//SYSIN DD * COPY OUTDD=COMPFILE,INDD=COMPFILE/* • The COPY Control Statement • The SELECT And EXCLUDE Control Statements • Merges Two Partitioned Data Sets • Compress A Partitioned Data Set COPY OUTDD=ddname,INDD=ddname[,ddname...] SELECT MEMBER=member[,member...]EXCLUDE MEMBER=member[,member...] © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  14. IEHLIST Utility Commands • LISTVTOC Control Statements • LISTPDS Control Statements • List VTOC Entries • Lists All Members In A PDS //LISTVTOC EXEC PGM=IEHLIST//SYSPRINT DD SYSOUT=*//DDVOL1 DD UNIT=SYSDA,VOL=SER=TSO001,DISP=SHR//SYSIN DD *LISTVTOC VOL=SYSDA=TSO001 //LISTPDS EXEC PGM=IEHLIST//SYSPRINT DD SYSOUT=*//DDVOL1 DD UNIT=SYSDA,VOL=SER=TSO001,DISP=SHR//SYSIN DD *LISTPDS DSNAME=SYS1.COBLIB,VOL=SYSDA=TSO001 • LISTVTOC VOL=unit=serial [ ,DATE=dddyy|dddyyyy ] [ ,DSNAME=(name[,name...]) ] [ ,FORMAT ] LISTPDS DSNAME=(dsname[,dsname...]) ,VOL=unit=serial © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  15. IEBCOMPR Utility Commands • COMPARE Control Statement • Compares Sequential Data Sets • Compares Partitioned Data Sets COMPARE [ ,TYPORG= PS | PO ] //COMPSEQ EXEC PGM=IEBCOMPR//SYSPRINT DD SYSOUT=*//SYSUT1 DD DSN=MM01.CSTMAST1,DISP=SHR//SYSUT2 DD DSN=MM01.CSTMAST2,DISP=SHR//SYSIN DD DUMMY //COMPPDS EXEC PGM=IEBCOMPR//SYSPRINT DD SYSOUT=*//SYSUT1 DD DSN=MM01.SRCLIB.P42A.COB,DISP=SHR//SYSUT2 DD DSN=MM01.SRCLIB.P43A.COB,DISP=SHR//SYSIN DD * COMPARE TYPORG=PO/* © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  16. IEBDG Utility Commands • Syntax Of The DSD Statement • Syntax Of The FD Control Statement DSD OUTPUT=(ddname) • FD NAME=name ,LENGTH=length [ ,STARTLOC=starting-position ] [ ,FILL= 'character' | X'hex-value' ] [ ,FORMAT=pattern | PICTURE=length,[P]'literal' ] [ ,SIGN=sign ] [ ,ACTION=action ] [ ,INDEX=number ] [ ,CYCLE=number ] © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 18-08b

  17. Format Options • [ ,FORMAT=pattern | PICTURE=length,[P]'literal' ] FORMAT Name Description Initial value (5-byte field) AN Alphanumeric Letters A-Z, digits 0-9 ABCDE AL Alphabetic Letters A-Z ABCDE ZD Zoned decimal Digits 0-9 00001 PD Packed decimal Packed number (Hex) 00 00 00 00 1C BI Binary pattern Binary number (Hex) 00 00 00 00 01 RA Random pattern Random hexadecimal digits (Hex) 4F 38 2D A5 A0 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  18. More Utility Commands //CREATE EXEC PGM=IEBDG//SYSPRINT DD SYSOUT=*//DDOUT DD DSNAME=MM01.CUSTMAST.TEST,DISP=(NEW,CATLG),// UNIT=SYSDA,SPACE=(CYL,(1,1)),// DCB=(DSORG=PS,RECFM=FB,RECL=150)//SYSIN DD * DSD OUTPUT=(DDOUT) FD NAME=KEY,LENGTH=5,FORMAT=ZD,INDEX=1,CYCLE=5 FD NAME=CUSTNAME,LENGTH=26,FORMAT=AN,ACTION=RP FD NAME=ADDRESS,LENGTH=26,FORMAT=AN,ACTION=RP FD NAME=CITY,LENGTH=18,FORMAT=AN,ACTION=RP FD NAME=STATEZIP,LENGTH=7,PICTURE=7,'CA93711' FD NAME=YTDSALES,LENGTH=5,PICTURE=9,P'000123456' FD NAME=FILLER1,LENGTH=61,FILL='X' CREATE QUANTITY=125,FILL=X'00',NAME=(KEY,CUSTNAME,ADDRESS,CITY, X STATEZIP,YTDSALES,FILLER1) END/* • Syntax of the CREATE control statement • Creates A Sequential Test File CREATE QUANTITY=number [ ,FILL= 'character' | X'hex-constant' ] [ ,NAME=(name[,name...]) ] © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

  19. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM © 2002, Mike Murach & Associates, Inc.

  20. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-01a

  21. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-01b

  22. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-01c

  23. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-02a

  24. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-02b

  25. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-02c

  26. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-03a

  27. Format codes © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-03b

  28. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-04a

  29. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-04b

  30. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-05a

  31. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-05b

  32. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-06a

  33. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-06b

  34. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-07a

  35. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-07b

  36. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-08a

  37. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-08b

  38. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-09a

  39. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-09b

  40. © 2002 - Mike Murach & Associates, 2007 - HCC, IBM Figure 19-09c

  41. End Presentation © 2002 - Mike Murach & Associates, 2007 - HCC, IBM

More Related