Dfsort Application Programming Guide
Dfsort Application Programming Guide
SC26-7523-04
z/OS
SC26-7523-04
Note Before using this information and the product it supports, be sure to read the general information under Notices on page 839.
Fifth Edition, September 2009 This edition applies to Version 1 Release 11 of z/OS (5694-A01) and to all subsequent releases and modifications until otherwise indicated in new editions. This edition replaces SC26752303. IBM welcomes your comments. A form for readers comments may be provided at the back of this publication, or you may address your comments to the following address: International Business Machines Corporation MHVRCFS, Mail Station P181 2455 South Road Poughkeepsie, NY 12601-5400 United States of America FAX (United States & Canada): 1+845+432-9405 FAX (Other Countries): Your International Access Code +1+845+432-9405 IBMLink (United States customers only): IBMUSM10(MHVRCFS) Internet e-mail: [email protected] World Wide Web: http://www.ibm.com/servers/eserver/zseries/zos/webqs.html If you would like a reply, be sure to include your name, address, telephone number, or FAX number. Make sure to include the following in your comment or note: v Title and order number of this document v Page number or topic related to your comment When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. Copyright International Business Machines Corporation 1973, 2009. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Contents
Figures . . . . . . . . . . . . . . . ix Tables . . . . . . . . . . . . . . . xi About this document . . . . . . . . xiii
How to use this document . . . . . . . . . xiii Required product knowledge . . . . . . . . xiv Referenced documents . . . . . . . . . . xiv Accessing z/OS DFSORT documents on the Internet xv Using LookAt to look up message explanations . . xv Notational conventions . . . . . . . . . . xvi Use Blockset Whenever Possible . . . . . . . 23
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . .
1 4 4 4 5 5 5 7 7 11 12 12 12 13 13 16 16 22 22
iii
Including Records in the Output Data SetDate Comparisons . . . . . . . . . . . . Numeric Tests . . . . . . . . . . . . Including Records in the Output Data Set--Numeric Tests . . . . . . . . . . INCLUDE/OMIT Statement Notes . . . . . INREC Control Statement . . . . . . . . . INREC Statement Notes . . . . . . . . . Reformatting Records Before Processing Examples . . . . . . . . . . . . . . MERGE Control Statement . . . . . . . . . Specifying a MERGE or COPYExamples . . MODS Control Statement . . . . . . . . . Identifying User Exit RoutinesExamples . . . OMIT Control Statement . . . . . . . . . Omitting Records from the Output Data SetExample . . . . . . . . . . . . OPTION Control Statement . . . . . . . . Aliases for OPTION Statement Options. . . . Specifying DFSORT Options or COPYExamples . . . . . . . . . . . OUTFIL Control Statements . . . . . . . . OUTFIL Statements Notes . . . . . . . . OUTFIL FeaturesExamples . . . . . . . OUTREC Control Statement . . . . . . . . OUTREC Statement Notes . . . . . . . . Reformatting Records After Processing Examples . . . . . . . . . . . . . . RECORD Control Statement . . . . . . . . Describing the Record Format and LengthExamples . . . . . . . . . . SORT Control Statement. . . . . . . . . . SORT/MERGE Statement Notes . . . . . . Specifying a SORT or COPYExamples . . . SUM Control Statement . . . . . . . . . . SUM Statement Notes . . . . . . . . . Adding Summary FieldsExamples. . . . .
122 122 124 124 125 148 150 160 163 164 167 167 170 171 220 221 224 354 358 380 402 404 414 417 418 426 427 428 430 432
Dynamically Link-Editing User Exit Routines Assembler User Exit Routines (Input Phase User Exits) . . . . . . . . . . . . . . . . E11 User Exit: Opening Data Sets/Initializing Routines . . . . . . . . . . . . . . E15 User Exit: Passing or Changing Records for Sort and Copy Applications . . . . . . . E16 User Exit: Handling Intermediate Storage Miscalculation . . . . . . . . . . . . E17 User Exit: Closing Data Sets . . . . . . E18 User Exit: Handling Input Data Sets . . . E19 User Exit: Handling Output to Work Data Sets . . . . . . . . . . . . . . . E61 User Exit: Modifying Control Fields . . . Assembler User Exit Routines (Output Phase User Exits) . . . . . . . . . . . . . . . . E31 User Exit: Opening Data Sets/Initializing Routines . . . . . . . . . . . . . . E32 User Exit: Handling Input to a Merge Only E35 User Exit: Changing Records . . . . . . E37 User Exit: Closing Data Sets . . . . . . E38 User Exit: Handling Input Data Sets . . . E39 User Exit: Handling Output Data Sets. . . Sample Routines Written in Assembler . . . . . E15 User Exit: Altering Record Length . . . . E16 User Exit: Sorting Current Records When NMAX Is Exceeded . . . . . . . . . . E35 User Exit: Altering Record Length . . . . E61 User Exit: Altering Control Fields . . . . COBOL User Exit Routines . . . . . . . . . COBOL User Exit Requirements . . . . . . COBOL User Exit Routines (Input Phase User Exit) COBOL E15 User Exit: Passing or Changing Records for Sort . . . . . . . . . . . COBOL User Exit Routines (Output Phase User Exit) . . . . . . . . . . . . . . . . COBOL E35 User Exit: Changing Records . . . Sample Routines Written in COBOL . . . . . . COBOL E15 User Exit: Altering Records . . . COBOL E35 User Exit: Inserting Records . . . E15/E35 Return Codes and EXITCK. . . . . .
445 445 445 446 449 449 449 453 454 455 456 456 457 460 461 461 462 462 463 463 464 465 465 467 467 473 473 478 478 479 480
. 484 485 . 485 . . . . . . . 492 492 495 495 499 499 499
iv
Operand Descriptions . . . VERIFY Example . . . . . Calling ICETOOL from a Program TOOLIN Interface . . . . . Parameter List Interface . . . ICETOOL Notes and Restrictions . ICETOOL Return Codes . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
| | |
693 694 694 695 695 700 701 701 703 703 703 703 703 705 706
| | |
Control Statement String Sent to the EFS program . . . . . . . . . . . . . . Control Statement String Returned by the EFS Program . . . . . . . . . . . . . . EFS Formats for SORT, MERGE, INCLUDE, and OMIT Control Statements . . . . . . . . D1 Format on FIELDS Operand . . . . . . D2 Format on COND Operand . . . . . . Length of Original Control Statement . . . . Length of the Altered Control Statement . . . EFS Program Context Area . . . . . . . . Extract Buffer Offsets List . . . . . . . . Record Lengths List . . . . . . . . . . Information Flags . . . . . . . . . . . Message List . . . . . . . . . . . . EFS Program Exit Routines . . . . . . . . . EFS01 and EFS02 Function Description . . . . EFS01 User Exit Routine. . . . . . . . . EFS02 User Exit Routine. . . . . . . . . Addressing and Residence Mode of EFS Program User Exit Routines . . . . . . . EFS Program Return Codes You Must Supply . . Record Processing Order . . . . . . . . . How to Request a SNAP Dump . . . . . . . EFS Program Example . . . . . . . . . . DFSORT Initialization Phase: . . . . . . . DFSORT Termination Phase . . . . . . .
706 708 709 709 710 712 712 712 712 712 713 714 715 715 716 717 719 720 720 722 723 723 725
CLIST Examples . . . . . . . . . . . . Sort Examples . . . . . . . . . . . . . Example 1. Sort with ALTSEQ . . . . . . . Example 2. Sort with OMIT, SUM, OUTREC, DYNALLOC and ZDPRINT . . . . . . . Example 3. Sort with ASCII Tapes . . . . . Example 4. Sort with E15, E35, FILSZ, AVGRLEN and DYNALLOC . . . . . . . Example 5. Called sort with SORTCNTL, CHALT, DYNALLOC and FILSZ . . . . . . Example 6. Sort with VSAM Input/Output, DFSPARM and Option Override . . . . . . Example 7. Sort with COBOL E15, EXEC PARM and MSGDDN . . . . . . . . . . . . Example 8. Sort with Dynamic Link-Editing of Exits . . . . . . . . . . . . . . . Example 9. Sort with the Extended Parameter List Interface . . . . . . . . . . . . Example 10. Sort with OUTFIL . . . . . . Example 11. Sort with Pipes and OUTFIL SPLIT Example 12. Sort with INCLUDE and LOCALE Example 13: Sort with z/OS UNIX Files . . . Example 14. Sort with IFTHEN . . . . . . Merge Examples . . . . . . . . . . . . Example 1. Merge with EQUALS . . . . . . Example 2. Merge with LOCALE and OUTFIL Copy Examples. . . . . . . . . . . . . Example 1. Copy with EXEC PARMs, SKIPREC, MSGPRT and ABEND . . . . . . . . . Example 2. Copy with INCLUDE and VLSHRT Example 3. Copy with OUTREC, PARSE and BUILD . . . . . . . . . . . . . . ICEGENER Example . . . . . . . . . . . ICETOOL Example . . . . . . . . . . .
749 749 749 750 751 752 753 755 756 758 759 762 764 764 765 766 768 768 769 770 771 772 772 774 775
. . . 777
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777 777 778 778 778 778 779 780 781 782 783 783 784 784
Introduction . . . . . . . . . . . Hiperspace . . . . . . . . . . . Work Data Set Devices . . . . . . . Disk and Tape Devices . . . . . . Number of Devices . . . . . . . Non-Synchronous Storage Subsystems . Allocation of Work Data Sets . . . . . Dynamic Allocation of Work Data Sets . Dynamic Over-Allocation of Work Space JCL Allocation of Work Data Sets . . . Disk Capacity Considerations . . . . . Exceeding Disk Work Space Capacity . Tape Capacity Considerations . . . . . Exceeding Tape Work Space Capacity .
vi
Directly Invoked DFSORT . . . . . . . Notes to Directly Invoked DFSORT Table . Program Invoked DFSORT with the Extended Parameter List . . . . . . . . . . . Notes to Extended Parameter List Table . Program Invoked DFSORT with the 24-Bit Parameter List . . . . . . . . . . . Notes to 24-Bit List Table . . . . . .
. . . . . .
Checkpoint/Restart . . . . . . . . . . . DFSORT Abend Categories . . . . . . . . . Abend Recovery Processing for Unexpected Abends . . . . . . . . . . . . . . . Processing of Error Abends with A-Type Messages CTRx Abend processing . . . . . . . . . .
Notices . . . . . . . . . . . . . . 839
Programming Interface Information . Trademarks . . . . . . . . . . . . . . . . . . 840 . 840
Index . . . . . . . . . . . . . . . 841
Contents
vii
viii
Figures
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. Control Fields . . . . . . . . . . . . 6 Record Processing Order . . . . . . . . 9 Using ICETOOL to List Installation Defaults 18 Syntax Diagram for EXEC PARM . . . . . 31 Aliases for MSGPRT/MSGCON Options 46 Control Statement Format . . . . . . . . 85 Continuation Line Format. . . . . . . . 87 Valid and Invalid Decimal Constants 105 Valid and Invalid Character String Constants 107 Valid and Invalid Hexadecimal Constants 109 Sample Records . . . . . . . . . . . 112 Syntax Diagram for the Option Control Statement . . . . . . . . . . . . . 171 OUTFIL Processing Order . . . . . . . 230 Examples of Notation for Binary Fields 421 Examples of DFSORT Input/User Exit/Output Logic . . . . . . . . . . 437 E18 User Exit Example . . . . . . . . 453 E38 User Exit Example . . . . . . . . 461 E39 User Exit Example . . . . . . . . 462 E15 User Exit Example . . . . . . . . 463 E16 User Exit Example . . . . . . . . 463 E35 User Exit Example . . . . . . . . 464 E61 User Exit Example . . . . . . . . 465 E15 DFSORT Interface with COBOL . . . . 469 LINKAGE SECTION Code Example for E15 (Fixed-Length Records) . . . . . . . . 470 LINKAGE SECTION Code Example for E15 (Variable-Length Record). . . . . . . . 470 E35 Interface with COBOL . . . . . . . 474 LINKAGE SECTION Code Example for E35 (Fixed-Length Records) . . . . . . . . 475 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. LINKAGE SECTION Code Example for E35 (Variable-Length Records) . . . . . . . COBOL E15 Routine Example (FLR) . . . . COBOL E35 Routine Example (VLR) The 24-Bit Parameter List . . . . . . . The Extended Parameter List . . . . . . Specifying the Main Storage Option (24-Bit Parameter List) . . . . . . . . . . . Specifying E32 and ESTAE Routine (24-Bit Parameter List) . . . . . . . . . . . The 24-Bit Parameter List in Main Storage Coding a 24-Bit Parameter List. . . . . . Coding an Extended Parameter List . . . . Simple ICETOOL Job . . . . . . . . . Parameter List for Parameter List Interface ICETOOL Parameter List Interface Example JCL for Parameter List Interface Program Example . . . . . . . . . . . . . Relationship Between DFSORT and an EFS Program . . . . . . . . . . . . . EFS Program Calls for a Sort . . . . . . EFS Program Calls for a Merge or Copy Control Statement Processing Sequence EFS Interface Parameter List . . . . . . Information Flags . . . . . . . . . . DFSORT Register Convention . . . . . . Calling Sequence to EFS02 by DFSORT EFS Record Processing Sequence for a Sort or Merge . . . . . . . . . . . . . . EFS Record Processing Sequence for a Copy Faster Sorting with COBOL . . . . . . . 475 479 480 487 493 496 496 497 498 499 505 655 658 660 695 696 697 702 704 713 716 718 721 722 732
ix
Tables
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. Related documents . . . . . . . . . Referenced documents . . . . . . . Options That Can Ease Migration . . . . FILSZ Variations Summary . . . . . . Aliases for PARM Options . . . . . . DD Statement Parameters Used by DFSORT DCB Subparameters Used by DFSORT . . Compare Field Formats and Lengths Permissable Field-to-Field Comparisons for INCLUDE/OMIT (Group 1) . . . . . Permissable Field-to-Field Comparisons for INCLUDE/OMIT (Group 2) . . . . . Permissible Field-to-Constant Comparisons for INCLUDE/OMIT . . . . . . . . Decimal Numbers for Current Date . . . Decimal Numbers for Future Dates . . . Decimal Numbers for Past Dates . . . . Valid and Invalid Strings with Double-Byte Data . . . . . . . . . . . . . Character Strings for Current Date . . . Character Strings for Future Dates . . . Character Strings for Past Dates . . . . Bit Comparison Example 2: Results for Selected Field Values . . . . . . . . Bit Comparison Example 3: Results for Selected Field Values . . . . . . . . Bit Comparison Example 2: Results for Selected Field Values . . . . . . . . Bit Comparison Example 3: Results for Selected Field Values . . . . . . . . Permissible Comparisons for Dates . . . Logic Table for INCLUDE/OMIT. . . . . Examples of Valid and Invalid Column Alignment . . . . . . . . . . . Examples of Valid and Invalid Blank Separation . . . . . . . . . . . Examples of Valid and Invalid Binary Zero Separation . . . . . . . . . . . Examples of Valid and Invalid Character String Separation . . . . . . . . . Examples of Valid and Invalid Hexadecimal String Separation . . . . . . . . . Example of DYNSPC Primary Space . . . FILSZ Variations Summary . . . . . . SIZE Variations Summary . . . . . . SDB=LARGE Block Sizes for Tape Output Data Sets . . . . . . . . . . . . Aliases for OPTION Statement Options Current date constants . . . . . . . Future Date Constants . . . . . . . Past Date Constants . . . . . . . . Current time constants . . . . . . . p,m,Y2x Output. . . . . . . . . . p,m,Y2x(c) Output . . . . . . . . . p,m,Y2xP Output . . . . . . . . . Edit Field Formats and Lengths . . . . . xiv . xiv . 22 . 41 . 61 62 . 63 102 . 103 52. . 103 . . . . . . . . 104 105 106 106 107 108 108 109 53. 54. 55. 56. 57. 58. 59. 60. . 116 61. . 117 62. . 118 . 119 . 121 . 125 . 130 . 131 . 131 . 131 . . . . 132 182 187 188 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. . 204 221 . 253 . 254 . 255 . 256 . 263 . 264 . 265 . 265 76. 77. 78. 79. 43. 44. 45. 46. 47. 48. 49. 50. 51. Edit Mask Patterns. . . . . . . . . . Edit Mask Signs . . . . . . . . . . Digits Needed for Numeric Fields . . . . Edit Mask Output Field Lengths . . . . . To Output Field Lengths . . . . . . . . Digits for TOTAL Fields . . . . . . . . Control Field Formats and Lengths . . . . Summary Field Formats and Lengths Functions of Routines at Program User Exits (Sort) . . . . . . . . . . . . . . Functions of Routines at Program User Exits (Copy and Merge) . . . . . . . . . . E15 User Exit Parameter List . . . . . . E32 User Exit Parameter List . . . . . . E35 User Exit Parameter List . . . . . . E15 Without a SORTIN Data Set . . . . . E15 With a SORTIN Data Set Before End of Input . . . . . . . . . . . . . . E15 With a SORTIN Data Set After End of Input . . . . . . . . . . . . . . E35 With a SORTOUT or OUTFIL Data Set Before End of Input . . . . . . . . . E35 Without a SORTOUT or OUTFIL Data Set Before End of Input . . . . . . . . . E35 With a SORTOUT or OUTFIL Data Set After End of Input . . . . . . . . . . E35 without a SORTOUT or OUTFIL Data Set After End of Input . . . . . . . . . . Aliases for Message Option . . . . . . . Obtaining Various Statistics . . . . . . . Creating Multiple Versions/Combinations of Data Sets . . . . . . . . . . . . . JCL Statements for ICETOOL . . . . . . Attributes of Edit Masks . . . . . . . . Edit Mask Patterns. . . . . . . . . . Return Area Lengths/Operation-Specific Values . . . . . . . . . . . . . . Functions of an Extended Function Support (EFS) Program . . . . . . . . . . . D1 Format Returned by an EFS Program Correlator Identifier and D2 Format Returned by an EFS Program . . . . . . . . . Original and Altered Control Statements Number of Tracks per Cylinder for Disk Devices . . . . . . . . . . . . . Minimum Storage Required for Various File Sizes . . . . . . . . . . . . . . Work Space Requirements for Various Input Characteristics . . . . . . . . . . . Number of Tracks per Cylinder for Disk Devices . . . . . . . . . . . . . Work Space Requirements of the Various Tape Techniques . . . . . . . . . . . . Directly Invoked DFSORT Option Specification/Override . . . . . . . . 268 270 271 271 277 332 421 429 439 439 447 457 459 481 481 481 481 482 482 482 490 506 507 509 539 539 656 700 710 711 724 730 779 783 783 784 791
xi
Extended Parameter List DFSORT Option Specification/Override . . . . . . . 24-Bit List DFSORT Option Specification/Override . . . . . . . Allowed with Frequently Used Data Types
Allowed with Other Data Types . . . Equivalent DFSORT formats for various COBOL data types . . . . . . . . EBCDIC Collating Sequence . . . . ASCII Collating Sequence . . . . .
. . . .
xii
xiii
v Chapter 9, Improving Efficiency, on page 727, recommends ways with which you can maximize DFSORT processing efficiency. This chapter covers a wide spectrum of improvements you can make, from designing individual applications for efficient processing at your site to using DFSORT features such as Hipersorting, dataspace sorting, and ICEGENER. v Chapter 10, Examples of DFSORT Job Streams, on page 747, contains annotated example job streams for sorting, merging, and copying records. v Appendix A, Using Work Space, on page 777, explains main storage considerations and how to estimate the amount of intermediate storage you might require when sorting data. v Appendix B, Specification/Override of DFSORT Options, on page 787, contains a series of tables you can use to find the order of override for similar options that are specified in different sources. v Appendix C, Data Format Descriptions, on page 815, gives examples of the assembled data formats. v Appendix D, EBCDIC and ASCII Collating Sequences, on page 827, lists the collating sequences from low to high order for EBCDIC and ISCII/ASCII characters. v Appendix E, DFSORT Abend Processing, on page 833, describes the ESTAE recovery routine for processing abends, and the Checkpoint/Restart facility. v Notices on page 839, includes the notices, Programming Interface information, and the trademark list.
Referenced documents
This document refers to the following documents:
Table 2. Referenced documents Document title z/OS DFSMSdfp Checkpoint/Restart Order number SC26-7401
xiv
Table 2. Referenced documents (continued) Document title z/OS DFSMS Macro Instructions for Data Sets z/OS DFSMS Using Data Sets z/OS MVS JCL Reference z/OS MVS JCL Users Guide z/OS MVS Programming: Assembler Services Reference IAR-XCT Order number SC26-7408 SC26-7410 SA22-7597 SA22-7598 SA22-7607 SA22-7605 GI10-0670 SA22-7801
| |
z/OS MVS Programming: Assembler Services Guide z/OS Program Directory z/OS UNIX System Services Users Guide
The z/OS DFSORT Application Programming Guide is a part of a more extensive DFSORT library. These documents can help you work with DFSORT more effectively.
Task Planning For and Customizing DFSORT Learning to Use DFSORT Diagnosing Failures and Interpreting Messages Tuning DFSORT Publication Title Order Number
z/OS DFSORT Installation and SC26-7524 Customization z/OS DFSORT: Getting Started SC26-7527 z/OS DFSORT Messages, Codes and Diagnosis Guide z/OS DFSORT Tuning Guide SC26-7525 SC26-7526
xv
v Your z/OS TSO/E host system. You can install code on your z/OS systems to access IBM message explanations using LookAt from a TSO/E command line (for example: TSO/E prompt, ISPF, or z/OS UNIX System Services). v Your Microsoft Windows workstation. You can install LookAt directly from the z/OS Collection (SK3T-4269) or the z/OS and Software Products DVD Collection (SK3T-4271) and use it from the resulting Windows graphical user interface (GUI). The command prompt (also known as the DOS > command line) version can still be used from the directory in which you install the Windows version of LookAt. v Your wireless handheld device. You can use the LookAt Mobile Edition from www.ibm.com/servers/eserver/zseries/zos/bkserv/lookat/lookatm.html with a handheld device that has wireless access and an Internet browser. You can obtain code to install LookAt on your host system or Microsoft Windows workstation from: v A CD in the z/OS Collection (SK3T-4269). v The z/OS and Software Products DVD Collection (SK3T-4271). v The LookAt Web site (click Download and then select the platform, release, collection, and location that suit your needs). More information is available in the LOOKAT.ME files available during the download process.
Notational conventions
The syntax diagrams in this document are designed to make coding DFSORT program control statements simple and unambiguous. The lines and arrows represent a path or flowchart that connects operators, parameters, and delimiters in the order and syntax in which they must appear in your completed statement. Construct a statement by tracing a path through the appropriate diagram that includes all the parameters you need, and code them in the order that the diagram requires you to follow. Any path through the diagram gives you a correctly coded statement, if you observe these conventions: v Read the syntax diagrams from left to right and from top to bottom. v Begin coding your statement at the spot marked with the double arrowhead.
v A single arrowhead at the end of a line indicates that the diagram continues on the next line or at an indicated spot.
v Strings in upper-case letters, and punctuation (parentheses, apostrophes, and so on), must be coded exactly as shown.
xvi
Notational Conventions
Semicolons are interchangeable with commas in program control statements and the EXEC PARM string. For clarity, only commas are shown in this document. v Strings in all lowercase letters represent information that you supply. v Required parameters appear on the same horizontal line (the main path) as the operator, while optional parameters appear in a branch below the main path.
Required Optional
v Where you can make one choice between two or more parameters, the alternatives are stacked vertically.
Operator
If one choice within the stack lies on the main path (as in the example above, left), you must specify one of the alternatives. If the stack is placed below the main path (as in the example above, right), then selections are optional, and you can choose either one or none of them. v The repeat symbol shows where you can return to an earlier position in the syntax diagram to specify a parameter more than once (see the first example below), to specify more than one choice at a time from the same stack (see the second example below), or to nest parentheses (see the third example below).
, a,b,c
Do not interpret a repeat symbol to mean that you can specify incompatible parameters. For instance, do not specify both ABEND and NOABEND in the same EXEC statement, or attempt to nest parentheses incorrectly. Use any punctuation or delimiters that appear within the repeat symbol to separate repeated items. v A double arrowhead at the end of a line indicates the end of the syntax diagram.
xvii
Notational Conventions
xviii
Summary of Changes
This document contains terminology, maintenance, and editorial changes. Technical changes or additions to the text and illustrations are indicated by a vertical line to the left of each change. You might notice changes in the style and structure of some content in this documentfor example, more specific headings for notes, such as Tip and Requirement. The changes are ongoing improvements to the consistency and retrievability of information in DFSORT documents. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Summary of Changes for SC26-7525-04 z/OS Version 1 Release 11 (PTFs - July, 2008)
This document contains information that was previously presented in z/OS DFSORT Application Programming Guide, SC26-7523-03. The following sections summarize the changes to that information.
New Information
This edition includes the following new enhancements:
Group Operations
WHEN=GROUP is a new type of IFTHEN clause that allows you to do various types of operations involving groups of records. WHEN=GROUP makes it easy to propagate fields from the first record of a group to the other records of the group, add an identifier to each record of the group, or add a sequence number to each
xix
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
record of the group. These functions are useful by themselves, and can also facilitate other types of group operations such as sorting groups, including or omitting groups, and so on. WHEN=GROUP can be used in IFTHEN clauses in an INREC, OUTREC or OUTFIL statement in the same way WHEN=INIT can be used. Various options of WHEN=GROUP allow you to use logical expressions to define the beginning and end of a group (BEGIN, END), define the number of records in a group (RECORDS), and define the fields, identifiers and sequence numbers to be added to the records of each group (PUSH). DFSORT symbols can be used for columns, fields and constants specified with WHEN=GROUP clauses.
DATASORT
DATASORT is a new operator of ICETOOL that allows you to sort data records between header (first) records and trailer (last) records. DATASORT makes it easy to sort the data records while keeping one or more header records and/or one or more trailer records in place. DATASORT does not require an identifier in the header or trailer records; it can treat the first n records as header records and the last n records as trailer records. Various options of DATASORT allow you to define the number of header records and/or trailer records (HEADER or FIRST, TRAILER or LAST), the ddname for the input data set (FROM), the ddname for the output data set (TO), and the SORT and other DFSORT control statements to be used for the DATASORT operation (USING). DFSORT symbols can be used for the number of header and trailer records specified with DATASORT.
SUBSET
SUBSET is a new operator of ICETOOL that allows you to create a subset of the input or output records by specifying that you want to keep or remove header (first) records, trailer (last) records, or records with specific relative record numbers. SUBSET makes it easy to keep or remove records based on these criteria. SUBSET does not require an identifier or sequence number in the records to be kept or removed. Various options of SUBSET allow you to define the criteria (HEADER or FIRST, TRAILER or LAST, RRN), the ddname for the input data set (FROM), the ddname for the output data set to contain the records that meet the criteria and/or dont meet the criteria (TO, DISCARD), whether the records that meet the criteria are to be kept or removed (KEEP, REMOVE), whether the criteria are to be applied to the input or output records (INPUT, OUTPUT), and DFSORT control statements to be used for the SUBSET operation (USING). DFSORT symbols can be used for the number of header and trailer records and for the relative record numbers specified with SUBSET.
xx
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Summary of Changes
xxi
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
increase or decrease, respectively, the actual record count to get a resulting modified record count. This is especially useful for dealing with data sets that contain header and/or trailer records. The resulting modified record count is displayed in the count message in TOOLMSG and in the count data set, and used to determine if the criteria specified by the existing EMPTY, NOTEMPTY, HIGHER(x), LOWER(y), EQUAL(v) or NOTEQUAL(w) option is satisfied. DFSORT symbols can be used for n with ADD(n) and SUB(n).
xxii
New Information
This edition includes the following new enhancements:
Installation Options
ICEPRMxx members in concatenated PARMLIB can now be used to specify changes to DFSORTs installation options. Each ICEPRMxx member can contain options to be changed for any or all of DFSORTs eight installation environments (JCL, INV, TSO, TSOINV and TD1-TD4). Up to ten ICEPRMxx members can be activated by a START ICEOPT started task command. The options in the activated members will be merged with the ICEMAC defaults at run-time. A different ICEPRMxx member, or combination of ICEPRMxx members, for different LPARs can be activated at IPL time by including a START ICEOPT command in an appropriate COMMNDxx member in PARMLIB, or at any time by issuing a START ICEOPT command from the console. ICEPRMxx members are now the recommended way to change DFSORT installation defaults since they are easier to use and more flexible then the old method using the ICEMAC macro and usermods. However, the old method is still supported. The ICETOOL DEFAULTS operator can be used at any time to produce a report showing the merged PARMLIB/ICEMAC installation default values for each environment that will be used at run-time, as well as the active ICEPRMxx and ICEMAC values.
Summary of Changes
xxiii
Improved Diagnostics
DFSORT now provides additional information in messages ICE098I, ICE253I and ICE254I to aid in diagnosing and correcting out-of-space conditions associated with message ICE046A. DFSORT now provides specific reason codes and associated documentation to aid in diagnosing and correcting errors associated with the following messages: ICE017A, ICE018A, ICE024A, ICE042A, ICE043A, ICE109A, ICE126A and ICE251A.
Installation Options
ICEPRMxx members are now the recommended way to change DFSORT installation defaults since they are easier to use and more flexible then the old method using the ICEMAC macro and usermods. However, the old method is still supported.
Dataspace Sorting
The existing EXPMAX, EXPOLD and EXPRES installation options now apply to dataspace sorting as well as to memory object sorting and Hipersorting
ICEDTEX Macro
Previously, fields ICEDSBKA, ICEDSBKB and ICEDSBKC in the ICEDTEX macro provided statistics on expanded storage pages available for dataspace sorting, while fields ICEDSBTA, ICEDSBTB and ICEDSBTC provided total expanded and central storage pages available for dataspace sorting. Since this level of DFSORT and z/OS no longer supports expanded storage, fields ICEDSBKA, ICEDSBKB and ICEDSBKC are no longer relevant and have been removed. If you have an ICETEXIT program that uses fields ICEDSBKA, ICEDSBKB and ICEDSBKC, you should remove any references to those fields (you can change your program to use fields ICEDSBTA, ICEDSBTB and ICEDSBTC instead) and recompile your program before using it with this level of DFSORT.
xxiv
Summary of Changes for SC26-7523-02 z/OS Version 1 Release 8 (PTFs - April, 2006)
This document contains information that was previously presented in z/OS DFSORT Application Programming Guide, SC26-7523-01. The following sections summarize the changes to that information.
New Information
This edition includes the following new enhancements:
Summary of Changes
xxv
BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and FIELDS now allow you to use a new JFY option to left-justify or right-justify the data in a field. For a left-justified field, leading blanks are removed and the characters from the first nonblank to the last nonblank are shifted left, with blanks inserted on the right if needed. For a right-justified field, top trailing blanks are removed and the characters from the last nonblank to the first nonblank are shifted right, with blanks inserted on the left if needed. Optionally for JFY, specific leading and trailing characters can be changed to blanks before justification begins, a leading string can be inserted, a trailing string can be inserted, and the output length can be changed. BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and FIELDS now allow you to use a new SQZ option to left-squeeze or right-squeeze the data in a field. For a left-squeezed field, all blanks are removed and the characters from the first nonblank to the last nonblank are shifted left, with blanks inserted on the right if needed. For a right-squeezed field, all blanks are removed and the characters from the last nonblank to the first nonblank are shifted right, with blanks inserted on the left if needed. Optionally for SQZ, specific characters can be changed to blanks before squeezing begins, a leading string can be inserted, a trailing string can be inserted, a string can be inserted wherever a group of blanks is removed between the first nonblank and the last nonblank, blanks can be kept as is between paired apostrophes or paired quotes, and the output length can be changed. BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and FIELDS now allow you to insert past and future dates (relative to the date of your DFSORT run) into your records in various forms using new DATEn+r, DATEn-r, DATEn(c)+r, DATEn(c)-r, DATEnP+r and DATEnP-r constants. &DATEn+r, &DATEn-r, &DATEn(c)+r, &DATEn(c)-r, &DATEnP+r and &DATEnP-r can be used as aliases for DATEn+r, DATEn-r, DATEn(c)+r, DATEn(c)-r, DATEnP+r and DATEnP-r, respectively. BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and FIELDS now allow you to use FL format to convert 4-byte or 8-byte hexadecimal floating-point values to integer values. BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and FIELDS now allow you to use new TO=PDF and TO=PDC options to convert numeric values to PD values with F or C for the positive sign, respectively. The TO=PDC option is equivalent to the existing TO=PD option. BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and FIELDS now allow you to use &DATEn, &DATEn(c), &DATEnP, &YDDD=(abc), &YDDDNS=(ab), &TIMEn, &TIMEn(c) and &TIMEnP as aliases for DATEn, DATEn(c), DATEnP, YDDD=(abc), YDDDNS=(ab), TIMEn, TIMEn(c) and TIMEnP, respectively. IFTHEN WHEN now allows you to compare date fields in various formats to past and future dates (relative to the date of your DFSORT run) using new DATEn+r, DATEn-r, DATEn(c)+r, DATEn(c)-r, DATEnP+r, DATEnP-r, YDATEn+r, and YDATEn-r constants. &DATEn+r, &DATEn-r, &DATEn(c)+r, &DATEn(c)-r, &DATEnP+r and &DATEnP-r can be used as aliases for DATEn+r, DATEn-r, DATEn(c)+r, DATEn(c)-r, DATEnP+r and DATEnP-r, respectively.
xxvi
IFTHEN WHEN now allows you to test a field for numerics (field,EQ,NUM) or non-numerics (field,NE,NUM) in character (FS), zoned decimal (ZD) or packed decimal (PD) format. IFTHEN WHEN now allows you to use &DATEn, &DATEn(c) and &DATEnP as aliases for DATEn, DATEn(c) and DATEnP, respectively.
OUTFIL Enhancements
BLKCCH1 is a new report option that allows you to avoid forcing a page eject at the start of the report header; the ANSI carriage control character of 1 (page eject) in the first line of the report header (HEADER1) is replaced with a blank. BLKCCH2 is a new report option that allows you to avoid forcing a page eject at the start of the first page header; the ANSI carriage control character of 1 (page eject) in the first line of the first page header (HEADER2) is replaced with a blank. BLKCCT1 is a new report option that allows you to avoid forcing a page eject at the start of the report trailer; the ANSI carriage control character of 1 (page eject) in the first line of the report trailer (TRAILER1) is replaced with a blank. SPLIT1R is a new option that allows you to write contiguous groups of records in one rotation among multiple output data sets. A specified number of records is written to each output data set and extra records are written to the last output data set. PARSE and IFTHEN PARSE are new options that allow you to extract variable position/length fields into fixed-length parsed fields defined as %nn fields. PARSE gives you powerful new capabilities for handling variable fields such as delimited fields, comma separated values (CSV), tab separated values, blank separated values, keyword separated fields, null-terminated strings, and many other types. You can use various PARSE options to define the rules for extracting variable fields into up to one hundred %nn fixed-length parsed fields (%00-%99), and then use these %nn fields where you can use p,m fields in BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and OUTREC. You can edit, convert, justify, squeeze, translate, and do arithmetic with %nn fields. BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and OUTREC now allow you to use a new JFY option to left-justify or right-justify the data in a field. For a left-justified field, leading blanks are removed and the characters from the first nonblank to the last nonblank are shifted left, with blanks inserted on the right if needed. For a right-justified field, trailing blanks are removed and the characters from the last nonblank to the first nonblank are shifted right, with blanks inserted on the left if needed. Optionally for JFY, specific leading and trailing characters can be changed to blanks before justification begins, a leading string can be inserted, a trailing string can be inserted, and the output length can be changed. BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and OUTREC now allow you to use a new SQZ option to left-squeeze or right-squeeze the data in a field. For a left-squeezed field, all blanks are removed and the characters from the first nonblank to the last nonblank are shifted left, with blanks inserted on the right if needed. For a right-squeezed field, all blanks are removed and the characters from the last nonblank to the first nonblank are shifted right, with blanks inserted on the left if needed.
Summary of Changes
xxvii
Optionally for SQZ, specific characters can be changed to blanks before squeezing begins, a leading string can be inserted, a trailing string can be inserted, a string can be inserted wherever a group of blanks is removed between the first nonblank and the last nonblank, blanks can be kept as is between paired apostrophes or paired quotes, and the output length can be changed. BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and OUTREC now allow you to insert past and future dates (relative to the date of your DFSORT run) into your records in various forms using new DATEn+r, DATEn-r, DATEn(c)+r, DATEn(c)-r, DATEnP+r and DATEnP-r constants. &DATEn+r, &DATEn-r, &DATEn(c)+r, &DATEn(c)-r, &DATEnP+r and &DATEnP-r can be used as aliases for DATEn+r, DATEn-r, DATEn(c)+r, DATEn(c)-r, DATEnP+r and DATEnP-r, respectively. TRAILERx, BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and OUTREC now allow you to use FL format to convert 4-byte or 8-byte hexadecimal floating-point values to integer values. TRAILERx, HEADERx, BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and OUTREC now allow you to use new TO=PDF and TO=PDC options to convert numeric values to PD values with F or C for the positive sign, respectively. The TO=PDC option is equivalent to the existing TO=PD option. BUILD, OVERLAY, IFTHEN BUILD, IFTHEN OVERLAY and OUTREC now allow you to use &DATEn, &DATEn(c), &DATEnP, &YDDD=(abc), &YDDDNS=(ab), &TIMEn, &TIMEn(c) and &TIMEnP as aliases for DATEn, DATEn(c), DATEnP, YDDD=(abc), YDDDNS=(ab), TIMEn, TIMEn(c) and TIMEnP, respectively. INCLUDE, OMIT and IFTHEN WHEN now allow you to compare date fields in various formats to past and future dates (relative to the date of your DFSORT run) using new DATEn+r, DATEn-r, DATEn(c)+r, DATEn(c)-r, DATEnP+r, DATEnP-r, YDATEn+r, and YDATEn-r constants. &DATEn+r, &DATEn-r, &DATEn(c)+r, &DATEn(c)-r, &DATEnP+r and &DATEnP-r can be used as aliases for DATEn+r, DATEn-r, DATEn(c)+r, DATEn(c)-r, DATEnP+r and DATEnP-r, respectively. INCLUDE, OMIT and IFTHEN WHEN now allow you to test a field for numerics (field,EQ,NUM) or non-numerics (field,NE,NUM) in character (FS), zoned decimal (ZD) or packed decimal (PD) format. INCLUDE, OMIT and IFTHEN WHEN now allow you to use &DATEn, &DATEn(c) and &DATEnP as aliases for DATEn, DATEn(c) and DATEnP, respectively.
Symbol Enhancements
A symbol can now be used for a %nn parsed field. For example, if Account,%01 is defined in SYMNAMES, Account can be used for %01. A symbol for %nn can be used in DFSORT control statements where %nn can be used. A symbol for %nn results in substitution of %nn. A symbol can now be used for an output column. For example, if Start_address,18 is defined in SYMNAMES, Start_address: can be used for 18:. symbol: can be used in DFSORT control statements where c: can be used. A symbol for p or p,m or p,m,f results in substitution of p: for symbol: (output column). A symbol can now be used for a new system symbol string constant. symbol,Sstring can be used to define a string containing any combination of
xxviii
EBCDIC characters and system symbols you want to use to form a character string. For example, if whererun,S &JOBNAME. on &SYSPLEX is defined in SYMNAMES, whererun can be used for the resulting constant. You can use dynamic system symbols such as &JOBNAME, &DAY, and so on, system-defined static system symbols such as &SYSNAME, &SYSPLEX, and so on, and installation-defined static system symbols specified by your installation in an IEASYMxx member of SYS1.PARMLIB. A symbol for a system symbol string can be used in DFSORT and ICETOOL control statements where a symbol for a character string can be used. DFSORT will replace each system symbol in Sstring with its substitution text to create a character string in the format Cnew_string.
ICETOOL Enhancements
DISPLAY now allows you to use FL format to convert 4-byte or 8-byte hexadecimal floating-point values to integer values. DISPLAY and OCCUR now allow you to use a new TBETWEEN(n) option to specify the number of blanks between title elements (title, page number, date, time). SELECT and SPLICE now allow you to use an INREC statement to reformat your records before they are selected or spliced. All of the operands of the INREC statement (PARSE, BUILD, OVERLAY, IFTHEN, IFOUTLEN and FIELDS) are now available with SELECT and SPLICE.
SUM Enhancements
The maximum position for the end of a sum field has been raised to 32752.
Other Enhancements
DFSORT supports large physical sequential data sets for input, output and work data sets. DSA can now be specified as a run-time option. This allows you to adjust the maximum amount of storage available to DFSORT for dynamic storage adjustment of individual Blockset sort applications when SIZE/MAINSIZE=MAX is in effect. DFSORT now accepts and ignores zero values in the starting and ending address of the RECORD statement image in the 24-bit Parameter List. You can set these addresses to zero if you dont want to pass a control statement to DFSORT using the third and fourth words of the parameter list.
xxix
FL Conversion
DFSORTs INREC, OUTREC and OUTFIL statements, and ICETOOLs DISPLAY operator, can now convert FL (hexadecimal floating-point) values to integer values, providing you are running in z/Architecture mode. If you use FL in INREC, OUTREC, OUTFIL or DISPLAY when running in ESA/390 mode, FL will be recognized and the error messages issued may be different than those issued previously when FL was not allowed in INREC, OUTREC, OUTFIL or DISPLAY. If you want to use FL in INREC, OUTREC, OUTFIL or DISPLAY, you must be running in z/Architecture mode.
Summary of Changes for SC26-7523-01 z/OS Version 1 Release 6 (PTFs - December, 2004)
This document contains information that was previously presented in z/OS DFSORT Application Programming Guide, SC26-7523-00. The following sections summarize the changes to that information.
New Information
This edition includes the following new enhancements:
ICETOOL Enhancements
ICETOOLs DISPLAY, OCCUR, RANGE, SELECT, SPLICE, STATS, UNIQUE and VERIFY operators now allow you to use larger numeric values for ON and BREAK fields. PD, ZD and FS fields can now be up to 31 digits (or more in some cases). BI and FI fields can now be up to 8 bytes (or more in some cases). ICETOOLs RANGE operator now allows you to use larger decimal values for the HIGHER(n), LOWER(n), EQUAL(n) and NOTEQUAL(n) options. These values can now be up to 31 digits. ICETOOLs DISPLAY, OCCUR, RANGE, SELECT, SPLICE, STATS and UNIQUE operators now allow you to use new UFF (unsigned free form) and SFF (signed free form) formats for ON and BREAK fields. UFF extracts a positive numeric value from a free form field (for example, $1234.56 is treated as +123456). SFF extracts a positive or negative value from a free form field (for example, (1,234.56) is treated as -123456). ICETOOLs DISPLAY and OCCUR operators now allow you to use new DC1-DC3 (TOD date), DE1-DE3 (ETOD date), TC1-TC4 (TOD time) and TE1-TE4 (ETOD time) formats for ON and BREAK fields. These new formats produce meaningful representations of TOD and ETOD date and time values.
xxx
ICETOOLs DISPLAY and OCCUR operators now allow you to specify multiline headings for the columns of your reports. You can specify one, two or three line headings with the HEADER option. ICETOOLs DISPLAY and OCCUR operators now allow you to use new edit masks G1-G6 to display numeric values with 4 decimal digits in various ways. ICETOOLs DISPLAY and OCCUR operators now allow you to use new YDDD(abc) and YDDDNS(abc) options to insert the year (yyyy) and day of the year (ddd) of your ICETOOL run into your titles in various forms. ICETOOLs COUNT operator now allows you to use a new RC4 option to set RC=4 (instead of RC=12) or RC=0 based on the count of records in a data set. ICETOOLs SPLICE operator now allows you to use a new KEEPBASE option to keep the base records as well as the spliced records. ICETOOLs SPLICE operator now allows you to use new VLENMAX or VLENOVLY options to set the length of spliced records to the maximum of the base or overlay record length, or to the overlay record length.
OUTFIL Enhancements
OUTFIL now allows you to reformat records in one of the following three ways using unedited, edited, or converted input fields and a variety of constants: v BUILD or OUTREC: The existing OUTREC parameter, or its new alias of BUILD, allows you to reformat each record by specifying all of its items one by one. BUILD or OUTREC gives you complete control over the items you want in your reformatted OUTFIL records and the order in which they appear. You can delete, rearrange and insert fields and constants. v OVERLAY: The new OVERLAY parameter allows you to reformat each record by specifying just the items that overlay specific columns. Overlay lets you change specific existing columns without affecting the entire record. v IFTHEN clauses: The new IFTHEN clauses allow you to reformat different records in different ways by specifying how BUILD or OVERLAY items are applied to records that meet given criteria. IFTHEN clauses let you use sophisticated conditional logic to choose how different record types are reformatted. OUTFIL OUTREC, as well as BUILD, OVERLAY, and IFTHEN, now allows you to use larger numeric values for fields and decimal constants to be edited, converted or used in arithmetic expressions. PD, ZD and FS fields, and decimal constants, can now be up to 31 digits. BI and FI fields can now be up to 8 bytes. OUTFIL OUTREC, as well as BUILD, OVERLAY, and IFTHEN, now allows you to use new UFF (unsigned free form) and SFF (signed free form) formats for fields to be edited, converted or used in arithmetic expressions. OUTFIL OUTREC, as well as BUILD, OVERLAY, and IFTHEN, now allows you to use new DC1-DC3 (TOD date), DE1-DE3 (ETOD date), TC1-TC4 (TOD time) and TE1-TE4 (ETOD time) formats for fields to be edited, converted or used in arithmetic expressions. These new formats produce meaningful representations of TOD and ETOD date and time values.
Summary of Changes
xxxi
OUTFIL OUTREC, as well as BUILD, OVERLAY, and IFTHEN, now allows you to use a set field in the CHANGE option (for example, 1,2,CHANGE=(4,CFY,C0001,CVV,21,4)). OUTFIL OUTREC, as well as BUILD, OVERLAY and IFTHEN, now allows you to restart the sequence number when the binary value of a specified field changes (for example, SEQNUM,5,ZD,RESTART=(11,4)). OUTFIL OUTREC, as well as BUILD, OVERLAY, and IFTHEN, now allows you to use DATE, DATE=(abcd), DATENS=(abc), YDDD=(abc), YDDDNS=(ab), TIME, TIME=(abc) and TIMENS=(ab) options to insert the date and time of your DFSORT run into your records in various forms. OUTFIL OUTREC, as well as BUILD, OVERLAY, and IFTHEN, now allows you to use new TO=ZDC and TO=ZDF options to convert numeric values to ZD values with C or F for the positive sign, respectively. The TO=ZDF option is equivalent to the existing TO=ZD option. OUTFIL INCLUDE and OMIT now allow you to use larger FS values for compare fields. These values can now be up to 32 digits. OUTFIL INCLUDE and OMIT now allow you to use larger decimal constants for comparison to BI and FI fields. Decimal constants can now be up to +18446744073709551615 for comparison to BI fields. Decimal constants can now be between -9223372036854775808 and +9223372036854775807 for comparison to FI fields. OUTFIL INCLUDE and OMIT now allow you to use new UFF (unsigned free form) and SFF (signed free form) formats for compare fields. A UFF or SFF field can be compared to a UFF, SFF, FS, CSL or CST field or to a decimal constant. OUTFIL TRAILERx now allows you to use larger numeric values for statistical fields (total, maximum, minimum, average). PD, ZD and FS fields, and decimal constants, can now be up to 31 digits. BI and FI fields can now be up to 8 bytes. OUTFIL TRAILERx now allows you to use new UFF (unsigned free form) and SFF (signed free form) formats for statistical fields (total, maximum,minimum, average). OUTFIL TRAILERx now allows you to use TO=fo and fo (to) options to convert statistical fields (total, maximum, minimum, average) and counts to BI, FI, PD, ZD, ZDC, ZDF or FS output values. OUTFIL TRAILERx now allows you to use COUNT+n=(edit), COUNT+n=(to), COUNT-n=(edit) and COUNT-n=(to) to add or subtract n from a count to be edited or converted (for example, COUNT+1=(TO=ZD)). OUTFIL HEADERx and TRAILERx now allow you to insert hexadecimal strings (Xyy...yy or nXyy...yy) in your headers and trailers. OUTFIL HEADERx and TRAILERx now allow you to use new YDDD=(abc) and YDDDNS=(ab) options to insert the year (yyyy) and day of the year (ddd) of your DFSORT run in your headers and trailers. OUTFIL HEADERx and TRAILERx now allow you to use PAGE=(edit) and PAGE=(to) to edit or convert the page number (for example, PAGE=(M11,LENGTH=3)).
xxxii
Summary of Changes
xxxiii
SORT and MERGE now allow you to use other characters besides + (plus) as a positive sign in control field values for CSL, CST, ASL, and AST formats. A (minus) sign is treated as negative and any other sign (for example, blank) is treated as positive.
SUM Enhancement
SUM now allows you to use larger ZD values for sum fields. These values can now be up to 31 digits
Other Enhancements
For sort and copy applications with concatenated variable-length input data sets for SORTIN, DFSORT now uses the largest LRECL it finds in the concatenation. DFSORT now allows control statements in SYSIN and SORTCNTL to contain labels up to 70 characters, and allows any character in the label. DFSORT now ignores statements with a label followed only by blanks.
16-Byte FS Fields
In order to handle larger FS fields (a sign and up to 31 digits), DFSORT and ICETOOL will now treat a 16-byte FS field as having a maximum of 16 digits, rather than 15 digits. For ICETOOLs DISPLAY and OCCUR operators, ON and BREAK fields for 16-byte FS values may result in different formatting for the output reports. You can use the new U15 formatting item to limit these values to 15 digits instead of 16 digits. For example, ON(11,16,FS,U15). For INREC, OUTREC and OUTFIL OUTREC, 16-byte FS values may be edited or converted differently for output. You can use EDIT=(pattern) or LENGTH=n to change the length of the output fields, if appropriate. For example, 11,16,FS,EDIT=(SIIIIIIIIIIIIIIT),SIGNS=(+,-).
xxxiv
Summary of Changes
xxxv
xxxvi
DFSORT Overview
This chapter introduces IBM z/OS DFSORT Licensed Program 5694-A01. DFSORT is intended to run in problem state and in a user key ( that is, key 8 or higher). DFSORT is a program you use to sort, merge, and copy information. v When you sort records, you arrange them in a particular sequence, choosing an order more useful to you than the original one. v When you merge records, you combine the contents of two or more previously sorted data sets into one. v When you copy records, you make an exact duplicate of each record in your data set. Merging records first requires that the input data sets are identically sorted for the information you will use to merge them and that they are in the same order required for output. You can merge up to 100 different data sets at a time. In addition to the three basic functions, you can perform other processing simultaneously: You can control which records to keep in the final output data set of a DFSORT run by using INCLUDE and OMIT statements in your application. These statements work like filters, testing each record against criteria that you supply and retaining only the ones you want for the output data set. For example, you might choose to work only with records that have a value of Kuala Lumpur in the field reserved for office location. Or perhaps you want to leave out any record dated after 2001 if it also contains a value greater than 20 for the number of employees. You can parse, edit, and reformat your records before or after other processing by using INREC and OUTREC statements. INREC and OUTREC statements support a wide variety of reformatting tasks including: v The use of fixed position/length fields or variable position/length fields. For fixed fields, you specify the starting position and length of the field directly. For variable fields, such as delimited fields, comma separated values (CSV), tab separated values, blank separated values, keyword separated fields,
Copyright IBM Corp. 1973, 2009
DFSORT Overview
null-terminated strings (and many other types), you define rules that allow DFSORT to extract the relevant data into fixed parsed fields, and then use the parsed fields as you would use fixed fields. v Insertion of blanks, zeros, strings, current date, future date, past date, current time, sequence numbers, decimal constants, and the results of arithmetic expressions before, between, and after the input fields in the reformatted records. v Sophisticated conversion capabilities, such as find and replace, hexadecimal display, conversion of EBCDIC letters from lowercase to uppercase or uppercase to lowercase, conversion of characters using the ALTSEQ translation table, conversion of numeric values from one format to another, left-justify or left-squeeze (remove leading blanks or all blanks and shift left), and right-justify or right-squeeze (remove trailing blanks or all blanks and shift right). v Sophisticated editing capabilities, such as control of the way numeric fields are presented with respect to length, leading or suppressed zeros, thousands separators, decimal points, leading and trailing positive and negative signs, and so on. Twenty-seven pre-defined editing masks are available for commonly used numeric editing patterns, encompassing many of the numeric notations used throughout the world. In addition, a virtually unlimited number of numeric editing patterns are available via user-defined editing masks. v Transformation of SMF, TOD, and ETOD date and time values to more usable forms. v Transformation of various forms of two-digit year dates to various forms of four-digit year dates using a specified fixed or sliding century window. v Selection of a character constant, hexadecimal constant, or input field from a lookup table for output, based on a character, hexadecimal, or bit string as input (that is, lookup and change). You can create the reformatted INREC or OUTREC records in one of the following ways: v By building the entire record one item at a time. v By only overlaying specific columns. v By performing find and replace operations. v By using sophisticated conditional logic or group operations to choose how different records are reformatted. You can sum numeric information from many records into one record with the SUM statement. For example, if you want to know the total amount of a yearly payroll, you can add the values for a field containing salaries from the records of all your employees. You can create one or more output data sets for a sort, copy, or merge application from a single pass over one or more input data sets by using OUTFIL control statements. You can use multiple OUTFIL statements, with each statement specifying the OUTFIL processing to be performed for one or more output data sets. OUTFIL processing begins after all other processing ends (that is, after processing for exits, options, and other control statements). OUTFIL statements support a wide variety of output data set tasks, including: v Creation of multiple output data sets containing unedited or edited records from a single pass over one or more input data sets. v Creation of multiple output data sets containing different ranges or subsets of records from a single pass over one or more input data sets. In addition, records that are not selected for any subset can be saved in a separate output data set.
| | |
DFSORT Overview
v Conversion of variable-length record data sets to fixed-length record data sets. v Conversion of fixed-length record data sets to variable-length record data sets. v A wide variety of parsing, editing and reformatting tasks including: The use of fixed position/length fields or variable position/length fields. For fixed fields, you specify the starting position and length of the field directly. For variable fields, such as delimited fields, comma separated values (CSV), tab separated values, blank separated values, keyword separated fields, null-terminated strings (and many other types), you define rules that allow DFSORT to extract the relevant data into fixed parsed fields, and then use the parsed fields as you would use fixed fields. Insertion of blanks, zeros, strings, current date, future date, past date, current time, sequence numbers, decimal constants, and the results of arithmetic expressions before, between, and after the input fields in the reformatted records. Sophisticated conversion capabilities, such as find and replace, hexadecimal display, conversion of EBCDIC letters from lowercase to uppercase or uppercase to lowercase, conversion of characters using the ALTSEQ translation table, conversion of numeric values from one format to another, left-justify or left-squeeze (remove leading blanks or all blanks and shift left), and right-justify or right-squeeze (remove trailing blanks or all blanks and shift right). Sophisticated editing capabilities, such as control of the way numeric fields are presented with respect to length, leading or suppressed zeros, thousands separators, decimal points, leading and trailing positive and negative signs, and so on. Twenty-seven pre-defined editing masks are available for commonly used numeric editing patterns, encompassing many of the numeric notations used throughout the world. In addition, a virtually unlimited number of numeric editing patterns are available via user-defined editing masks. Transformation of SMF, TOD, and ETOD date and time values to more usable forms. Transformation of two-digit year dates to various forms of four-digit year dates using a specified fixed or sliding century window. Selection of a character constant, hexadecimal constant, or input field from a lookup table for output, based on a character, hexadecimal, or bit string as input (that is, lookup and change). v Creation of the reformatted records in one of the following ways: By building the entire record one item at a time. By only overlaying specific columns. | | | By performing find and replace operations. By using sophisticated conditional logic or group operations to choose how different records are reformatted. v Highly detailed three-level (report, page, and section) reports containing a variety of report elements you can specify (for example, current date, current time, edited or converted page numbers, character strings, and blank lines) or derive from the input records (for example, character fields; unedited, edited, or converted numeric input fields; edited or converted record counts; and edited or converted totals, maximums, minimums, and averages for numeric input fields). v Creation of multiple output records from each input record, with or without intervening blank output records. v Repetition and sampling of data records.
Chapter 1. Introducing DFSORT
DFSORT Overview
v Splitting of data records in rotation among a set of output data sets. You can control DFSORT functions with other control statements by specifying alternate collating sequences, invoking user exit routines, overriding installation defaults, and so on. You can direct DFSORT to pass control during run time to routines you design and write yourself. For example, you can write user exit routines to summarize, insert, delete, shorten, or otherwise alter records during processing. However, keep in mind that the extensive editing capabilities provided by the INCLUDE, OMIT, INREC, OUTREC, SUM, and OUTFIL statements can eliminate the need to write user exit routines. You can write your own routines to correct I/O errors that DFSORT does not handle, or to perform any necessary abnormal end-of-task operation before DFSORT terminates. You can write an EFS (Extended Function Support) program to intercept DFSORT control statements and PARM options for modification prior to use by DFSORT or to provide alternate sequence support for user-defined data. You can define and use a symbol for any field, constant, or output column that is recognized in a DFSORT control statement or ICETOOL operator. This makes it easy to create and reuse collections of symbols (that is, mappings) representing information associated with various record layouts. You can use system symbols (for example, &JOBNAME.) in your symbol constants. See Chapter 7, Using Symbols for Fields and Constants, on page 663.
Invoking DFSORT
You can invoke DFSORT processing in the following ways: v With an EXEC job control statement in the input stream using the name of the program (for example, PGM=ICEMAN or PGM=SORT) or the name of a cataloged procedure (for example, SORTD). See Chapter 2, Invoking DFSORT with Job Control Language, on page 25. TSO users can allocate the needed ddnames (for example, SYSOUT, SORTIN, SORTOUT and SYSIN), and invoke DFSORT using a calling method equivalent to PGM=ICEMAN. For example:
call *(iceman)
or any other alias for DFSORT (for example, SORT) in this form. See Chapter 10, Examples of DFSORT Job Streams, on page 747 for examples of invoking DFSORT from REXX and CLISTs.
Invoking DFSORT
v With a program written in basic assembler language using a system macro instruction. See Chapter 5, Invoking DFSORT from a Program, on page 483. v With programs written in either COBOL or PL/I with a special facility of the language. See the programmers guide describing the compiler version available at your location. v With the ICETOOL utility. See Chapter 6, Using ICETOOL, on page 501. In this document, the term directly invoked means that DFSORT is not initiated from another program. The term program invoked means that DFSORT is initiated from another program.
Operating Systems
DFSORT runs under control of your z/OS operating system and must be initiated according to the appropriate conventions. Additionally, DFSORT runs under z/OS when it is running as a guest under z/VM. DFSORT is compatible with all of the IBM processors supported by z/OS. In addition to any device supported by z/OS for program residence, DFSORT also operates with any device QSAM or VSAM uses for input or output.
Record
Control field 3
Control field 4
Control field 2
Figure 1. Control Fields. Control fields may overlap, or be contained within other control fields.
DFSORT offers several standard collating sequences. You can choose to arrange your records according to these standard collating sequences or according to a collating sequence defined in the active locale. Conceptually, a collating sequence is a specific arrangement of character priority used to determine which of two values in the same control field of two different records should come first. DFSORT uses EBCDIC, the standard IBM collating sequence, or the ASCII collating sequence when sorting or merging records. If locale processing is in effect, DFSORT will use the collating sequence defined in the active locale. The collating sequence for character data and binary data is absolute; character and binary fields are not interpreted as having signs. For packed decimal, zoned decimal, fixed-point, normalized floating-point, and the signed numeric data formats, collating is algebraic; each quantity is interpreted as having an algebraic sign. You can modify the standard EBCDIC sequence to collate differently if, for example, you want to allow alphabetic collating of national characters. An alternate collating sequence can be defined with the ALTSEQ installation option, or you can define it yourself at run-time with the ALTSEQ program control statement. You can also specify a modified collating sequence with an E61 user exit or with an EFS program. You can specify the LOCALE installation or run-time option to use an active locales collating rules.
DFSORT Processing
You must prepare job control language (JCL) statements and DFSORT program control statements to invoke DFSORT processing. JCL statements (see Chapter 5, Invoking DFSORT from a Program, on page 483) are processed by your operating system. They describe your data sets to the operating system and initiate DFSORT processing. DFSORT program control statements (see Chapter 3, Using DFSORT Program Control Statements, on page 81) are processed by the DFSORT program. They describe the functions you want to perform and invoke the processing you request. A sort application usually requires intermediate storage as working space during the program run. This storage can be one of the following: 1. Hiperspace, using DFSORTs Hipersorting feature. 2. Work data setseither allocated dynamically by DFSORTs DYNALLOC facility or specified by the user, using JCL DD statements. If specified by the user, the intermediate storage devices and the amount of work space must be indicated. Methods for determining the amount of work space to allocate are explained in Appendix A, Using Work Space, on page 777. 3. A combination of Hiperspace and work data sets. Merge and copy applications do not require intermediate storage.
Chapter 1. Introducing DFSORT
DFSORT Processing
Figure 2 on page 9 illustrates the processing order for record handling, exits, statements, and options. Use this diagram with the text following it to understand the order DFSORT uses to run your job.
DFSORT Processing
DFSORT Processing
1. DFSORT first checks whether you supplied a SORTIN data set for SORT and COPY jobs or SORTINnn data sets for MERGE jobs. If so, DFSORT reads the input records from them. v If no SORTIN data set is present for a SORT or COPY job, you must use an E15 user exit to insert all the records. (This is also true if you invoke DFSORT from a program with the address of an E15 user exit in the parameter list, because SORTIN will be ignored.) DFSORT can use a COBOL E15 routine if you specified the E15 user exit in the MODS statement. v If no SORTINnn data sets are present for a MERGE job, you must use an E32 user exit to insert all the records. 2. If input records for SORT or COPY jobs are read from a SORTIN data set, DFSORT performs processing specified with the SKIPREC option. DFSORT deletes records until the SKIPREC count is satisfied. Eliminating records before a SORT or COPY gives better performance. 3. If the input records for a SORT or COPY job are read from a SORTIN data set, DFSORT checks whether you specified an E15 user exit. If so, DFSORT transfers control to the user exit routine. You can use a COBOL E15 routine if the E15 user exit is specified in the MODS statement. The E15 routine can insert, delete, or reformat records. 4. DFSORT performs processing specified on an INCLUDE or OMIT statement. If you used an E15 user exit routine to reformat the records, the INCLUDE/OMIT fields you specify must apply to the current format rather than to the original format. If you use the INCLUDE or OMIT statements to delete unnecessary records before SORT, MERGE, or COPY processing, your jobs run more efficiently. 5. For SORT or COPY jobs, DFSORT performs processing specified with the STOPAFT option. Record input stops after the maximum number of records (n) you specify have been accepted. DFSORT accepts records for processing if they are: v Read from SORTIN or inserted by E15 v Not deleted by SKIPREC v Not deleted by E15 v Not deleted by an INCLUDE or OMIT statement. 6. DFSORT performs processing specified in an INREC statement. Data records are parsed, edited and reformatted according to the options specified. If you reformatted the records before this step, the INREC fields you specify must apply to the current format rather than to the original format. 7. DFSORT performs processing specified in the SORT, MERGE, or OPTION COPY statement. v For SORT, all input records are processed before any output record is processed. v For COPY or MERGE, an output record is processed after an input record is processed. v For SORT or MERGE, if a SUM statement is present, DFSORT processes it during the SORT or MERGE processing. DFSORT summarizes the records and deletes duplicates. If you reformatted the records before this step, the SORT or MERGE and SUM fields you specify must apply to the current format rather than to the original format. 8. DFSORT performs processing specified in an OUTREC statement. Data records are parsed, edited and reformatted according to the options specified. If you reformatted the records before this step, the OUTREC fields you specify must apply to the current format rather than to the original format.
10
DFSORT Processing
9. If an E35 user exit is present, DFSORT transfers control to your user exit routine after all statement processing (except OUTFIL) is completed. If you reformatted the records, the E35 user exit receives the records in the current format rather than in the original format. You can use a COBOL E35 routine if you specify the E35 user exit in the MODS statement. You can use the E35 exit routine to add, delete, or reformat records. If SORTOUT and OUTFIL data sets are not present, the E35 exit must dispose of all the records because DFSORT treats these records as deleted. (This is also true if you do not specify OUTFIL data sets and DFSORT is invoked with the address of an E35 user exit in the parameter list, because SORTOUT will be ignored.) 10. DFSORT writes your records to the SORTOUT data set, if present. 11. DFSORT performs processing specified in one or more OUTFIL statements, if present: v DFSORT performs processing specified with the STARTREC, SAMPLE, and ENDREC options. Record input for the OUTFIL data sets starts with the record indicated by STARTREC, ends with the record indicated by ENDREC, and is sampled according to the records indicated by SAMPLE. v DFSORT performs processing specified with the INCLUDE, OMIT, or SAVE option. Records are included or omitted from the OUTFIL data sets according to the criteria specified. v DFSORT performs processing specified with the PARSE, OUTREC (or BUILD), OVERLAY, FINDREP, IFTHEN, FTOV, VTOF (or CONVERT), VLFILL, VLTRIM and REPEAT options. Data records are parsed, edited, reformatted, converted and repeated according to the options specified. v DFSORT performs processing specified with the LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS, NODETAIL, BLKCCH1, BLKCCH2, BLKCCT1 and REMOVECC options. Data records are reformatted and report records are generated for the OUTFIL data sets. v DFSORT performs SPLIT, SPLITBY, or SPLIT1R processing. Records are distributed among the OUTFIL data sets as evenly as possible. v DFSORT writes your OUTFIL records to the appropriate OUTFIL data sets.
11
12
Merging Records
Input to a merge application can be up to 100 blocked or unblocked QSAM or VSAM data sets containing fixed- or variable-length records. The input data sets can be either QSAM or VSAM, but not both. The records in all input data sets must already be sorted in the same order as that required for output. Output from a merge application can be blocked or unblocked QSAM or VSAM data sets, regardless of whether the input is QSAM or VSAM. Unless OUTFIL is used to convert variable input to fixed output, or fixed output to variable output, an output data set must be the same type (fixed or variable) as the input data set. | | Files in a z/OS file system are supported as input and output for merge applications.
General Considerations
Variable-length records are processed with a record descriptor word (RDW) in positions 1-4, so the data starts in position 5. Fixed-length records are processed without an RDW, so the data starts in position 1. Control statement positions should be specified accordingly. Your records can be EBCDIC, ASCII, Japanese, and data types you define yourself. To process Japanese data types with DFSORT, you can use the IBM Double Byte Character Set Ordering Support Program (DBCS Ordering), Licensed Program 5665-360, Release 2.0, or you can use locale processing with the appropriate locale. Input and output data sets must be on devices that can be used with QSAM or VSAM. Standard system data management rules apply to all data set processing. In particular: v Be aware that when using fixed standard record format for input data sets, the first short block is treated like an End of Volume. See z/OS DFSMS Using Data Sets for more details. v Be aware that, in some cases, if a DD statement specifies a data set for output that is extended to a second or subsequent volume, and another DD statement within the same step requests the same data set, only the records on the first volume will be read, and incorrect output will result. Specifically, when a new output data set is allocated with a unit count and volume count greater than one, but specifies no volume serial numbers, one volume is allocated. If a second or succeeding DD statement within the same step requests the same data set, the same volume is allocated to it. If this job step extends the output data set to more volumes, this new volume information is not available to the second or succeeding DD statement. Thus, you should not use different DDs for a data set to be used for output and then input in the same step, unless the data set cannot be extended to a second
13
Note: If AQ format is specified, or CH format is specified and the CHALT option is in effect, the maximum record length for variable-length records is 32767 bytes, less the length of the control fields. The number of records that can be sorted using a given amount of storage is reduced by: v Processing control fields of different formats v Large numbers of control fields v Large numbers of intermediate data sets. Providing an Extended Function Support program with an EFS01 routine can limit the record length that can be used when processing variable-length records. The minimum block length for tape work data sets is 18 bytes; the minimum record length is 14 bytes.
14
QSAM Considerations
v If you use DSN=NULLFILE on your DD statement for an input data set, a system restriction prevents DFSORT from using the EXCP access method. v Empty input data sets can be used. v If any of the input data sets are on tape without standard labels, DCB parameters must be specified on their DD statements. v ISO/ANSI Version 1 tape files can only be used as inputnever as output. v DFSORT sets appropriate BUFNO values for the input and output data sets; specifying BUFNO in the DD statements for these data sets has no effect. See SORTIN DD Statement on page 68 for additional considerations.
VSAM Considerations
v You can have DFSORT process VSAM records as fixed-length (F) or variable-length (V). When you use VSAM input, DFSORT selects fixed-length processing if you specify RECORD TYPE=F or variable-length processing if you specify RECORD TYPE=V. If you do not specify RECORD TYPE=x, DFSORT selects the record type to use according to the rules described in the discussion of the TYPE operand in RECORD Control Statement on page 414. The record type selected affects how the records are treated, and how control statement positions should be specified, as follows: Variable-length processing: An RRDS, KSDS, ESDS or VRRDS can always be processed as variable-length. For VSAM input, DFSORT reads each record and prepends a record descriptor word (RDW) to it. For VSAM output, DFSORT removes the RDW before writing each record. Since DFSORT uses an RDW in positions 1-4 to process variable-length records, the data starts in position 5. Control statement positions should be specified accordingly. Fixed-length processing: An RRDS can always be processed as fixed-length. A KSDS, ESDS or VRRDS used for input should only be processed as fixed-length if all of its records have a length equal to the maximum record size defined for the cluster. Otherwise, input records which are shorter than the maximum record size are padded with bytes that may or may not be zeros (that is, garbage bytes). DFSORT does not use an RDW to process fixed-length records, so the data starts in position 1. Control statement positions should be specified accordingly. v If a data set is password protected, passwords can be entered at the console or (with some restrictions) through routines at user exits E18, E38, and E39. Note: Passwords cannot be handled in this way for OUTFIL data sets.
Chapter 1. Introducing DFSORT
15
| |
Installation Defaults
When your system programmers installed DFSORT, they selected separate sets of installation defaults for the following eight installation environments: ICEAM1 (JCL) is the batch direct invocation environment. This set of installation defaults is used at run time when DFSORT is invoked directly (that is, not through programs) by batch jobs, provided that an enabled time-of-day installation environment (ICETDx) is not activated. is the batch program invocation environment. This
ICEAM2 (INV)
16
Installation Defaults
set of installation defaults is used at run time when DFSORT is invoked through batch programs, provided that an enabled time-of-day installation environment (ICETDx) is not activated. ICEAM3 (TSO) is the TSO direct invocation environment. This set of installation defaults is used at run time when DFSORT is invoked directly (that is, not through programs) by foreground TSO users, provided that an enabled time-of-day installation environment (ICETDx) is not activated. is the TSO program invocation environment. This set of installation defaults is used at run time when DFSORT is invoked through programs by foreground TSO users, provided that an enabled time-of-day installation environment (ICETDx) is not activated. is the first time-of-day installation environment. This set of installation defaults is used at run time when it is activated for the time-of-day of the run, provided it is enabled by the installation environment (ICEAMx) in effect. is the second time-of-day installation environment. This set of installation defaults is used at run time when it is activated for the time-of-day of the run, provided it is enabled by the installation environment (ICEAMx) in effect. is the third time-of-day installation environment. This set of installation defaults is used at run time when it is activated for the time-of-day of the run, provided it is enabled by the installation environment (ICEAMx) in effect. is the fourth time-of-day installation environment. This set of installation defaults is used at run time when it is activated for the time-of-day of the run, provided it is enabled by the installation environment (ICEAMx) in effect.
ICEAM4 (TSOINV)
ICETD1 (TD1)
ICETD2 (TD2)
ICETD3 (TD3)
ICETD4 (TD4)
The selected installation defaults can affect the way your applications run, and in many cases can be overridden by specifying the appropriate run-time parameters (see Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details). This document assumes that DFSORT is running with the installation defaults it was delivered with (that is, with the IBM-supplied installation defaults). You can use an ICETOOL job similar to the following one to display a report of the installation defaults to be used at run-time.
17
Installation Defaults
//DFRUN JOB A402,PROGRAMMER //LISTDEF EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=A //DFSMSG DD SYSOUT=A //SHOWDEF DD SYSOUT=A //TOOLIN DD * DEFAULTS LIST(SHOWDEF) /* Figure 3. Using ICETOOL to List Installation Defaults
See Chapter 6, Using ICETOOL, on page 501 and DEFAULTS Operator on page 526 for more information on using ICETOOL and the DEFAULTS operator. The functions of the available installation options are summarized below. z/OS DFSORT Installation and Customization contains complete descriptions of the available installation options, as well as planning considerations and general information about installing DFSORT. Step-by-step installation procedures are listed in the z/OS Program Directory. Parameter Function
INV|JCL|TSO|TSOINV|TD1|TD2|TD3|TD4 Specifies the invocation installation environment (ICEAMx) or time-of-day installation environment (ICETDx) for which this set of installation defaults is to be used. ENABLE day ABCODE ALTSEQ ARESALL ARESINV CFW CHALT CHECK Specifies whether ICETDx installation defaults are to be used if activated for this ICEAMx installation environment. Specifies the time ranges for each day of the week when this ICETDx installation environment is to be activated. Specifies the ABEND code used when DFSORT abends for a critical error. Specifies changes to the ALTSEQ translation table. Specifies the number of bytes reserved above 16MB virtual for system use. Specifies the number of bytes reserved above 16MB virtual for the invoking program when DFSORT is program invoked. Specifies whether DFSORT can use cache fast write when processing work data sets. Translates format CH as well as format AQ, or translates format AQ only. Specifies whether record count checking is suppressed for applications that use an E35 user exit routine without an output data set. Specifies whether DFSORT can use control interval access for VSAM data sets. Specifies the library for COBOL E15 and E35 routines. Specifies whether a SORTDIAG DD statement is to be simulated for DFSORT applications. Specifies the maximum amount of storage available to DFSORT for dynamic storage adjustment of Blockset sort applications.
18
Installation Defaults
DSPSIZE DYNALOC Specifies the maximum amount of data space to use for dataspace sorting. Specifies the default values for device name and number of work data sets to be dynamically allocated. These default values are used in conjunction with the DYNAUTO installation option and the DYNALLOC run-time option. Specifies whether work data sets are dynamically allocated automatically. Specifies the total default primary space allocation for all of the dynamically allocated work data sets when the file size is unknown. Specifies the name of a user-written Extended Function Support program to be called by DFSORT. Specifies whether the order of records that collate identically is preserved from input to output. Specifies the action taken if DFSORT encounters a critical error. Specifies whether DFSORT deletes its ESTAE recovery routine early or uses it for the entire run. Specifies whether DFSORT terminates or continues when it receives certain invalid return codes from E15 or E35 user exit routines. Specifies the maximum total amount of available storage to be used at any one time by all Hipersorting and memory object sorting applications. Specifies the maximum total amount of old storage to be used at any one time by all Hipersorting and memory object sorting applications. Specifies the minimum amount of available storage to be reserved for use by non-Hipersorting and non-memory object sorting applications. Specifies whether DFSORT treats run-time options FILSZ=n and SIZE=n as exact or estimated file sizes. Specifies the name that ICEGENER is to use to transfer control to the IEBGENER system utility. (ICEGENER is DFSORTs facility for IEBGENER jobs.) Specifies the action to be taken by ICEGENER for LRECL padding. Specifies the action to be taken by ICEGENER for LRECL truncation. Specifies the maximum amount of Hiperspace to use for Hipersorting. Specifies a percentage which represents the approximate amount of data compaction achieved by using the Improved Data Recording Capability feature of IBM tape devices that support compaction. Specifies whether DFSORT passes control to your sites ICEIEXIT routine. Specifies whether the checkpoint/restart facility is ignored if it is
Chapter 1. Introducing DFSORT
DYNAUTO DYNSPC
EXPMAX
EXPOLD
EXPRES
FSZEST GENER
IEXIT IGNCKPT
19
Installation Defaults
requested at run-time and the Blockset technique (which does not support the checkpoint/restart facility) can be used. IOMAXBF LIST LISTX LOCALE MAXLIM MINLIM MOSIZE MSGCON MSGDDN MSGPRT NOMSGDD NULLOFL NULLOUT ODMAXBF OUTREL OUTSEC OVERRGN OVFLO PAD PARMDDN RESALL RESET RESINV Specifies an upper limit to the amount of buffer space to be used for SORTIN, SORTINnn and SORTOUT data sets. Specifies whether DFSORT prints control statements. Specifies whether DFSORT prints control statements returned by an Extended Function Support program. Specifies whether locale processing is to be used and, if so, designates the active locale. Specifies an upper limit to the amount of main storage available to DFSORT below 16MB virtual. Specifies a lower limit to the amount of main storage available to DFSORT. Specifies the maximum size of a memory object to use for memory object sorting Specifies the class of program messages DFSORT writes to the master console. Specifies an alternate name for the message data set. Specifies the class of program messages DFSORT writes to the message data set. Specifies whether DFSORT terminates or continues when the message data set is required but is not available. Specifies the action to be taken by DFSORT when there are no data records for an OUTFIL data set. Specifies the action to be taken by DFSORT when there are no records for the SORTOUT data set. Specifies an upper limit to the amount of buffer space to be used for each OUTFIL data set. Specifies whether unused temporary output data set space is released. Specifies whether DFSORT uses automatic secondary allocation for output data sets that are temporary or new. Specifies the amount of main storage above the REGION value available to Blockset. Specifies the action to be taken by DFSORT when BI, FI, PD or ZD summary fields overflow. Specifies the action to be taken by DFSORT for LRECL padding. Specifies an alternate ddname for the DFSORT DFSPARM data set. Reserves storage for system and application use when SIZE/MAINSIZE=MAX is in effect. Specifies whether DFSORT processes a VSAM output data set defined with REUSE as a NEW or MOD data set. Reserves storage for programs invoking DFSORT when SIZE/MAINSIZE=MAX is in effect.
20
Installation Defaults
SDB Specifies whether DFSORT should use the system-determined optimum block size for output data sets when the block size is zero. Specifies whether DFSORT and ICETOOL should use the system-determined optimum block size for message and list data sets when the block size is zero. Specifies the maximum amount of main storage available to DFSORT. Specifies whether DFSORT produces SMF type-16 records. Specifies whether DFSORT uses the reformatted record length for the SORTOUT LRECL. Specifies whether DFSORT searches a system or private library for the modules used with a tape work data set sort or Conventional merge. Specifies the action to be taken by DFSORT when incomplete spanned records are detected. Specifies a user SVC number for DFSORT. Specifies whether DFSORT treats numeric 0 and +0 values as signed (that is, different) or unsigned (that is, the same). Specifies whether DFSORT passes control to your sites ICETEXIT routine. Specifies an upper limit to the total amount of main storage above and below 16MB virtual available to DFSORT when SIZE/MAINSIZE=MAX is in effect. Specifies the action to be taken by DFSORT for LRECL truncation. Specifies whether the sequence of output records is verified. Specifies whether virtual allocation of work data sets is accepted. Specifies whether DFSORT truncates long variable-length output records. Specifies whether DFSORT pads short variable-length compare fields. Specifies whether DFSORT continues processing if a short variable-length control field, compare field or summary field is found. Specifies the number of VSAM buffers DFSORT can use. Specifies whether DFSORT accepts an empty VSAM input data set. Specifies whether DFSORT allows a VSAM data set defined with REUSE to be sorted in-place. Specifies whether unused temporary work data set space is released. Specifies whether DFSORT uses automatic secondary allocation for temporary work data sets. Specifies the sliding or fixed century window.
SDBMSG
21
Installation Defaults
ZDPRINT Specifies whether DFSORT produces printable numbers from positive ZD fields that result from summarization.
Tables showing all the possible sources of specification and order of override for each option are shown in Appendix B, Specification/Override of DFSORT Options, on page 787.
22
24
23
If possible and appropriate, remove the obstacle that is causing Blockset not to be selected.
24
25
Defines the data set in which SYMNAMES statements and the symbol table are to be listed Defines the input data set for a sort or copy Defines the input data sets for a merge Defines the SORTOUT output data set for a sort, merge, or copy Defines an OUTFIL output data set for a sort, merge, or copy Defines intermediate storage data sets for a sort Contains DFSORT PARM options and program control statements Contains DFSORT program control statements Same as //SYSIN DD Specifies that all messages and program control statements be printed Defines the data set for checkpoint records Defines the data set for output from a system ABEND dump routine Same as //SYSUDUMP DD Same as //SYSUDUMP DD Defines the snap dump data set dynamically allocated by DFSORT Defines the data set containing exit routines (as specified in the MODS program control statement).
The following DD statements are necessary only for dynamic link-editing of exit routines //SYSPRINT DD //SYSUT1 DD //SYSLIN DD //SYSLMOD DD //SORTMODS DD
1
Defines the message data set for the linkage editor Defines the intermediate storage data set for the linkage editor Defines the data set for control information for the linkage editor Defines the data set for output from the linkage editor Defines the temporary partitioned data set for user exit routines from SYSIN.
These are the default ddnames with which DFSORT was delivered. SYSOUT and DFSPARM may have been changed during DFSORT installation. You can change all of the indicated ddnames at run time. For override information, see Appendix B, Specification/Override of DFSORT Options, on page 787.
26
//stepname EXEC
,
, PARM = options
, other parameters
If you use a cataloged procedure (discussed in detail below), specify PROC=SORT or PROC=SORTD. You can omit PROC= and simply specify SORT or SORTD. However, PROC= can remind you that a cataloged procedure is being used. If you do not use a cataloged procedure, use PGM= either with the actual name of the sort module (ICEMAN) or with one of its aliases: SORT, IERRCO00, or IGHRCO00. Be sure that the alias has not been changed at your site.
27
EXEC DD DD DD DD DD DD DD
00 10 20 30 40 50 60 70 80
Line 00 10
Explanation The stepname of the procedure is SORT. This EXEC statement initiates the program, which is named ICEMAN. The STEPLIB DD statement defines the data set containing the DFSORT program modules. If DFSORT was installed as part of the normal system link libraries, the STEPLIB DD statement is unnecessary. It is needed only if DFSORT resides in a separate link library which is not part of the link list. (Your installations system programmers can give you this information.) The STEPLIB DD statement shown assumes that the data set name represented by yyy is cataloged. The SORTLIB DD statement defines a private data set containing the modules needed for a sort using tape work files or a merge using the Conventional technique. The data set is cataloged, and the data set name represented by xxx was specified at installation time; it can be SYS1.SORTLIB. If the modules were installed in a system library and installation option SORTLIB=SYSTEM is used, the SORTLIB DD statement is unnecessary and is ignored unless dynamic link of user exits is used.
20
30 40 50
Defines an output data set for system use (messages). It is directed to system output class A. Defines SYSPRINT as a dummy data set because linkage editor diagnostic output is not required. Defines a data set for linkage editor output. Any system disk device is acceptable for the output. Space for 20 records with an average length of 3600 bytes is requested; this is the primary allocation. Space for 20 more records is requested if the primary space allocation is not sufficient; this is the secondary allocation, which is requested each time primary space is exhausted. The last value is space for a directory, which is required because SYSLMOD is a new partitioned data set. The SYSLIN data set is used by the program for linkage editor control statements. It is created on any system disk device, and it has space for 10 records with an average length of 80 bytes. If the primary space allocation is exhausted, additional space is requested in blocks large enough to contain 10 records. No directory space is necessary. The SYSUT1 DD statement defines a work data set for the linkage editor.
60
70/80
28
Line 00 10
Explanation The stepname of the SORTD procedure is SORT The STEPLIB DD statement defines the data set containing the DFSORT program modules. If DFSORT was installed as part of the normal system link libraries, the STEPLIB DD statement is unnecessary. It is needed only if DFSORT resides in a separate link library which is not part of the link list. (Your installations system programmers can give you this information.) The STEPLIB DD statement shown assumes that the data set name represented by yyy is cataloged. The SORTLIB DD statement defines a private data set that contains the modules needed for a sort using tape work files or a merge that uses the Conventional technique. The data set name of the program subroutine library, represented by xxx, is specified at installation time; it can be SYS1.SORTLIB. If the modules were installed in a system library and installation option SORTLIB=SYSTEM is used, then the SORTLIB DD statement is unnecessary and is ignored unless dynamic link edit of user exits is used.
20
30
29
30
, ,PARM= ABEND NOABEND ARESALL= n nK nM AVGRLEN=n BSAM CINV NOCINV COBEXIT= COB1 COB2 DSA=n DSPSIZE= MAX n DYNALLOC = d (,n) (d,n) OFF DYNSPC=n EFS= name NONE EQUALS NOEQUALS E15=COB E35=COB FILSZ= x Ex Ux HIPRMAX= OPTIMAL n p% LIST NOLIST LISTX NOLISTX LOCALE= name CURRENT NONE MSGDDN=ddname MOSIZE= MAX n %p MSGPRT= ALL CRITICAL NONE NULLOUT= RC0 RC4 RC16 ODMAXBF= n nK nM OUTREL NOOUTREL
31
OVFLO=
RC0 RC4 RC16 PAD= RC0 RC4 RC16 RESALL= n nK nM RESET NORESET SDB= LARGE YES INPUT NO SIZE= n nK nM MAX MAX-m MAX-mK MAX-mM SKIPREC=z SOLRF NOSOLRF SPANINC= RC0 RC4 RC16 STOPAFT=n SZERO NOSZERO TRUNC= RC0 RC4 RC16 VERIFY NOVERIFY VLLONG NOVLLONG VLSCMP NOVLSCMP VLSHRT NOVLSHRT VSAMEMT NOVSAMENT VSAMIO NOVSAMIO
32
ABEND or NOABEND
ABEND NOABEND
Temporarily overrides the ERET installation option, which specifies whether DFSORT abends or terminates with a return code of 16 if your sort, copy, or merge is unsuccessful. ABEND specifies that if your sort, copy, or merge is unsuccessful, DFSORT abends with a user completion code equal to the appropriate message number or with a user-defined number between 1 and 99, as set during installation with installation option ABCODE=n. When DEBUG ABEND is in effect, a user abend code of zero may be issued when a tape work data set sort or Conventional merge is unsuccessful. NOABEND specifies that an unsuccessful sort, copy, or merge terminates with a return code of 16. Note: RC16=ABE and NORC16 can be used instead of ABEND and NOABEND, respectively. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options ARESALL
ARESALL=
n nK nM
33
AVGRLEN=n
Specifies the average input record length in bytes for variable-length record sort applications. For more information, see the discussion of the AVGRLEN option in OPTION Control Statement on page 171. n specifies the average input record length. The value for n must be between 4 and 32767 and must include the 4 byte record descriptor word (RDW).
Note: L5=n can be used instead of AVGRLEN=n. Default: If AVGRLEN=n is not specified, DFSORT will use one-half of the maximum record length as the average record length. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. BSAM
BSAM
Temporarily bypasses the EXCP access method normally used for input and output data sets. BSAM is ignored for VSAM input and output data sets. Note that if Blockset is not selected and BSAM processing is used with concatenated SORTIN input and both null and non-null data sets are specified, all null data sets must precede all non-null data sets; otherwise, the results are unpredictable.
34
CINV NOCINV
Temporarily overrides the CINV installation option, which specifies whether DFSORT can use control interval access for VSAM data sets. For more information, see the explanation of the CINV option in OPTION Control Statement on page 171. CINV NOCINV directs DFSORT to use control interval access when possible for VSAM data sets. directs DFSORT not to use control interval access.
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. COBEXIT
COBEXIT=
COB1 COB2
Temporarily overrides the COBEXIT installation option, which specifies the library for COBOL E15 and E35 routines. COB1 specifies that COBOL E15 and E35 routines are run with the OS/VS COBOL run-time library or, in some cases, with no COBOL run-time library. COBEXIT=COB1 is obsolete, but is still available for compatibility reasons. Note that Language Environment is the only run-time library for COBOL supported by IBM service. COB2 specifies that COBOL E15 and E35 routines are run with either the VS COBOL II run-time library or the Language Environment run-time library. Note that Language Environment is the only run-time library for COBOL supported by IBM service.
35
DSA=n
Temporarily overrides the DSA installation option, which specifies the maximum amount of storage available to DFSORT for dynamic storage adjustment of a Blockset sort application when SIZE/MAINSIZE=MAX is in effect. For more information, see the discussion of the DSA option in OPTION Control Statement on page 171. n specifies that DFSORT can dynamically adjust storage to improve performance, subject to a limit of n MB. n must be n value between 0 and 2000. If n is less than or equal to the TMAXLIM value in effect, n is set to 0 to indicate that storage will not be dynamically adjusted.
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. DSPSIZE
DSPSIZE=
MAX n
Temporarily overrides the DSPSIZE installation option which specifies the maximum amount of data space to be used for dataspace sorting. For more information, see the discussion of the DSPSIZE option in OPTION Control Statement on page 171. MAX specifies that DFSORT dynamically determines the maximum amount of data space to be used for dataspace sorting. In this case, DFSORT bases its data space usage on the size of the file being sorted and the paging activity of the system. specifies the maximum amount, in megabytes, of data space to be used for dataspace sorting. n must be a value between 0 and 9999. The actual amount of data space used does not exceed n, but may be less depending on the size of the file being sorted and the paging activity of the system.
36
Specifies that DFSORT dynamically allocates needed work space. You do not need to calculate and use JCL to specify the amount of work space needed by the program. For more information, see the discussion of the DYNALLOC option in OPTION Control Statement on page 171 and Appendix A, Using Work Space, on page 777 d specifies the device name. You can specify any IBM disk or tape device supported by your operating system in the same way you would specify it in the JCL UNIT parameter. You can also specify a group name, such as DISK or SYSDA. -For best performance, specify an emulated 33909 device (such as a RAMAC-) or another highspeed IBM disk device, and avoid specifying- a tape, virtual (VIO) or real 33909 device. n specifies the maximum number of requested work data sets. If you specify more than 255, a maximum of 255 data sets is used. If you specify 1 and the Blockset technique is selected, a maximum of 2 data sets is used. If you specify more than 32 and the Blockset technique is not selected, a maximum of 32 data sets is used. Note: For optimum allocation of resources such as virtual storage, avoid specifying a large number of work data sets unnecessarily. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. DYNALLOC=OFF
DYNALLOC=OFF
Directs DFSORT not to allocate intermediate workspace dynamically. It overrides installation option DYNAUTO=YES or the DYNALLOC parameter
Chapter 2. Invoking DFSORT with Job Control Language
37
DYNSPC=n
Temporarily overrides the DYNSPC installation option, which specifies the total default primary space allocation for all of the dynamically allocated work data sets when the input file size is unknown. That is, when DFSORT cannot determine the input file size for a sort application and the number of records is not supplied by a FILSZ or SIZE value. For more information, see the discussion of the DYNSPC option in OPTION Control Statement on page 171. n specifies the total default primary space, in megabytes, to be allocated for all dynamically allocated work data sets (n is not the primary space for each data set). n must be a value between 1 and 65535. Do not specify a value which exceeds the available disk space, because this causes dynamic allocation to fail for sort applications that use this value. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. EFS
EFS=
name NONE
Temporarily overrides the EFS installation option, which specifies whether DFSORT passes control to an EFS program. See Chapter 8, Using Extended Function Support, on page 693 for more information on EFS. name NONE means no call will be made to the EFS program. Note: If you use locale processing for SORT, MERGE, INCLUDE, or OMIT fields, you must not use an EFS program. DFSORTs locale processing specifies the name of the EFS program that will be called to interface with DFSORT.
38
EQUALS NOEQUALS
Temporarily overrides the EQUALS installation option, which specifies whether the original sequence of records that collate identically for a sort or a merge should be preserved from input to output. For more information, see the discussion of the EQUALS and NOEQUALS options in OPTION Control Statement on page 171. EQUALS NOEQUALS specifies that the original sequence must be preserved. specifies that the original sequence need not be preserved.
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. E15=COB
E15=COB
Specifies that your E15 routine is written in COBOL and temporarily overrides the MODS statement for E15. If you specify E15=COB but do not identify an E15 module with a MODS statement, the E15=COB is ignored. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. E35=COB
E35=COB
Specifies that your E35 routine is written in COBOL and temporarily overrides the MODS statement for E35. If you specify E35=COB but do not identify an E35 module with a MODS statement, the E35=COB is ignored.
Chapter 2. Invoking DFSORT with Job Control Language
39
FILSZ=
x Ex Ux
Specifies either the exact number of records to be sorted or merged, or an estimate of the number of records to be sorted. This record count is used by DFSORT for two purposes: 1. To check that the actual number of records sorted or merged is equal to the exact number of records expected. FILSZ=x causes this check to be performed and results in termination with message ICE047A if the check fails. 2. To determine the input file size for a sort application. DFSORT performs calculations based on the user supplied record count and other parameters (such as AVGRLEN) to estimate the total number of bytes to be sorted. This value is important for sort applications, since it is used for several internal optimizations as well as for dynamic work data set allocation (see OPTION DYNALLOC). If no input record count (or only an estimate) is supplied for the sort application, DFSORT attempts to automatically compute the file size to be used for the optimizations and allocations. The type of FILSZ value specified (x, Ex, Ux, or none) controls the way DFSORT performs the above two functions, and can have a significant effect on performance and work data set allocation. See Specify Input/Output Data Set Characteristics Accurately on page 729 and Allocation of Work Data Sets on page 779 for more information on file size considerations. x specifies the exact number of records to be sorted or merged. This value is always used for both the record check and file size calculations. FILSZ=x can be used to force DFSORT to perform file size calculations based on x, and to cause DFSORT to terminate the sort or merge application if x is not exact. If installation option FSZEST=NO is in effect and FILSZ=x is specified, DFSORT terminates if the actual number of records is different from the specified value (x), the actual number of records placed in the IN field of message ICE047A (or message ICE054I) before termination. However, if installation option FSZEST=YES is in effect, DFSORT treats FILSZ=x like FILSZ=Ex; it does not terminate when the actual number of records does not equal x. The specified value (x) must take into account the number of records in the input data sets, records to be inserted or deleted by exit E15 or E32, and records to be deleted by the INCLUDE/OMIT statement, SKIPREC, and STOPAFT. x must be changed whenever the number of records to be sorted or merged changes in any way.
40
n includes records: In input data sets Inserted/deleted by E15 Yes Yes Yes Yes Yes Yes
41
In any way
Significantly
Significantly
Hipersorting and Hipersorting and None DYNALLOC not DYNALLOC not used used
Note: Using the FILSZ parameter to supply inaccurate information to DFSORT can negatively affect DFSORTs performance, and when work space is dynamically allocated, can result in wasted disk space or termination with message ICE083A or ICE046A. Therefore, it is important to update the record count value whenever the number of records to be sorted changes significantly. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. HIPRMAX
HIPRMAX=
OPTIMAL n p%
Temporarily overrides the HIPRMAX installation option, which specifies the maximum amount of Hiperspace to be used for Hipersorting. For more information, see the discussion of the HIPRMAX option in OPTION Control Statement on page 171. OPTIMAL n specifies that DFSORT determines dynamically the maximum amount of Hiperspace to be used for Hipersorting. specifies that DFSORT determines dynamically the maximum amount of Hiperspace to be used for Hipersorting, subject to a limit of nMB. n must be a value between 0 and 32767. If n is 0, Hipersorting is not used. specifies that DFSORT determines dynamically the maximum amount of hiperspace to be used for Hipersorting, subject to a limit of p percent of an appropriate portion of central storage. p must be a value between 0 and 100. If p is 0, Hipersorting is
%p
42
LIST NOLIST
Temporarily overrides the LIST installation option, which specifies whether DFSORT program control statements should be written to the message data set. See z/OS DFSORT Messages, Codes and Diagnosis Guide for full details on use of the message data set. LIST NOLIST specifies that all DFSORT control statements are printed on the message data set. specifies that DFSORT control statements are not printed.
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. LISTX or NOLISTX
LISTX NOLISTX
Temporarily overrides the LISTX installation option, which specifies whether DFSORT writes to the message data set the program control statements returned by an EFS program. See z/OS DFSORT Messages, Codes and Diagnosis Guide for full details on use of the message data set. LISTX NOLISTX specifies that control statements returned by an EFS program are printed to the message data set. specifies that control statements returned by an EFS program are not printed to the message data set.
Notes: 1. If EFS=NONE is in effect after final override rules have been applied, NOLISTX will be set in effect. 2. LISTX and NOLISTX can be used independently of LIST and NOLIST. 3. For more information on printing EFS control statements, see z/OS DFSORT Messages, Codes and Diagnosis Guide.
43
LOCALE=
Temporarily overrides the LOCALE installation option, which specifies whether locale processing is to be used and, if so, designates the active locale. For more information, see the discussion of the LOCALE option in OPTION Control Statement on page 171. name specifies that locale processing is to be used and designates the name of the locale to be made active during DFSORT processing. The locales are designated using a descriptive name. For example, to set the active locale to represent the French language and the cultural conventions of Canada, specify LOCALE=FR_CA. You can specify up to 32 characters for the descriptive locale name. The locale names themselves are not case-sensitive. See Using Locales for complete locale naming conventions. You can use IBM-supplied and user-defined locales. The state of the active locale prior to DFSORT being entered will be restored on DFSORTs completion. CURRENT specifies that locale processing is to be used, and the current locale active when DFSORT is entered will remain the active locale during DFSORT processing. specifies that locale processing is not to be used. DFSORT will use the binary encoding of the code page defined for your data for collating and comparing.
NONE
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. MOSIZE
MOSIZE=
MAX n %p
44
%p
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. MSGDDN
MSGDDN=ddname
Temporarily overrides the MSGDDN installation option, which specifies an alternate ddname for the message data set. For more information, see the discussion of the MSGDDN option in OPTION Control Statement on page 171. The ddname can be any 1- through 8-character name, but must be unique within the job step; do not use a name that is used by DFSORT (for example, SORTIN). If the ddname specified is not available at run-time, SYSOUT is used instead. For details on using the message data set, see z/OS DFSORT Messages, Codes and Diagnosis Guide. Note: MSGDD=ddname can be used instead of MSGDDN=ddname. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. MSGPRT
45
Temporarily overrides the MSGPRT installation option, which specifies the class of messages to be written to the message data set. See z/OS DFSORT Messages, Codes and Diagnosis Guide for full details on use of the message data set. ALL specifies that all messages except diagnostic messages ICE800I to ICE999I are printed on the message data set. Control statements are printed only if LIST is in effect.
CRITICAL specifies that only critical messages are printed on the message data set. Control statements are printed only if LIST is in effect. NONE specifies that no messages or control statements are printed. Note: The forms FLAG(I)|FLAG(U)|NOFLAG, and MSG={NO|NOF|AB|AP|AC|CB|CC|CP|PC|SC|SP} are also accepted. The following table lists the equivalent MSGPRT/MSGCON specifications for these alternate forms:
Option NO NOF AB AP AC CB CC CP PC SC SP NOFLAG FLAG(I) FLAG(U) MSGPRT NONE NONE ALL ALL NONE CRITICAL NONE CRITICAL ALL ALL CRITICAL NONE ALL CRITICAL MSGCON NONE NONE ALL CRITICAL ALL CRITICAL CRITICAL CRITICAL ALL CRITICAL ALL CRITICAL CRITICAL CRITICAL
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. NULLOUT
46
Temporarily overrides the NULLOUT installation option, which specifies the action to be taken by DFSORT when there are no records for the SORTOUT data set. For more information, see the discussion of the NULLOUT option in OPTION Control Statement on page 171. RC0 specifies that DFSORT should issue message ICE173I, set a return code of 0, and continue processing when there are no records for the SORTOUT data set. specifies that DFSORT should issue message ICE173I, set a return code of 4, and continue processing when there are no records for the SORTOUT data set. specifies that DFSORT should issue message ICE206A, terminate, and give a return code of 16 when there are no records for the SORTOUT data set.
RC4
RC16
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. ODMAXBF
ODMAXBF=
n nK nM
Temporarily overrides the ODMAXBF installation option, which specifies the maximum buffer space DFSORT can use for each OUTFIL data set. For more information, see the discussion of the ODMAXBF option in OPTION Control Statement on page 171. n specifies that a maximum of n bytes of buffer space is to be used for each OUTFIL data set. If you specify less than 262144, 262144 is used. If you specify more than 16777216, 16777216 is used. Limit: 8 digits nK specifies that a maximum of n times 1024 bytes of buffer space is to be used for each OUTFIL data set. If you specify less than 256K, 256K is used. If you specify more than 16384K, 16384K is used. Limit: 5 digits nM specifies that a maximum of n times 1048576 bytes of buffer space is to be used for each OUTFIL data set. If you specify 0M, 256K is used. If you specify more than 16M, 16M is used.
Chapter 2. Invoking DFSORT with Job Control Language
47
OUTREL NOOUTREL
Temporarily overrides the OUTREL installation option, which specifies whether unused temporary output data set space is to be released. OUTREL specifies that unused temporary output data set space is released. NOOUTREL specifies that unused temporary output data set space is not released. Note: RLSOUT and NORLSOUT can be used instead of OUTREL and NOOUTREL, respectively. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. OVFLO
OVFLO=
Temporarily overrides the OVFLO installation option, which specifies the action to be taken by DFSORT when BI, FI, PD or ZD summary fields overflow. For more information, see the discussion of the OVFLO option in OPTION Control Statement on page 171. RC0 specifies that DFSORT should issue message ICE152I (once), set a return code of 0 and continue processing when summary fields overflow. RC4 specifies that DFSORT should issue message ICE152I (once), set a return code of 4 and continue processing when summary fields overflow. RC16 specifies that DFSORT should issue message ICE195A, terminate and give a return code of 16 when summary fields overflow.
48
PAD=
Temporarily overrides the PAD installation option, which specifies the action to be taken by DFSORT when the SORTOUT LRECL is larger than the SORTIN/SORTINnn LRECL, for the cases where DFSORT allows LRECL padding. For more information, see the discussion of the PAD option in OPTION Control Statement on page 171. RC0 specifies that DFSORT should issue message ICE171I (once), set a return code of 0 and continue processing when the SORTOUT LRECL is larger than the SORTIN/SORTINnn LRECL. RC4 specifies that DFSORT should issue message ICE171I, set a return code of 4 and continue processing when the SORTOUT LRECL is larger than the SORTIN/SORTINnn LRECL. RC16 specifies that DFSORT should issue message ICE196A, terminate and give a return code of 16 when the SORTOUT LRECL is larger than the SORTIN/SORTINnn LRECL. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. RESALL
RESALL=
n nK nM
Temporarily overrides the RESALL installation option, which specifies the number of bytes to be reserved in a REGION for system use when SIZE/MAINSIZE=MAX is in effect. For more information, see the discussion of the RESALL option in OPTION Control Statement on page 171. n specifies that n bytes of storage are to be reserved. If you specify less than 4096, 4096 is used. Limit: 8 digits.
49
RESET NORESET
Temporarily overrides the RESET installation option, which specifies whether DFSORT should process a VSAM output data set defined with REUSE as a NEW or MOD data set. RESET specifies that DFSORT processes a VSAM output data set defined with REUSE as a NEW data set. The high-used RBA is reset to zero and the output data set is effectively treated as an initially empty cluster. specifies that DFSORT processes a VSAM output data set defined with REUSE as a MOD data set. The high-used RBA is not reset and the output data set is effectively treated as an initially non-empty cluster.
NORESET
Note: A VSAM output data set defined without REUSE is processed as a MOD data set. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. SDB
SDB=
50
SIZE=
Temporarily overrides the SIZE installation option, which specifies the amount of main storage available to DFSORT. For more information, see the discussion of the MAINSIZE option in OPTION Control Statement on page 171. n specifies that n bytes of storage are to be allocated. If you specify more than 2097152000, 2097152000 is used. Limit: 10 digits. nK specifies that n times 1024 bytes of storage are to be allocated. If you specify more than 2048000K, 2048000K is used.
Chapter 2. Invoking DFSORT with Job Control Language
51
SKIPREC=z
Specifies the number of records (z) you want to skip (delete) before starting to sort or copy the input data set. SKIPREC is typically used to bypass records
52
SOLRF NOSOLRF
Temporarily overrides the SOLRF installation option, which specifies whether DFSORT should set the SORTOUT LRECL to the reformatted record length when the SORTOUT LRECL is unknown. For more information, see the discussion of the SOLRF and NOSOLRF options in OPTION Control Statement on page 171. SOLRF specifies that DFSORT should use the reformatted record length for the SORTOUT LRECL when the SORTOUT LRECL is not specified or available. NOSOLRF specifies that DFSORT should not use the reformatted record length for the SORTOUT LRECL. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. SPANINC
SPANINC=
Temporarily overrides the SPANINC installation option, which specifies the action to be taken by DFSORT when one or more incomplete spanned records are detected in a variable spanned input data set. For more information, see the discussion of the SPANINC option in OPTION Control Statement on page 171.
53
STOPAFT=n
Specifies the maximum number of records you want accepted for sorting or copying (that is, read from SORTIN or inserted by E15 and not deleted by SKIPREC, E15, or an INCLUDE/OMIT statement). For more information, see the discussion of the STOPAFT option in OPTION Control Statement on page 171. n specifies the maximum number of records to be accepted. Limit: 28 digits (15 significant digits). Note: If you specify (1) FILSZ=x in the EXEC PARM, or (2) SIZE=x or FILSZ=x on the OPTION or SORT statement, and the number of records accepted for processing does not equal x, DFSORT issues an error message and terminates unless installation option FSZEST=YES was specified. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. SZERO or NOSZERO
SZERO NOSZERO
Temporarily overrides the SZERO installation option, which specifies+ whether DFSORT should treat numeric 0 and 0 values as signed (that is, different) or unsigned (that is, the same) for collation, comparisons, editing, conversions, minimums and maximums. For more information, see the discussion of the SZERO and NOSZERO options in OPTION Control Statement on page 171.
54
TRUNC=
Temporarily overrides the TRUNC installation option, which specifies the action to be taken by DFSORT when the SORTOUT LRECL is smaller than the SORTIN/SORTINnn LRECL, for the cases where DFSORT allows LRECL truncation. For more information, see the discussion of the TRUNC option in OPTION Control Statement on page 171. RC0 specifies that DFSORT should issue message ICE171I, set a return code of 0 and continue processing when the SORTOUT LRECL is smaller than the SORTIN/SORTINnn LRECL. RC4 specifies that DFSORT should issue message ICE171I, set a return code of 4 and continue processing when the SORTOUT LRECL is smaller than the SORTIN/SORTINnn LRECL. RC16 specifies that DFSORT should issue message ICE196A, terminate and give a return code of 16 when the SORTOUT LRECL is smaller than the SORTIN/SORTINnn LRECL. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. VERIFY or NOVERIFY
VERIFY NOVERIFY
Temporarily overrides the VERIFY installation option, which specifies whether sequence checking of the final output records must be performed.
55
VLLONG NOVLLONG
Temporarily overrides the VLLONG installation option, which specifies whether DFSORT is to truncate long variable-length output records. For more information, see the discussion of the VLLONG and NOVLLONG options in OPTION Control Statement on page 171. VLLONG specifies that DFSORT truncates long variable-length output records to the LRECL of the SORTOUT or OUTFIL data set. NOVLLONG specifies that DFSORT terminates if a long variable-length output record is found. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. VLSCMP or NOVLSCMP
VLSCMP NOVLSCMP
Temporarily overrides the VLSCMP installation option, which specifies whether DFSORT is to pad short variable-length INCLUDE/OMIT compare fields with binary zeroes. For more information, see the discussion of the VLSCMP and NOVLSCMP options in OPTION Control Statement on page 171.
56
VLSHRT NOVLSHRT
Temporarily overrides the VLSHRT installation option, which specifies whether DFSORT is to continue processing if a short variable-length SORT/MERGE control field, INCLUDE/OMIT compare field, or SUM summary field is found. For more information, see the discussion of the VLSHRT and NOVLSHRT options in OPTION Control Statement on page 171. VLSHRT specifies that DFSORT continues processing if a short control field or compare field is found. NOVLSHRT specifies that DFSORT terminates if a short control field or compare field is found. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. VSAMEMT or NVSAMEMT
VSAMEMT NVSAMEMT
Temporarily overrides the VSAMEMT installation option, which specifies whether DFSORT should accept an empty VSAM input data set. VSAMEMT specifies that DFSORT accepts an empty VSAM input data set and processes it as having zero records.
NVSAMEMT specifies that DFSORT terminates if an empty VSAM input data set is found. Note: VSAMEMT=YES can be used instead of VSAMEMT. VSAMEMT=NO can be used instead of NVSAMEMT.
Chapter 2. Invoking DFSORT with Job Control Language
57
VSAMIO NOVSAMIO
Temporarily overrides the VSAMIO installation option, which specifies whether DFSORT should allow a VSAM data set defined with REUSE to be sorted in-place. VSAMIO specifies that DFSORT can use the same VSAM data set for input and output: when all of the following conditions are met v The application is a sort. v RESET is in effect. v The VSAM data set was defined with REUSE. These conditions ensure that the VSAM data set is processed as NEW for output and will contain the sorted input records; that is it will be sorted in-place. DFSORT terminates if the same VSAM data set is specified for input and output, and any of the above conditions are not met. NOVSAMIO specifies that DFSORT terminates if the same VSAM data set is specified for input and output.
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. WRKREL or NOWRKREL
WRKREL NOWRKREL
Temporarily overrides the WRKREL installation option, which specifies whether unused temporary SORTWKdd data set space will be released. WRKREL specifies that unused space is released. NOWRKREL specifies that unused space is not released.
58
WRKSEC NOWRKSEC
Temporarily overrides the WRKSEC installation option, which specifies whether DFSORT uses automatic secondary allocation for temporary JCL SORTWKdd data sets. WRKSEC specifies that automatic secondary allocation for temporary JCL SORTWKdd data sets is used and that 25 percent of the primary allocation will be used as the secondary allocation. NOWRKSEC specifies that automatic secondary allocation for temporary JCL SORTWKdd data sets is not used. Note: SECOND=OFF and SEC=0 can be used instead of NOWRKSEC. SECOND=ON and SEC=n (n greater than 0) can be used instead of WRKSEC. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. Y2PAST
Y2PAST=
s f
59
Note: CENTWIN=value can be used instead of Y2PAST=value. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. ZDPRINT or NZDPRINT
ZDPRINT NZDPRINT
Temporarily overrides the ZDPRINT installation option, which specifies whether positive zoned-decimal (ZD) fields resulting from summing must be converted to printable numbers. For more information, see the discussion of the ZDPRINT and NZDPRINT options in OPTION Control Statement on page 171. ZDPRINT means convert positive ZD summation results to printable numbers. NZDPRINT means do not convert positive ZD summation results to printable numbers. Note: ZDPRINT=YES can be used instead of ZDPRINT. ZDPRINT=NO can be used instead of NZDPRINT. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787.
60
Using DD Statements
A DFSORT job always requires DD statements after the EXEC statement. DD: statements fall into two categories v System DD statements (discussed in detail in System DD Statements on page 64)
61
Using DD Statements
v Program DD statements (discussed in detail in Program DD Statements on page 66). System DD statements, and some program DD statements, are usually supplied automatically when you use a cataloged procedure. Others you must always supply yourself. The DD statement parameters, the conditions under which they are required, and the default values, are summarized in Table 6. The subparameters of the DCB parameter (a DD statement parameter) are described similarly in Table 7 on page 63. Notes: 1. Performance is enhanced if the LRECL subparameter of the DCB is accurately specified for variable-length records. The maximum input record length you can specify for your particular configuration is given in Data Set Notes and Limitations on page 13. 2. When using DFSORT applications, FREE=CLOSE cannot be used on any DD statements except DFSPARM.
Table 6. DD Statement Parameters Used by DFSORT Parameter {AMP | BUFSP} When Required When password-protected VSAM data sets are used and the password is supplied through E18, E38, or E39. Required when 7-track tape is used; for input on tape without standard labels; and when the default values are not applicable. When the default value is not applicable. Parameter Values Default Value
Minimum buffer pool value None. given when creating the data set.
DCB
Specifies information used (See separate to fill the data control block subparameters in Table 7 on (DCB) associated with the page 63.) data set. Indicates the status and disposition of the data set. The system assumes (NEW, DELETE). The system assigns a unique name.
Specifies the fully qualified When the DD statement defines a labeled input data or temporary name of the set (for example, SORTIN), data set. or when the data set being created is to be kept or cataloged (for example, SORTOUT), or passed to another step. When the default value is not applicable. When the DD statement defines a new data set on disk. When the input data set is neither cataloged nor passed or when the data set is being created. Specifies information about labeling and retention for the data set.
LABEL
SPACE
Specifies the amount of None. space needed to contain the data set. Specifies (symbolically or actually) the type and quantity of I/O units required by the data set. None.
UNIT
62
Using DD Statements
Table 6. DD Statement Parameters Used by DFSORT (continued) Parameter VOLUME or VOL When Required When the input data set is neither cataloged nor passed, for multireel input or when the output data set is on disk and is to be kept or cataloged. Parameter Values Specifies information used to identify the volume or volumes occupied by the data set. Default Value None.
Table 7. DCB Subparameters Used by DFSORT Subparameter BUFOFF Condition When Required When processing data in ASCII format. Subparameter Values Specifies the length of the buffer offset or specifies that the buffer offset is the block length indicator. Specifies the density at which the tape was recorded. Specifies that the tape processed is in ASCII format. Specifies whether data set is compacted. System default option. 800 bpi Default Value
DEN
When the data set is located on a 7-track tape unit. When processing data in ASCII format. When the data set is located on a tape device with IDRC and system IDRC is not used. When the DCB parameter is required and the default value is not suitable except on SORTWKdd statements.
OPTCD
TRTCH
BLKSIZE 1, 2
Specifies the maximum v For old data sets, the length (in bytes) of the value in the data set physical records in the data label. set. v For new output data sets, appropriate values based on the input data set or RECORD statement values. Specifies the maximum length (in bytes) of the logical records in the data set. Unless SDB=NO is in effect, Blockset uses the system-determined optimum block size when the output data set block size is zero. Applications which require a specific output data set block size should be changed to specify that block size EXPLICITY. v No default if input on unlabeled tape or BLP or NSL specified.
LRECL 2, 3
RECFM
1. See SORTIN DD Statement on page 68 and SORTINnn DD Statement on page 70. 2. This is the only subparameter allowed for DD * data sets. 3. For padding and truncating fixed-length records, see Data Set Notes and Limitations on page 13. Chapter 2. Invoking DFSORT with Job Control Language
63
Using DD Statements
Duplicate Ddnames
If you specify a particular ddname (such as SORTIN) more than once within the same step, DFSORT uses the first ddname and ignores subsequent duplicates. Processing continues normally. In addition, SORTIN0, SORTIN1...SORTIN9 can be specified instead of SORTIN00, SORTIN01...SORTIN09, respectively. If you specify both SORTINn and SORTIN0n in the same job step, DFSORT treats them as duplicates, and ignores each usage after the first. For example, SORTIN2 and SORTIN02 are treated as duplicates and only SORTIN2 is used. Note: For a Conventional merge, SORTINn will not be recognized because of the existing restriction which allows only SORTIN01, SORTIN02...SORTIN16. Duplicates of these accepted ddnames will be ignored. Duplicate OUTFIL ddnames are ignored at the OUTFIL statement level as explained in OUTFIL Statements Notes on page 354.
System DD Statements
If you choose not to use the SORT or SORTD cataloged procedures to invoke DFSORT, you might need to supply system DD statements in your input job stream (See also the following section for DD statements dedicated to DFSORT, such as SORTIN). The DD statements contained in the cataloged procedure (or provided by you) are: //JOBLIB DD //STEPLIB DD //SYSIN DD Defines your program link library if it is not already known to the system. Same as //JOBLIB DD. Contains DFSORT control statements, comment statements, blank statements and remarks when DFSORT is invoked with JCL rather than by another program. It can also contain user exit routines, in object deck format, to be link-edited by DFSORT.
64
Using DD Statements
v If you use DFSPARM, then SYSIN is not necessary unless your job requires link-editing. v The SYSIN data set usually resides in the input stream; however, it can be defined as a sequential data set or as a member of a partitioned data set. v The data set must be defined with a RECFM of F or FB. The LRECL can be 80, or more (when valid). If the LRECL is greater than 80, DFSORT will use the first 80 bytes of each record. If user exit routines are in SYSIN, the LRECL must be 80. v DFSORT supports concatenated SYSIN data sets to the extent that the system supports like concatenated data sets for BSAM. Refer to z/OS DFSMS Using Data Sets for further information about like concatenated data sets. Note: The OPTION statement keywords EFS, LIST, NOLIST, LISTX, NOLISTX, LOCALE, MSGPRT, MSGDDN, SMF, SORTDD, SORTIN, and SORTOUT are used only when they are passed by an extended parameter list or when in the DFSPARM data set. If they are specified on an OPTION statement read from the SYSIN or SORTCNTL data set, the keyword is recognized, but the parameters are ignored. If you use the DFSPARM DD statement instead, you can specify both EXEC PARM options and DFSORT control statements in a single source data set that overrides all other sources. See DFSPARM DD Statement on page 77. If user exit routines are in SYSIN, make sure that: v The LRECL of SYSIN is 80. v The END statement is the last control statement. v The user exit routines are arranged in numeric order (for example, E11 before E15). v The user exit routines are supplied immediately after the END control statement. v Nothing follows the last object deck in SYSIN. v A SORTMODS DD statement is included. If DFSORT is program invoked, and you supply the DFSORT control statements through the 24-bit or extended parameter list, SORTCNTL, or DFSPARM, SYSIN remains the source of user exit routines placed in the system input stream. //SYSOUT DD Identifies the DFSORT message data set. The default ddname is SYSOUT, but you can specify an alternate ddname for the message data set using the MSGDDN installation or run-time option.
Chapter 2. Invoking DFSORT with Job Control Language
65
Using DD Statements
Always supply a DD statement for the message data set if a catalogued procedure is not used. (If you are invoking DFSORT from a COBOL program and are using the ddname SYSOUT for the message data set, the use of DISPLAY in your COBOL program can produce uncertain printing results.) DFSORT uses RECFM=FBA, LRECL=121, and the specified BLKSIZE for the message data set. If the BLKSIZE you specify is not a multiple of 121, DFSORT uses BLKSIZE=121. If you do not specify the BLKSIZE, DFSORT selects the block size as directed by the SDBMSG installation option (see z/OS DFSORT Installation and Customization). If you use a temporary or permanent message data set, it is best to specify a disposition of MOD to ensure you see all messages and control statements in the message data set. //SYSUDUMP DD //SYSMDUMP DD //SYSABEND DD Defines the data set for output from a system ABEND dump routine. Same as //SYSUDUMP DD. Same as //SYSUDUMP DD.
If you are using the supplied SORT cataloged procedure, the DD statements below are automatically supplied. If you are not using the SORT cataloged procedure and you are using the linkage editor, you must supply the following: DD statements //SYSPRINT DD //SYSUT1 DD //SYSLIN DD //SYSLMOD DD Contains messages from the linkage editor. Defines the intermediate storage data set for the linkage editor. Defines a data set for control information for the linkage editor. Defines a data set for output from the linkage editor.
Note: If you do not include user routines, or if you include user routines that do not require link-editing, you can use the supplied SORTD cataloged procedure. If you include user routines that require link-editing, you can use the SORT cataloged procedure.
Program DD Statements
Even if you use the SORT or SORTD cataloged procedure to invoke DFSORT, you might need to supply additional dedicated DD statements. The following list summarizes each of these statements, and a more detailed explanation of each one follows. //SORTLIB DD //SYMNAMES DD Defines the data set that contains special load modules for DFSORT. Can usually be omitted. Defines the SYMNAMES data set containing statements to be used for symbol processing. Required only if symbol processing is to be performed.
66
Using DD Statements
//SYMNOUT DD Defines the data set in which SYMNAMES statements and the symbol table are to be listed. Optional if SYMNAMES DD is specified. Otherwise ignored. Defines the input data set for a sorting or copying application. Will not be used for a merging application. Defines the input data sets for a merging application. Will not be used for a sorting or copying application. Defines intermediate storage data sets. Usually needed for a sorting application unless dynamic allocation is requested. Will not be used for a copying or merging application. Defines the SORTOUT output data set for a sorting, merging, or copying application. Defines an OUTFIL output data set for a sorting, merging, or copying application. Defines the data set used to store the information that the system needs to restart the sort from the last checkpoint. This is only needed if you are using the checkpoint facility. Defines the data set from which additional or changed DFSORT control statements can be read when DFSORT is program-invoked. Defines the data set from which both additional or changed DFSORT program control statements and EXEC statement PARM options can be read when DFSORT is directly invoked or program invoked. Defines the data set used for a VIO SORTWKdd allocation by DFSORT if it is dynamically reallocated; SORTDKdd must never be specified in the job stream. Specifies that all messages and control statements are printed. Used primarily for diagnostics and debugging. Defines the snap dump data set dynamically allocated by DFSORT. SORTSNAP must never be specified in the job stream. Defines a temporary partitioned data set. This temporary data set must be large enough to contain all your user exit routines that appear in SYSIN for a given application. If none of your routines appear in SYSIN, this statement is not required. If your routines are in libraries, you must include DD statements defining the libraries.
//SORTIN DD
//SORTINnn DD
//SORTWKdd DD
//SORTCNTL DD
//DFSPARM DD
//SORTDKdd DD
//SORTDIAG DD
//SORTSNAP DD
//SORTMODS DD
67
Using DD Statements
DFSORT temporarily transfers the user exit routines in SYSIN to the data set defined by this DD statement before they are link-edited for processing.
SORTLIB DD Statement
The SORTLIB DD statement can usually be omitted. This statement describes the data set that contains special DFSORT load modules. When Required: If installation option SORTLIB=PRIVATE is in effect or dynamic link edit of user exits is specified v For sort applications using tape work data sets v For merge applications for which Blockset cannot be used (see message ICE800I). The SORTLIB installation option determines whether DFSORT searches a system library or private library for the load modules required by tape work data set sorts and Conventional merges. Example 1 SORTLIB DD Statement:
//SORTLIB DD DSNAME=USORTLIB,DISP=SHR
This example shows DD statement parameters that define a previously cataloged input data set: DSNAME causes the system to search the catalog for a data set with the name USORTLIB. When the data set is found, it is associated with the ddname SORTLIB. The control program obtains the unit assignment and volume serial number from the catalog and, if the volume is not already mounted, writes a mounting message to the operator. indicates that the data set existed before this job step, that it should be kept after this job step, and that it can be used concurrently by several jobs (SHR). None of the jobs should change the data set in any way.
DISP
For information on the parameters used in the SORTLIB DD statement, the conditions under which they are required, and the default values assumed if a parameter is not included, see Table 6 on page 62. The subparameters of the DCB parameter are described in the same detail in Table 7 on page 63. For more detailed information, see z/OS MVS JCL Reference and z/OS MVS JCL Users Guide
SORTIN DD Statement
The SORTIN DD statement describes the characteristics of the data set in which the records to be sorted or copied reside and also indicates its location. When Required: A SORTIN DD statement is required for all sort or copy applications, unless you provide an E15 user exit that supplies all input to DFSORT and include a RECORD statement in the program control statements. The SORTIN DD statement is ignored if your program invokes DFSORT and passes the address of your E15 user exit in the parameter list. Data Set Characteristics: DFSORT accepts empty and null non-VSAM data sets, and DUMMY data sets, for sorting and copying (be sure to supply RECFM, LRECL
68
Using DD Statements
and BLKSIZE). DFSORT also accepts empty VSAM data sets for sorting and copying provided VSAMEMT is in effect. For non-VSAM data sets, DFSORT examines the DS1LSTAR field in the format-1 DSCB to determine whether the data set is empty or null. If DS1LSTAR is zero, DFSORT treats the data set as empty or null. If the data set is a null multivolume data set and the DS1IND80 flag is off in the format-1 DSCB of the first volume of the multivolume data set, DFSORT opens the data set for output to force an end of file (EOF) mark before using the data set for input. Note that a null data set is one that has been newly created, but never successfully closed. Null data sets cannot be processed successfully for a tape work data set sort. The System Code field in the data set label in the disk Volume Table of Contents (DSCB in the VTOC) indicates a data set created by the VSE operating system if it contains the letters DOS or VSE within it. Such data sets are never treated as null; however, they may be empty. DFSORT cannot process VSE disk data sets that do not have DOS or VSE within the System Code field. DFSORT may set what it considers to be appropriate values for missing attributes (RECFM, LRECL, BLKSIZE) of input data sets based on other attributes, or may terminate due to a missing attribute. If a missing attribute results in termination, or you dont want to use a missing attribute set by DFSORT, specify that attribute explicitly (for example, specify RECFM=VB). See Data Set Considerations on page 12 for additional considerations. The following rules apply to concatenated data sets: v RECFM must be either all fixed-length or all variable-length for the data sets in the concatenation. v BLKSIZE can vary. However, if a tape data set has the largest block size and is not first in the concatenation, you must specify BLKSIZE explicitly on its DD statement in the following two situations: Blockset is selected and the tape data set has a block size greater than 32760 bytes, but the block size is not available from DFSMSrmm or ICETPEX. Blockset is not selected. v With fixed-length records, LRECL must be the same for all data sets. With variable-length records, LRECL can vary. However: If Blockset is selected: If a tape data set has the largest LRECL and is not first in the concatenation, you must specify LRECL explicitly on its DD statement if the LRECL is not available from DFSMSrmm or ICETPEX. If Blockset is not selected, the first data set in the concatenation must have the largest LRECL (LRECL can be specified explicitly on its DD statement). v If the data sets are on unlike devices, you cannot use the EXLST parameter at user exit E18. v If Blockset is not selected and BSAM is used, all null data sets must precede all non-null data sets; otherwise, the results are unpredictable. v DFSORT forces an EOF mark on all null data sets whose format-1 DSCB DS1IND80 flag is off before using BSAM to process the null data sets. v If you define a data set using the DUMMY parameter, do not concatenate other data sets to it; the system ignores data sets concatenated to a DUMMY data set. v VSAM data sets must not be concatenated (system restriction). v Input cannot consist of both VSAM and non-VSAM data sets. General Coding Notes:
Chapter 2. Invoking DFSORT with Job Control Language
69
Using DD Statements
v For a copy application, the SORTIN data set should not be the same as the SORTOUT data set or any OUTFIL data set because this can cause lost or incorrect data or unpredictable results. v For a sort application, the SORTIN data set should not be the same as any SORTWKdd data set because this can cause lost or incorrect data or unpredictable results. The SORTIN data set can be the same as the SORTOUT data set or an OUTFIL data set, but this situation can lead to the loss of the data set if the sort application does not end successfully. v FREE=CLOSE cannot be specified. User labels are not copied. Example 2 SORTIN DD Statement:
//SORTIN DD DSNAME=INPUT,DISP=SHR
This example shows DD statement parameters that define a previously cataloged input data set: DSNAME causes the system to search the catalog for a data set with the name INPUT. When the data set is found, it is associated with the ddname SORTIN. The control program obtains the unit assignment and volume serial number from the catalog and, if the volume is not already mounted, writes a mounting message to the operator. DISP indicates that the data set existed before this job step, that it should be kept after this job step, and that it can be used concurrently by several jobs (SHR). None of the jobs should change the data set in any way.
If the input data set is contained on more than one reel of magnetic tape, the VOLUME parameter must be included on the SORTIN DD statement to indicate the serial numbers of the tape reels. In this example, the input data set is on three reels that have serial numbers 75836, 79661, and 72945. If a data set is not on a disk or on a standard-labeled tape, you must specify DCB parameters in its DD statement.
SORTINnn DD Statement
The SORTINnn DD statements describe the characteristics of the data sets in which records to be merged reside and indicate the locations of these data sets. When Required: SORTINnn DD statements are always needed for a merge, unless the merge is invoked from another program and all input is supplied through a routine at user exit E32. Data Set Characteristics: Input data sets can be either non-VSAM or VSAM, but not both. DFSORT accepts empty and null non-VSAM data sets, and DUMMY data sets, for merging (be sure to supply RECFM, LRECL and BLKSIZE). DFSORT also accepts empty VSAM data sets for merging provided VSAMEMT is in effect. For non-VSAM data sets, DFSORT examines the DS1LSTAR field in the format-1 DSCB to determine whether the data set is null or empty. If DS1LSTAR is zero, DFSORT treats the data set as null or empty. A null data set is one that has been newly created but never successfully closed. Null data sets cannot be processed successfully by the Conventional merge technique.
70
Using DD Statements
RECFM must be the same for all input data sets. BLKSIZE can vary, but for a Conventional merge, SORTIN01 must specify the largest block size. With fixed-length records, LRECL must be the same for all data sets. With variable-length records, LRECL can vary. Data sets can be multivolume but not concatenated. If a SORTINnn data set is multivolume and null, DFSORT forces an EOF mark on the data set before use. DFSORT may set what it considers to be appropriate values for missing attributes (RECFM, LRECL, BLKSIZE) of input data sets based on other attributes, or may terminate due to a missing attribute. If a missing attribute results in termination, or you dont want to use a missing attribute set by DFSORT, specify that attribute explicitly (for example, specify RECFM=VB). See Data Set Notes and Limitations on page 13 for additional considerations. General Coding Notes: v A SORTINnn data set should not be the same as the SORTOUT data set or any OUTFIL data set because this can cause lost or incorrect data or unpredictable results. v You can merge up to 100 data sets with Blockset merge or up to 16 data sets with Conventional merge. If Conventional merge is selected, check message ICE800I for the reason Blockset could not be used and correct the indicated condition, if possible. With Blockset merge, nn can be any integer from 00 (the initial zero is optional) to 99, in any order. Blockset merge treats ddnames of the form SORTINn and SORTIN0n as duplicates, and ignores any occurrences after: the first. For example, if you have
//SORTIN4 DD . . . //SORTIN04 DD . . .
the SORTIN04 DD will be ignored. With Conventional merge, nn can range from 01 to 16. The first number you use must be 01 and the remainder must follow in numeric order. Numbers cannot be skipped. Conventional merge cannot use ddnames of the form SORTIN0-SORTIN9, SORTIN00 or SORTIN17-SORTIN99. v FREE=CLOSE cannot be specified. User labels are not copied. Example 4 SORTIN01-03 DD Statements (Merge):
//SORTIN01 DD DSNAME=MERGE1,VOLUME=SER=000111,DISP=OLD, // LABEL=(,NL),UNIT=3590, // DCB=(RECFM=FB,LRECL=80,BLKSIZE=32000) //SORTIN02 DD DSNAME=MERGE2,VOLUME=SER=000121,DISP=OLD, // LABEL=(,NL),UNIT=3590, // DCB=(RECFM=FB,LRECL=80,BLKSIZE=32000) //SORTIN03 DD DSNAME=MERGE3,VOLUME=SER=000131,DISP=OLD, // LABEL=(,NL),UNIT=3590, // DCB=(RECFM=FB,LRECL=80,BLKSIZE=32000)
71
Using DD Statements
//SORTIN01 DD DSNAME=INPUT1,VOLUME=SER=000101, // UNIT=3390,DISP=OLD //SORTIN02 DD DSNAME=INPUT2,VOLUME=SER=000201, // UNIT=3390,DISP=OLD * *DCB PARAMETERS *SUPPLIED FROM *LABELS
SORTWKdd DD Statement
The SORTWKdd DD statements describe the characteristics of the data sets used as intermediate storage areas for records to be sorted; they also indicate the location of these data sets. Up to 255 SORTWKdd DD statements can be specified. However, if you specify more than 32 and the Blockset technique is not selected, only the first 32 are used. When Required: One or more SORTWKdd statements are required for each sort application (but not a merge or copy), unless: v Input can be contained in main storage v Dynamic work space allocation has been requested (DYNALLOC) v dataspace sorting, Hipersorting, or memory object sorting is used. For information on using work data sets, see Appendix A, Using Work Space, on page 777. Diagnostic message ICE803I gives information on intermediate storage allocation and use. Devices: SORTWKdd data sets can be on disk or on tape, but not both. Disk types can be mixed. Tape must be nine-track unless input is on seven-track tape, in which case work tapes can (but need not) be seven-track. General Coding Notes: v Unless the input file is very large, two or three SORTWKdd data sets are usually sufficient. Two or three large SORTWKdd data sets are preferable to several small data sets. Placing each SORTWKdd data set on a separate device can improve performance. For optimum allocation of resources such as virtual storage, avoid specifying a large number of work data sets unnecessarily. v A SORTWKdd data set should not be the same as the SORTIN data set, the SORTOUT data set, any OUTFIL data set, or any other SORTWKdd data set because this can cause lost or incorrect data or unpredictable results. v Cylinder allocation is preferable for performance reasons. Temporary SORTWKdd data sets allocated in tracks or blocks (without ROUND) are readjusted to cylinders by DFSORT. v For disk work data sets, any valid ddname of the form SORTWKdd or SORTWKd can be used (for example, SORTWK01, SORTWKC3, SORTWK2, SORTWK#5, SORTWKA, SORTWKXY and so on). The ddnames can be in any order. SORTWKd and SORTWK0d are not treated as duplicate ddnames (for example, SORTWK5 and SORTWK05 will both be used if specified, as will SORTWKQ and SORTWK0Q). If you specify more than 255 ddnames and the Blockset technique is selected, only the first 255 ddnames are used. If you specify more than 32 ddnames and the Blockset technique is not selected, only the first 32 ddnames are used.
72
Using DD Statements
v For tape work data sets, at least three SORTWKdd data sets must be specified. The first three ddnames must be SORTWK01, SORTWK02 and SORTWK03. Subsequent ddnames, if specified, must be in order from SORTWK04 through SORTWK32, with no numbers skipped, v FREE=CLOSE cannot be specified. v Spool, dummy, subsystem, VSAM and z/OS UNIX file system data sets, and z/OS UNIX files, must not be specified as work data sets v Parameters relating to ASCII data should not be included for tape work data sets. Disk Work Data Set Coding Notes: v Data sets must be physical sequential; they cannot be partitioned or extended format. v The SPLIT cylinder parameter must not be specified. v If no secondary allocation is requested for temporary SORTWKdd data sets, automatic secondary allocation will be used unless NOWRKSEC is in effect. (Secondary allocation is limited to 12 work data sets in the Peerage and Vale sorting techniques only.) v If the data set is allocated to VIO, there is no automatic secondary allocation. v Secondary allocation can be requested for work data sets. For the Peerage and Vale sorting techniques only, secondary allocation is limited to the first 12 work data sets; if more work data sets are defined, they are used with only the primary allocation. v DFSORT uses only the space on the first volume specified for a multivolume data set. Space on the second and subsequent volumes is not used. Multivolume SORTWKdd data sets are, therefore, treated as single-volume SORTWKdd data sets. v DFSORT work data sets can exceed 65536 cylinders if allocated as large format data sets on disk devices. Dynamically allocated disk work data sets are automatically allocated by DFSORT as large format. DSNTYPE=LARGE must be specified on SORTWKdd DD statements to allocate JCL work data sets as large format. v If primary space is fragmented, all but the first fragment are handled as secondary space. Virtual I/O: If a SORTWKdd data set is specified on a virtual device: v With VIO=NO: DFSORT performs dynamic reallocation using the ddname SORTDKdd on a real device with the same device type as the virtual device. If a real device corresponding to the virtual device is not available in the system, DFSORT terminates with an ICE083A message; see z/OS DFSORT Messages, Codes and Diagnosis Guide for more information about this error. Non-VIO SORTWKdd data sets are also reallocated when VIO SORTWKdd data sets are present. v With VIO=YES: the virtual device is used; performance may be degraded. v DFSORT work data sets cannot be allocated as large format data sets if VIO is used. The following is an example of a SORTWKdd DD statement using a disk work: data set Example 6 SORTWK01 DD Statement, Disk Work Data Set:
//SORTWK01 DD SPACE=(CYL,(15,5)),UNIT=3390
| |
73
Using DD Statements
If you use the checkpoint/restart facility and need to make a deferred restart, you must make the following additions to the above statement so that the sort work data set is not lost:
DSNAME=name1,DISP=(NEW,DELETE,CATLG)
Thus the same SORTWKdd DD statement for a deferred restart would be:
//SORTWK01 // DD DSNAME=name1,UNIT=3390,SPACE=(CYL,(15,5)), DISP=(NEW,DELETE,CATLG)
The following is an example of SORTWKdd DD statements using three tape devices. Example 7 SORTWK01-03 DD Statement, Tape Intermediate Storage:
//SORTWK01 //SORTWK02 //SORTWK03 DD DD DD UNIT=3480,LABEL=(,NL) UNIT=3480,LABEL=(,NL) UNIT=3480,LABEL=(,NL)
If DFSORT terminates unsuccessfully and the above DD statements have been specified, the intermediate storage data sets remain in the system until the step has been successfully rerun or until the data sets have been deleted by some other means. These parameters specify unlabeled data sets on three 3480 tape units. Because the DSNAME parameters are omitted, the system assigns unique names.
74
75
DISP specifies the data set unknown to the operating system (NEW) and catalogs (CATLG) it under the name C905460.OUTPT. DSNAME specifies that the data set is called C905460.OUTPT. SPACE requests five cylinders of storage for the data set. UNIT Indicates that the data set is on a 3390.
SORTCKPT DD Statement
The SORTCKPT data set can be allocated on any device that operates with the Basic Sequential Access Method (BSAM). Processing must be restarted only from the last checkpoint taken. Example 9 SORTCKPT DD Statement:
//SORTCKPT DD DSNAME=CHECK,VOLUME=SER=000123, // DSP=(NEW,KEEP),UNIT=3480
When you allocate the SORTCKPT data set, you must include at least one work data set. If the CKPT operand is specified on the OPTION or SORT control statement, more intermediate storage could be required. If you want to use the Checkpoint/Restart Facility, refer to Checkpoint/Restart on page 833.
SORTCNTL DD Statement
The SORTCNTL data set can be used to supply DFSORT control statements, comment statements, blank statements, and remarks when DFSORT is invoked from another program (written, for example, in COBOL or PL/I). v The SORTCNTL data set usually resides in the input stream, but can be defined as a sequential data set or as a member of a partitioned data set. v The data set must be defined with RECFM of F or FB. The LRECL can be 80, or more (when valid). If the LRECL is greater than 80, DFSORT will use the first 80 bytes of each record. v DFSORT supports concatenated SORTCNTL data sets to the extent that the system supports like concatenated data sets for BSAM. Refer to z/OS DFSMS Using Data Sets for further information about like concatenated data sets. v When DFSORT is invoked from a PL/I program, the SORTCNTL or DFSPARM data set must not be used to supply a new RECORD control statement. Example 10 SORTCNTL DD Statement:
//SORTCNTL DD * OPTION MAINSIZE=8M
Notes: 1. The OPTION statement keywords EFS, LIST, NOLIST, LISTX, NOLISTX, LOCALE, MSGPRT, MSGDDN, SMF, SORTDD, SORTIN, and SORTOUT are used only when they are passed by an extended parameter list or when in the
76
SORTCNTL DD Statement
DFSPARM data set. If they are specified on an OPTION statement read from the SYSIN or SORTCNTL data set, the keyword is recognized, but the parameters are ignored. If your program invokes DFSORT more than once, you can direct DFSORT to read different versions of the SORTCNTL data set at each call. See the explanation of the SORTDD parameter in OPTION Control Statement on page 171. 2. If you use the DFSPARM DD statement instead of the SORTCNTL DD statement, you can specify both EXEC PARM options and DFSORT control statements in a single source data set that overrides all other sources. See DFSPARM DD Statement. For override rules, see Appendix B, Specification/Override of DFSORT Options, on page 787.
DFSPARM DD Statement
The DFSPARM DD statement can be used to supply DFSORT program control statements and EXEC statement PARM options from a single DD source. Because statements in the DFSPARM data set are read whether DFSORT is program invoked or directly invoked, you can specify EXEC PARM options when invoking DFSORT from another program (unlike SORTCNTL). DFSPARM accepts all DFSORT program control statements and all EXEC statement PARM options (including those ignored by SYSIN and SORTCNTL) and any equivalent options specified on a DFSORT OPTION statement. DFSPARM also accepts comment statements, blank statements, and remarks. For examples of using DFSPARM when you call DFSORT from a program, see Overriding DFSORT Control Statements from Programs on page 484. Full override and applicability details are listed below and in Appendix B, Specification/Override of DFSORT Options, on page 787. v If you use DFSPARM, SYSIN is not necessary unless your job requires link-editing. v The DFSPARM data set usually resides in the input stream, but it can be defined as a sequential data set or as a member of a partitioned data set. v The data set must be defined with RECFM of F or FB. The LRECL can be 80, or more (when valid). If the LRECL is greater than 80, DFSORT will use the first 80 bytes of each record. v DFSORT supports concatenated DFSPARM data sets to the extent that the system supports like concatenated data sets for BSAM. Refer to z/OS DFSMS Using Data Sets for further information about like concatenated data sets. v When DFSORT is invoked from a PL/I program, the SORTCNTL or DFSPARM data set must not be used to supply a new RECORD control statement. Note: The ddname DFSPARM is used throughout this document to refer to this data set source for EXEC PARM options and DFSORT program control statements. When your system programmers installed DFSORT, they might have changed this name to one more appropriate for your site with the PARMDDN installation option. However, DFSORT will always use a DFSPARM data set of present, unless a DD statement with the PARMDDN name is also present.
77
DFSPARM DD Statement
General Coding Notes: Coding of parameters in the DFSPARM DD statement follows the same rules used for the JCL EXEC statement PARM options and the program control statements specified in SYSIN or SORTCNTL. The following exceptions apply: v Labels are not allowed. v PARM options and program control statements cannot be mixed on the same line, but can be specified in any order on different lines. v PARM options must be specified without the PARM= keyword and without quote marks. v Commas (or semicolons) are accepted, but not required, to continue PARM options to another line. v Leading blanks are not required for PARM options, but at least one leading blank is required for program control statements. FREE=CLOSE can be used for applicable DFSPARM data sets (for example, with temporary and permanent sequential data sets, but not with DD * data sets). When DFSORT is called from another program, FREE=CLOSE causes the DFSPARM data set to be released when DFSORT returns to the caller. This allows another DFSPARM data set to be used for a subsequent call. For example, if a COBOL program contains three SORT verbs, the following would cause the control statements in DP1 to be used for the first SORT verb, the control statements in DP2 to be used for the second SORT verb, and the: control statements in DP3 to be used for the third SORT verb //DFSPARM DD DSN=DP1,DISP=SHR,FREE=CLOSE //DFSPARM DD DSN=DP2,DISP=SHR,FREE=CLOSE //DFSPARM DD DSN=DP3,DISP=SHR,FREE=CLOSE Without FREE=CLOSE, DP1 would be used for all three SORT verbs. Example 11 DFSPARM DD Statement:
//DFSPARM DD * SORT FIELDS=(1,2,CH,A),STOPAFT=300 ABEND OPTION SORTIN=DATAIN STOPAFT=500
In this example, the DFSPARM DD data set passes a DFSORT SORT statement, the ABEND and STOPAFT parameters equivalent to specifying PARM=ABEND,STOPAFT=500 in a JCL EXEC statement, and a DFSORT OPTION statement. Notes: 1. SORT and OPTION are control statements. ABEND and STOPAFT=500 are PARM options. 2. The PARM option STOPAFT=500 overrides the SORT control statement option STOPAFT=300. 3. When PARMDDN=DFSPARM is specified or defaulted v if a //DFSPARM DD data set is available at run-time, DFSORT will use it v if a //DFSPARM DD data set is not available at run-time, DFSORT will use a //$ORTPARM DD data set if available.
78
DFSPARM DD Statement
Thus with PARMDDN=DFSPARM, you can choose to specify either a //DFSPARM DD data set or a //$ORTPARM DD data set for a particular DFSORT application. 4. When PARMDDN=ddname is specified v if a //ddname DD data set is available at run-time, DFSORT will use it v if a //ddname DD data set is not available at run-time, DFSORT will use a //DFSPARM DD data set if available. Thus with PARMDDN=ddname, you can choose to specify either a //ddname DD data set or a //DFSPARM DD data set for a particular DFSORT application. Example 12 DFSPARM DD Statement:
//DFSPARM DD * SORT FIELDS=(5,2,CH,D),SKIPREC=10 STOPAFT=100,BSAM,SKIPREC=5 OPTION SORTIN=DATAIN,SKIPREC=20
In this example, the DFSPARM DD data set contains a SORT program control statement, three PARM options on one line, and an OPTION program control statement. Note: Because PARM options override program control statements, DFSORT uses SKIPREC=5 and ignores the other SKIPREC specifications. For information on the parameters used in the DFSPARM DD statement, the conditions under which they are required, and any default values assumed if a parameter is omitted, see Specifying EXEC/DFSPARM PARM Options on page 29 and Chapter 3, Using DFSORT Program Control Statements, on page 81.
SORTDKdd DD Statement
SORTWKdd data sets can be assigned to VIO. If the VIO installation option is specified or defaults to NO, SORTWKdd data sets are deallocated and reallocated by DFSORT using SORTDKdd ddnames. SORTDKdd ddnames are reserved for use by DFSORT.
SORTDIAG DD Statement
The SORTDIAG DD statement specifies that all messages, including diagnostic messages (ICE800I through ICE999I), and control statements are to be written to the message data set. The statement can be used for all DFSORT techniques and provides information on EXCP counts, intermediate storage allocation and use, and so on. The SORTDIAG DD statement has no effect on console messages. The statement is intended as a diagnostic tool. When SORTDIAG is used, a SYSOUT DD statement or a ddname DD statement (where ddname is the alternate message data set ddname specified during installation or run-time) should be provided. If installation option NOMSGDD=QUIT is in effect and neither an alternate message data set ddname statement nor a SYSOUT ddname statement is provided, DFSORT terminates with a return code of 20. Example 13 SORTDIAG DD Statement:
//SORTDIAG DD DUMMY
SORTSNAP DD Statement
The SORTSNAP DD statement defines the data set where the snap dumps requested by the ESTAE recovery routine, or the snap dumps requested before or
Chapter 2. Invoking DFSORT with Job Control Language
79
SORTSNAP DD Statement
after a call to an EFS program are printed. SORTSNAP is dynamically allocated by DFSORT whenever it is required. The ddname, SORTSNAP, is reserved for DFSORT.
80
| | |
Fields . . . . . . . . . . . . . . Mask . . . . . . . . . . . . . . Padding and Truncation . . . . . . . . . Including Records in the Output Data SetBit Operator Test Examples . . . . . . . . . Example 1 . . . . . . . . . . . . Example 2 . . . . . . . . . . . . Example 3 . . . . . . . . . . . . Method 2: Bit Comparison Tests . . . . . . Relational Condition Format . . . . . . Fields . . . . . . . . . . . . . . Bit Constant . . . . . . . . . . . . Padding and Truncation . . . . . . . . Including Records in the Output Data SetBit Comparison Test Examples . . . . . . . . Example 1 . . . . . . . . . . . . Example 2 . . . . . . . . . . . . Example 3 . . . . . . . . . . . . Date Comparisons . . . . . . . . . . . Relational Condition Format . . . . . . Including Records in the Output Data SetDate Comparisons . . . . . . . . . . . . Example 1 . . . . . . . . . . . . Example 2 . . . . . . . . . . . . Numeric Tests . . . . . . . . . . . . Relational Condition Format . . . . . . Including Records in the Output Data Set--Numeric Tests . . . . . . . . . . Example 1 . . . . . . . . . . . . Example 2 . . . . . . . . . . . . INCLUDE/OMIT Statement Notes . . . . . INREC Control Statement . . . . . . . . . INREC Statement Notes . . . . . . . . . Reformatting Records Before Processing Examples . . . . . . . . . . . . . . Example 1 . . . . . . . . . . . . Example 2 . . . . . . . . . . . . Example 3 . . . . . . . . . . . . Example 4 . . . . . . . . . . . . Example 5 . . . . . . . . . . . . Example 6 . . . . . . . . . . . . Example 7 . . . . . . . . . . . . Example 8 . . . . . . . . . . . . Example 9 . . . . . . . . . . . . Example 10 . . . . . . . . . . . . Example 11 . . . . . . . . . . . . Example 12 . . . . . . . . . . . . MERGE Control Statement . . . . . . . . . Specifying a MERGE or COPYExamples . . Example 1 . . . . . . . . . . . . Example 2 . . . . . . . . . . . . Example 3 . . . . . . . . . . . . Example 4 . . . . . . . . . . . . MODS Control Statement . . . . . . . . . Identifying User Exit RoutinesExamples . . . Example 1 . . . . . . . . . . . .
115 115 116 116 116 116 116 117 117 117 118 118 118 118 118 119 119 119 122 122 122 122 123 124 124 124 124 125 148 150 150 151 152 152 153 153 154 155 156 157 158 158 160 163 163 163 163 164 164 167 167
81
| |
| | |
82
MERGE
OPTION
83
RECORD SUM
Using Symbols
You can define and use a symbol for any field or constant in the following DFSORT control statements: INCLUDE, INREC, MERGE, OMIT, OUTFIL, OUTREC, SORT and SUM. You can also use a symbol for an output column in the following DFSORT control statements: INREC, OUTFIL and OUTREC. This makes it easy to create and reuse collections of symbols (that is, mappings) representing information associated with various record layouts. You can use system symbols (for example, &JOBNAME.) in your symbol constants. See Chapter 7, Using Symbols for Fields and Constants, on page 663 for complete details.
84
Column 1 must be blank unless a label is present 72 73 (Label) Operation Operand (Remarks) 80 (Sequence or Identification)
(Continuation column)
Figure 6. Control Statement Format
The control statements are free-form; that is, the operation definer, operands, and comment field can appear anywhere in a statement, provided they appear in the proper order and are separated by one or more blank characters. Column 1 of each control statement must be blank, unless the first field is a label or a comment statement (see Inserting Comment Statements on page 88). v Label Field A label can be specified on any control statement in SYSIN or SORTCNTL. A label is never required. If present, a label must begin in column 1 with any character other than a blank or asterisk (*). A label can be 1 to 70 characters and ends when a blank character is found. Any character can be used in a label. A label followed only by blanks is printed but otherwise not processed. Labels cannot be specified in the parameter list, in DFSPARM or in continuation lines. To skip the label, specify one or more blanks starting in column 1. The following illustrates the use of control statements with and without labels:
OPTION EQUALS MYSORT SORT FIELDS=(5,4,CH,A) OUTREC FIELDS=(1,20,51,30) OUT_1 OUTFIL FNAMES=OUT1,INCLUDE=(5,1,CH,EQ,C'A') OUT_2 OUTFIL FNAMES=OUT2,INCLUDE=(5,1,CH,EQ,C'B')
v Operation Field This field can appear anywhere between column 2 and column 71 of the first line. It contains a word (for example, SORT or MERGE) that identifies the statement type to the program. In the example below, the operation definer, SORT, is in the operation field of the sample control statement. v Operand Field The operand field is composed of one or more operands separated by commas or semicolons. This field must follow the operation field, and be separated from it by at least one blank. No blanks are allowed within the parameters, but a blank is required at the end of all parameters. If the statement occupies more than one line, the operand must begin on the first line. Each operand has an operand definer, or parameter (a group of characters that identifies the operand type to DFSORT). A value or a list of values can be associated with a parameter. The five possible operand forms shown in this chapter are: parameter. Examples: CHALT, NOCHALT, REMOVECC parameter(c). Examples: DATE1(/), TIME2(:), Y2W(-) parameter=value. An operand shown in the form parameter=value can also be specified in the equivalent form parameter(value) or parameter=(value). Examples: AVGRLEN=100, AVGRLEN(100), and AVGRLEN=(100) are
85
The following example illustrates the parameter, parameter(value), parameter(list) and parameter=(value) forms.
SORT EQUALS,FORMAT(CH),FIELDS(10,30,A),STOPAFT=(1000)
The two SORT statements above are equivalent. v Remark Field This field can contain any information. It is not required, but if it is present, it must be separated from the last operand field by at least one blank. v Continuation Column (72) Any character other than a blank in this column indicates that the present statement is continued on the next line. However, as long as the last character of the operand field on a line is a comma or semicolon or colon followed by a blank, the program assumes that the next line is a continuation line. The nonblank character in column 72 is required only when a remark field is to be continued or when an operand is broken at column 71. v Columns 73 through 80 This field can be used for any purpose.
Continuation Lines
The format of the DFSORT continuation line is shown in Figure 7 on page 87.
86
16 72 73 80 Optional use
(Continuation column)
Figure 7. Continuation Line Format
The continuation column and columns 73 through 80 of a continuation line have the same purpose as they do on the first line of a control statement. Column 1 must be blank. A continuation line is treated as a logical extension of the preceding line. Either an operand or a remark field can begin on one line (referred to as line 1 in the bullets below) and continue on the next line (referred to as line 2 in the bullets below). The following are the rules for continuation illustrated with examples (these different types of continuation can be intermixed): v Implicit continuation in 2-71: If line 1 breaks at a comma-blank or semicolon-blank or colon-blank, DFSORT continues on line 2 with the first nonblank character it finds in columns 2-71. For example:
* 1 2 3 4 5 6 7 *23456789012345678901234567890123456789012345678901234567890123456789012 INCLUDE COND=(5,4,CH,EQ, C'ABCD') SORT FIELDS=(9, 3, ZD, A) OUTREC FIELDS=(1,27,2X, FIRST FIELD AND TWO BLANKS 51,2,BI,M11, SECOND FIELD 60:9,3,ZD,PD) THIRD FIELD
v Explicit continuation in 16: If line 1 breaks at column 71 with a nonblank in column 72, and columns 2-15 of line 2 are blank, DFSORT continues on line 2 with whatever character it finds in column 16 (blank or nonblank). For example:
* 1 2 3 4 5 6 7 *23456789012345678901234567890123456789012345678901234567890123456789012 INCLUDE COND=(5,4,CH,E* Q,C'ABCD') SORT FIELDS=(9,3,* ZD,A) OUTREC FIELDS=(1,80,C'BLANK WITHIN A* LITERAL')
87
With the D in column 16 of line 2, we get ZD in the SORT statement. But with the D in column 17 of line 2, we get Z D in the SUM statement instead of ZD, resulting in a syntax error. v Explicit continuation in 2-15: If line 1 breaks at column 71 with a nonblank in column 72, and columns 2-15 of line 2 are nonblank, DFSORT continues on line 2 with the first nonblank character it finds in columns 2-15. For example:
* 1 2 3 4 5 6 7 *23456789012345678901234567890123456789012345678901234567890123456789012 INCLUDE COND=(5,4,CH,EQ,C'AB* CD') SORT FIELDS=(9,3,* ZD,A) OUTREC FIELDS=(5,4,2X* ,9,3,ZD,M26,80:X)
v Remark continuation in 2-71: If a statement ends on line 1 with a blank before column 72 and a nonblank in column 72, DFSORT treats the first nonblank character it finds in columns 2-71 of line 2 as the start of a remark. For example:
* 1 2 3 4 5 6 7 *23456789012345678901234567890123456789012345678901234567890123456789012 SORT FIELDS=(9,3,ZD,A) THIS IS A * CONTINUED REMARK
Tip: A simpler way to do the same thing (without continuation) is to use a comment statement for line 2. For example:
* 1 2 3 4 5 6 7 *23456789012345678901234567890123456789012345678901234567890123456789012 SORT FIELDS=(9,3,ZD,A) THIS IS A * CONTINUED REMARK
88
Coding Restrictions
The following rules apply to control statement preparation: v Operation definers and operands must be in uppercase EBCDIC. v Column 1 of each control statement can be used only for a label or for a comment statement that begins with an asterisk in column 1. v If present, a label must begin in column 1. Labels are allowed only in the SYSIN and SORTCNTL data sets. v The entire operation definer must be contained on the first line of a control statement. v The first operand must begin on the first line of a control statement. The last operand in a statement must be followed by at least one blank. v Blanks are not allowed in operands. Anything following a blank is considered part of the remark field. v Remarks are allowed only in the DFSPARM, SYSIN, and SORTCNTL data sets. v Commas, semicolons, and blanks can be used only as delimiters. They can be used in values only if the values are constants. v Each type of program control statement can appear only once within a single source (for example, the SYSIN data set).
The ALTSEQ control statement can be used to change the alternate translation table (ALTSEQ table). Any modifications you specify are applied to the standard EBCDIC translation table. The modified ALTSEQ table overrides the installation default ALTSEQ table (the shipped default is the EBCDIC translation table).
Chapter 3. Using DFSORT Program Control Statements
89
v To convert characters for INREC, OUTREC, or OUTFIL OUTREC fields with TRAN=ALTSEQ. In this case, the ALTSEQ table is used to change the actual data. If you specify TRAN=ALTSEQ without specifying an ALTSEQ control statement, DFSORT uses the installation default ALTSEQ table. For example, if you want to change the character $ (X5B) to the character * (X5C), you should specify:
ALTSEQ CODE=(5B5C)
CODE
, CODE=( fftt )
Specifies the original and modified EBCDIC collating positions. ff tt specifies, in hexadecimal, the character whose position is to be changed in the ALTSEQ table. specifies, in hexadecimal, the new position the character is to occupy in the ALTSEQ table.
The order in which the parameters are specified is not important. Notes: 1. If CHALT is in effect, control fields with format CH are collated using the ALTSEQ table, in addition to those with format AQ. 2. If you use locale processing for SORT, MERGE, INCLUDE, or OMIT fields, you must not use CHALT. If you need alternate sequence processing for a particular field, use format AQ. 3. Using ALTSEQ can degrade performance. Default: Usually the installation option. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787.
90
Example 2
MERGE FIELDS=(25,7,A,1,10,D),FORMAT=CH OPTION CHALT ALTSEQ CODE=(F0B0,F1B1,F2B2,F3B3,F4B4,F5B5,F6B6, F7B7,F8B8,F9B9)
The numerals 0 through 9 are to collate before uppercase letters (but after lowercase letters).
Example 3
SORT FIELDS=(55,8,AQ,A) ALTSEQ CODE=(C1F1,C2F2)
The uppercase A (X'C1') is to collate at the same position as the numeral 1 (X'F1') and the uppercase B (X'C2') is to collate at the same position as the numeral 2 (X'F2'). Note that this ALTSEQ statement does NOT cause collating of A before or after 1, or of B before or after 2.
Example 4
SORT FIELDS=(55,8,AQ,A) ALTSEQ CODE=(81C1,82C2,83C3,84C4,85C5,86C6,87C7, 88C8,89C9,91D1,92D2,93D3,94D4,95D5,96D6, 97D7,98D8,99D9,A2E2,A3E3,A4E4,A5E5,A6E6, A7E7,A8E8,A9E9)
Each lowercase letter is to collate at the same position as the corresponding uppercase letter. For example, the lowercase a (X'81') is to collate at the same position as the uppercase A (X'C1'). This results in case-insensitive collating.
Example 5
OPTION COPY ALTSEQ CODE=(0040) OUTREC FIELDS=(1,80,TRAN=ALTSEQ)
91
The DEBUG control statement is not intended for regular use; only ABEND, NOABEND, and BSAM are of general interest. For a tape work sort or a Conventional merge, only the ABEND or NOABEND parameters of the DEBUG statement are used. For more information about problem diagnosis, see z/OS DFSORT Messages, Codes and Diagnosis Guide. ABEND or NOABEND
ABEND NOABEND
Temporarily overrides the ERET installation option, which specifies whether DFSORT abends or terminates with a return code of 16, if your sort, copy, or merge is unsuccessful. ABEND Specifies that if your sort, copy, or merge is unsuccessful, DFSORT abends with a user completion code equal to the appropriate message number or with a user-defined number between 1 and 99, as set during installation with installation option ABCODE=n. When DEBUG ABEND is in effect, a user abend code of zero might be issued when a tape work data set sort or Conventional merge is unsuccessful. NOABEND Specifies that an unsuccessful sort, copy, or merge terminates with a return code of 16.
92
BSAM
Temporarily bypasses the EXCP access method for input and output data sets. BSAM is ignored for VSAM input and output data sets. Attention: If Blockset is not selected and BSAM processing is used with concatenated SORTIN input, and both null and non-null data sets are specified, all null data sets must precede all non-null data sets; otherwise, the results are unpredictable. Attention: This option can degrade performance. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. CFW or NOCFW
CFW NOCFW
Temporarily overrides the CFW installation option, which specifies whether DFSORT can use cache fast write when processing SORTWKdd data sets that reside on devices connected to cached 3990 control units. CFW Specifies that DFSORT can use cache fast write when processing SORTWKdd data sets.
93
CTRx=n
Keeps a count of the input and output records, and abends with code 0C1 when the count reaches n. The numbers that can be assigned to x are: 2 3 4 5 Counts the input records being moved from the input buffer (not used for a copy). Counts the output records being moved to the output buffer (not used for a copy or merge). Counts the input records inserted by E15 (not used for Blockset). Counts the output records deleted by E35 (not used for Blockset).
Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. EFSDPAFT
, EFSDPAFT=( n )
Initiates a SNAP dump after a Major Call to an EFS program. Any combination of the numbers can be specified. The numbers have the following meanings: 2 3 4 5 Takes the SNAP dump after Major Call 2 to the EFS program. Takes the SNAP dump after Major Call 3 to the EFS program. Takes the SNAP dump after Major Call 4 to the EFS program. Takes the SNAP dump after Major Call 5 to the EFS program.
Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. EFSDPBFR
94
Initiates a SNAP dump before a Major Call to an EFS program. Any combination of the numbers can be specified. The numbers have the following meanings: 2 3 4 5 Takes the SNAP dump before Major Call 2 to the EFS program. Takes the SNAP dump before Major Call 3 to the EFS program. Takes the SNAP dump before Major Call 4 to the EFS program. Takes the SNAP dump before Major Call 5 to the EFS program.
Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. EQUCOUNT
EQUCOUNT
Determines the number of records having equal keys (that is, duplicate keys) which have been sorted by the Blockset technique (printed in message ICE184I). For variable-length records, EQUCOUNT can only be used with either Hiperspace (when Hipersorting is used) or work data sets. Notes: 1. Using EQUCOUNT can degrade performance. 2. ICETOOLs UNIQUE and OCCUR operators provide unique and non-unique key reporting capabilities that may be more useful for your application than EQUCOUNT. 3. If VLSHRT is in effect, EQUCOUNT will not be used. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. ESTAE or NOESTAE
ESTAE NOESTAE
95
NOASSIST
DFSORT uses Sorting Instructions when possible. If you do not want to use these instructions, you can temporarily bypass them by specifying this parameter. Attention: This option can degrade performance. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787.
96
If the input records contain the following keys: KEYA, KEYA, KEYB, KEYB, KEYC, KEYD, KEYD, KEYE the following message will be issued: ICE184I THE NUMBER OF RECORDS SORTED WITH EQUAL KEYS IS 3 The three equal keys are KEYA, KEYB, and KEYD. Note: ICETOOLs UNIQUE and OCCUR operators provide full equal key reporting capabilities and should be used instead of EQUCOUNT.
Example 2
SORT FIELDS=(12,2,BI,D) DEBUG BSAM,ABEND
Directs DFSORT to use the BSAM access method for the SORTIN and SORTOUT data sets and to abend if the sort application is unsuccessful.
END
The END control statement allows DFSORT to discontinue reading SYSIN, DFSPARM, or SORTCNTL before end of file (EOF). When you link-edit user exit routines dynamically, the END statement marks the end of the DFSORT control statements and the beginning of exit routine object decks in SYSIN.
Because the OPTION statement appears after the END statement, it is not read.
Example 2
//SYSIN DD * SORT FIELDS=(5,8,CH,A) MODS E15=(E15,1024,SYSIN,T) END object deck for E15 user exit here
Chapter 3. Using DFSORT Program Control Statements
97
INCLUDE COND=
Use an INCLUDE statement if you want only certain records to appear in the output data set. The INCLUDE statement selects the records you want to include. You can specify either an INCLUDE statement or an OMIT statement in the same DFSORT run, but not both. The way in which DFSORT processes short INCLUDE/OMIT compare fields depends on the settings for VLSCMP/NOVLSCMP and VLSHRT/NOVLSHRT. A short field is one where the variable-length record is too short to contain the entire field, that is, the field extends beyond the record. For details about including or omitting short records, see the discussion of the VLSCMP and NOVLSCMP options in OPTION Control Statement on page 171. A logical expression is one or more relational conditions logically combined, based on fields in the input record, and can be represented at a high level as follows:
If the logical expression is true for a given record, the record is included in the output data set. Five types of relational conditions can be used as follows: 1. Comparisons: Compare two compare fields or a compare field and a decimal, hexadecimal, character, or current, future, or past date constant. For example, you can compare the first 6 bytes of each record with its last 6 bytes, and include only those records in which those fields are identical. Or you can compare a date field with todays date, yesterdays date, or tomorrows date, and include records accordingly. See Comparisons on page 101 for information about comparisons. 2. Substring Comparison Tests: Search for a constant within a field value or a field value within a constant.
98
99
v D2 format can be specified with the INCLUDE statement but not with the INCLUDE parameter. See OUTFIL Control Statements on page 224 for more details on the OUTFIL INCLUDE parameter. COND
COND=
logical expression
specifies one or more relational conditions logically combined, based on fields in the input record. If the logical expression is true for a given record, the record is included in the output data sets. specifies that all of the input records are to be included in the output data sets. specifies that none of the input records are to be included in the output data sets.
ALL NONE
Default: ALL. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. FORMAT
FORMAT=f
FORMAT=f can be used to specify a particular format for one or more compare fields. f from FORMAT=f is used for p,m fields. f from FORMAT=f is ignored for p,m,f fields. For example, the following are all equivalent:
INCLUDE COND=(5,5,ZD,EQ,12,3,PD,OR,21,3,PD,NE,35,5,ZD) INCLUDE FORMAT=ZD,COND=(5,5,EQ,12,3,PD,OR,21,3,PD,NE,35,5) INCLUDE COND=(5,5,ZD,EQ,12,3,OR,21,3,NE,35,5,ZD),FORMAT=PD
The permissible field formats for comparisons are shown in Table 8 on page 102. SS (substring) is the only permissible field format for substring comparison tests. BI (unsigned binary) is the only permissible field format for bit logic tests. The Y2x formats are the only permissible field formats for date comparisons. The FS or CSF (floating sign), ZD (zoned decimal), and PD (packed decimal) formats are the only permissible field formats for numeric tests.
100
Relational Condition
A relational condition specifies a comparison, substring comparison test, bit logic test, date comparison or numeric test to be performed. Relational conditions can be logically combined, with AND or OR, to form a logical expression. If they are combined, the following rules apply: v AND statements are evaluated before OR statements unless parentheses are used to change the order of evaluation; expressions inside parentheses are always evaluated first. (Nesting of parentheses is limited only by the amount of storage available.) v The symbols & (AND) and | (OR) can be used instead of the words.
Comparisons
Relational Condition Format
Two formats for the relational condition can be used:
(p1,m1,f1,
EQ NE GT GE LT LE
p2,m2,f2 constant
(p1,m1, f1,
EQ NE GT GE LT LE
Comparison operators are as follows: EQ Equal to NE Not equal to GT Greater than GE Greater than or equal to LT Less than
Chapter 3. Using DFSORT Program Control Statements
101
Character with alternate collating sequence Signed zoned decimal Signed packed decimal Packed decimal with sign and first digit ignored Signed fixed-point Unsigned binary ASCII character Signed numeric with optional leading floating sign Unsigned free form numeric Signed free form numeric Signed numeric with leading separate sign Signed numeric with trailing separate sign Signed numeric with leading overpunch sign Signed numeric with trailing overpunch sign Signed ASCII numeric with leading separate sign Signed ASCII numeric with trailing separate sign
4. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.
102
Note: See Appendix C, Data Format Descriptions, on page 815 for detailed format descriptions.
p2,m2,f2: These variables specify another field in the input record with which the p1,m1,f1 field will be compared. Permissible comparisons between compare fields with different formats are shown in Table 9 and Table 10. AC, ASL, and AST formats sequence EBCDIC data using the ASCII collating sequence. You can use p2,m2 rather than p2,m2,f2 if you use FORMAT=f to supply the format for the field.
Table 9. Permissable Field-to-Field Comparisons for INCLUDE/OMIT (Group 1) Field Format BI CH ZD PD FI CSF or FS UFF SFF CSL or LS CST or TS BI X X CH X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X ZD PD FI CSF or FS UFF SFF CSL or LS CST or TS
Table 10. Permissable Field-to-Field Comparisons for INCLUDE/OMIT (Group 2) Field Format PD0 AC ASL AST CLO or OL CTO or OT AQ D2 Note: D2 field formats are user-defined. PD0 X X X X X X X X X X X X AC ASL AST CLO or OL CTO or OT AQ D2
5. If CHALT is in effect, CH is treated as AQ. Chapter 3. Using DFSORT Program Control Statements
103
Decimal Number Format: The format for coding a decimal constant is:
104
[]n
When an FI field is compared with a decimal constant, n or +n cannot be larger than +9223372036854775807 and n cannot be smaller than -9223372036854775808. When a BI field is compared with a decimal constant, n or +n cannot be larger than +18446744073709551615 nor smaller than +0. A BI field cannot be compared to a negative number (n). A BI field cannot be compared to 0 even if NOSZERO is in effect. Examples of valid and invalid decimal constants are:
Valid 15 +15 15 18000000 Invalid ++15 15+ 1.5 1,500 Explanation Too many sign characters Sign in wrong place Contains invalid character Contains invalid character
Current Date as Decimal Number: DATE1P, &DATE1P, DATE2P, &DATE2P, DATE3P, or &DATE3P can be used to generate a decimal number for the current date of the run. Table 12 shows the form of the decimal number constant generated for each current date operand along with an example of the actual decimal number generated when the date of the run is June 21, 2005. yyyy represents the year, mm represents the month (01-12), dd represents the day (01-31) and ddd represents the day of the year (001-366).
Table 12. Decimal Numbers for Current Date Format of Operand DATE1P DATE2P DATE3P Format of Constant +yyyymmdd +yyyymm +yyyyddd Example of Constant +20050621 +200506 +2005172
Note: You can precede each of the operands in the table with an & with identical results. Future Date as Decimal Number: DATE1P+d, &DATE1P+d, DATE2P+m, &DATE2P+m, DATE3P+d, or &DATE3P+d can be used to generate a decimal number for a future date relative to the current date of the run. d is days in the future and m is months in the future. d and m can be 0 to 9999. Table 13 on page 106 shows the form of the decimal number constant generated for each future date operand along with an example of the actual decimal number generated when the date of the run is June 21, 2005. yyyy represents the year, mm represents the month (01-12) , dd represents the day (01-31) and ddd represents the day of the year (001-366).
105
Note: You can precede each of the operands in the table with an & with identical results. Past Date as Decimal Number: DATE1P-d, &DATE1P-d, DATE2P-m, &DATE2P-m, DATE3P-d, or &DATE3P-d can be used to generate a decimal number for a past date relative to the current date of the run. d is days in the past and m is months in the past. d and m can be 0 to 9999. Table 14 shows the form of the decimal number constant generated for each past date operand along with an example of the actual decimal number generated when the date of the run is June 21, 2005. yyyy represents the year, mm represents the month (01-12), dd represents the day (01-31) and ddd represents the day of the year (001-366).
Table 14. Decimal Numbers for Past Dates Format of Operand DATE1P-d DATE2P-m DATE3P-d Format of Constant +yyyymmdd +yyyymm +yyyyddd Example of Operand Example of Constant DATE1P-30 DATE2P-12 DATE3P-172 +20050522 +200406 +2004366
Note: You can precede each of the operands in the table with an & with identical results. Character String Format: The format for coding a character string constant is:
Cxx...x
The value x may be any EBCDIC character (the EBCDIC character string is translated appropriately for comparison to an AC or AQ field). You can specify up to 256 characters. If you want to include a single apostrophe in the character string, you must specify it as two single apostrophes. Thus:
Required: O'NEILL Specify: C'O''NEILL'
Examples of valid and invalid character string constants are shown below:
106
Double-byte data may be used in a character string for INCLUDE/OMIT comparisons. The start of double-byte data is delimited by the shift-out (SO) control character (X0E), and the end by the shift-in (SI) control character (X0F). SO and SI control characters are part of the character string and must be paired with zero or an even number of intervening bytes. Nested shift codes are not allowed. All characters between SO and SI must be valid double-byte characters. No single-byte meaning is drawn from the double-byte data. Examples of valid and invalid character string constants containing double-byte characters are shown below using: < to represent SO > to represent SI Dn to represent a double-byte character
Table 15. Valid and Invalid Strings with Double-Byte Data Valid CQ<D1D2>T C<D1D2D3> CQ<D1>R<D2> Invalid CQ<R>S CD1D2D3 CQ<D1<D2>> Explanation Single-byte data within SO/SI Missing SO/SI; treated as single-byte data Nested SO/SI
Tip: X'0E', X'0F', and X'7D' are treated as the special characters shift-out, shift-in, and single apostrophe in a character string. If you dont want to treat one or more of these characters as special in a particular value, use a hexadecimal string instead of a character string. For example, if you want to treat the binary value 000E0E7D as its decimal equivalent of 921213, use X'000E0E7D'; 0E will not be treated as shift-out and 7D will not be treated as a single apostrophe. Current Date as Character String: DATE1, &DATE1, DATE1(c), &DATE1(c), DATE2, &DATE2, DATE2(c), &DATE2(c), DATE3, &DATE3, DATE3(c), &DATE3(c), DATE4, or &DATE4 can be used to generate a character string for the current date of the run. Table 16 on page 108 shows the form of the character string constant generated for each current date operand along with an example of the actual character string generated when the date of the run is June 21, 2005 at 04:42:45 PM, using (/) for (c) where relevant. yyyy represents the year, mm (for date) represents the month (01-12), dd represents the day (01-31), ddd represents the day of the year (001-366), hh represents the hour (00-23), mm (for time) represents the minutes (00-59), ss represents the seconds (00-59), and c can be any character except a blank.
107
Note: You can precede each of the operands in the table with an & with identical results. Tip: When a field is shorter than the character string its compared to, DFSORT truncates the string on the right. You can take advantage of this to compare a field to only part of the DATE4 timestamp when appropriate. For example:
INCLUDE COND=(1,13,CH,GT,DATE4)
would compare the field in positions 1-13 to the truncated DATE4 constant Cyyyy-mm-dd-hh. Future Date as Character String: DATE1+d, &DATE1+d, DATE1(c)+d, &DATE1(c)+d, DATE2+m, &DATE2+m, DATE2(c)+m, &DATE2(c)+m, DATE3+d, &DATE3+d, DATE3(c)+d or &DATE3(c)+d can be used to generate a character string for a future date relative to the current date of the run. d is days in the future and m is months in the future. d and m can be 0 to 9999. Table 17 shows the form of the character string constant generated for each future date operand along with an example of the actual character string generated when the date of the run is June 21, 2005. yyyy represents the year, mm represents the month (01-12), dd represents the day (01-31), ddd represents the day of the year (001-366), and c can be any character except a blank.
Table 17. Character Strings for Future Dates Format of Operand DATE1+d DATE1(c)+d DATE2+m DATE2(c)+m DATE3+d DATE3(c)+d Format of Constant Cyyyymmdd Cyyyycmmcdd Cyyyymm Cyyyycmm Cyyyyddd Cyyyycddd Example of Operand Example of Constant DATE1+11 DATE1(/)+90 DATE2+2 DATE2(.)+25 DATE3+200 DATE3(-)+1 C20050702 C2005/09/19 C200508 C2007.07 C2006007 C2005-171
Note: You can precede each of the operands in the table with an & with identical results. Past Date as Character String: DATE1-d, &DATE1-d, DATE1(c)-d, &DATE1(c)-d, DATE2-m, &DATE2-m, DATE2(c)-m, &DATE2(c)-m, DATE3-d, &DATE3-d, DATE3(c)-d or &DATE3(c)-d can be used to generate a character string for a past date relative to the current date of the run. d is days in the past and m is months in the past. d and m can be 0 to 9999.
108
Note: You can precede each of the operands in the table with an & with identical results. Hexadecimal String Format: The format for coding a hexadecimal string constant is:
Xyy...yy
The value yy represents any pair of hexadecimal digits. You can specify up to 256 pairs of hexadecimal digits. Because the first digit and sign are ignored in a PD0 field, you should not include the first digit or sign in a hexadecimal constant to be compared to a PD0 field. For example, 3-byte PD0 values like X'01234C' and X'01234D' would be equal to a hexadecimal constant of X'1234'. Examples of valid and invalid hexadecimal constants are shown in the following table.
Valid X'ABCD' X'BF3C' X'AF050505' X'BF3C' Invalid X'ABGD' X'BF3' AF050505 BF3CX Explanation Invalid hexadecimal digit Incomplete pair of digits Missing X identifier X identifier in wrong place
109
This example illustrates how to only include records in which: v The floating sign number in bytes 5 through 12 is greater than the floating sign number in bytes 13 through 20 OR v The floating sign number in bytes 105 through 108 is less than or equal to 1000. Note that all three compare fields have the same format.
Example 2
INCLUDE COND=(1,10,CH,EQ,C'STOCKHOLM', AND,21,8,ZD,GT,+50000, OR,31,4,CH,NE,C'HERR')
This example illustrates how to only include records in which: v The first 10 bytes contain STOCKHOLM (this nine-character string was padded on the right with a blank) AND the zoned-decimal number in bytes 21 through 28 is greater than 50 000 OR v Bytes 31 through 34 do not contain HERR. Note that the AND is evaluated before the OR. ( Omitting Records from the Output Data SetExample on page 170 illustrates how parentheses can be used to change the order of evaluation.) Also note that ending a line with a comma or semicolon followed by a blank indicates that the parameters continue on the next line, starting in any position from columns 2 through 71.
110
Example 3
INCLUDE FORMAT=CH, COND=((5,1,EQ,8,1),&, ((20,1,EQ,C'A',&,30,1,FI,GT,10),|, (20,1,EQ,C'B',&,30,1,FI,LT,100),|, (20,1,NE,C'A',&,20,1,NE,C'B')))
This example illustrates how to only include records in which: v Byte 5 equals byte 8 AND v At least one of the following is true: Byte 20 equals A and byte 30 is greater than 10 Byte 20 equals B and byte 30 is less than 100 Byte 20 is not equal to A or B. Note that p,m,FI is used for the FI fields, and p,m with FORMAT=CH is used for all of the CH fields. With FORMAT=f, you can mix p,m and p,m,f fields when thats convenient such as when all or most of the fields have the same format (although you can always code p,m,f for all fields and not use FORMAT=f, if you prefer).
Example 4
INCLUDE COND=(7,2,CH,EQ,C'T1',OR, (1,2,BI,GE,X'001A',AND,20,2,CH,EQ,25,2,CH))
This example shows the effects of VLSCMP/NOVLSCMP and VLSHRT/NOVLSHRT on INCLUDE processing when short records are present. Consider the records shown in Figure 11 on page 112: v If VLSCMP is in effect, the first record is included because bytes 7-8 are equal to CT1, even though the comparison of bytes 20-21 to 25-26 involves short fields. The second record is included or omitted based on the comparison of bytes 20-21 to bytes 25-26. v If NOVLSCMP and VLSHRT are in effect, the first record is omitted because the comparison of bytes 20-21 to 25-26 involves short fields. The second record is included or omitted based on the comparison of bytes 20-21 to bytes 25-26. v If NOVLSCMP and NOVLSHRT are in effect, the first record causes message ICE015A or ICE218A to be issued because the comparison of bytes 20-21 to bytes 25-26 involves short fields.
111
RDW
compare field A
compare field B
T1 7 RDW T2 7
Figure 11. Sample Records
20
25
Example 5
INCLUDE COND=(21,8,ZD,GT,DATE1P)
This example illustrates how to include records in which a zoned-decimal date of the form Zyyyymmdd in bytes 21-28 is greater than todays date. DATE1P generates a decimal number for the current date in the form +yyyymmdd.
Example 6
INCLUDE COND=(15,7,CH,GE,DATE3-7,AND,15,7,CH,LE,DATE3+7)
This example illustrates how to include records in which a character date of the form Cyyyyddd in bytes 15-21 is between 7 days in the past and 7 days in the future, relative to the current date. DATE3-7 generates a character constant in the form Cyyyyddd where yyyyddd is the current date minus 7 days. DATE3+7 generates a character constant in the form Cyyyyddd where yyyyddd is the current date plus 7 days.
Example 7
INCLUDE COND=(21,10,CH,GE,DATE1(-)-365)
This example illustrates how to include records in which a character date of the form Cyyyy-mm-dd in bytes 21-30 is within 365 days of the current date. DATE1(-)-365 generates a character constant in the form Cyyyy-mm-dd where yyyymmdd is the current date minus 365 days.
112
(p1,m1,SS,
EQ NE
, constant )
(p1,m1, SS,
EQ NE
, constant )
Restriction: FORMAT=SS can precede COND but cannot follow it. Substring comparison operators are as follows: EQ Equal to NE Not equal to Fields: p1,m1: These variables specify the character field in the input record for the substring test. v p1 specifies the first byte of the character input field for the substring test, relative to the beginning of the input record.6 The first data byte of a fixed-length record (FLR) has relative position 1. The first data byte of a variable-length (VLR) record has relative position 5 (because the first 4 bytes contain the record descriptor word). All fields to be tested must start on a byte boundary and must not extend beyond byte 32752. v m1 specifies the length of the field to be tested. The length can be 1 to 32752 bytes. Constant: The constant can be a character string or a hexadecimal string. See Character String Format on page 106 and Hexadecimal String Format on page 109 for details. If m1 is greater than the length of the constant, the field value will be searched for the constant and the condition will be true if a match is found when the EQ comparison operator is specified or if a match is not found when the NE comparison operator is specified. If m1 is smaller than the length of the constant, the constant will be searched for the field value and the condition will be true if a match is found when the EQ comparison operator is specified or if a match is not found when the NE comparison operator is specified.
6. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit. Chapter 3. Using DFSORT Program Control Statements
113
This example illustrates how to include only records in which: v OK is found somewhere within bytes 11 through 6010 OR v Bytes 5 through 7 contain J69, L92 or J82.
(p1,m1,BI,
, mask )
114
Bit operators describe the input field to mask relationship to be tested as follows: ALL or BO All mask bits are on in the input field SOME or BM Some, but not all mask bits are on in the input field NONE or BZ No mask bits are on in the input field NOTALL or BNO Some or no mask bits are on in the input field NOTSOME or BNM All or no mask bits are on in the input field NOTNONE or BNZ All or some mask bits are on in the input field The first set of operators (ALL, SOME, and so on) are intended for those who like meaningful mnemonics. The second set of operators (BO, BM, and so on) are intended for those familiar with the conditions associated with the Test Under Mask (TM) instruction.
Fields
p1,m1: These variables specify the binary field in the input record to be tested against the mask. v p1 specifies the first byte of the binary input field to be tested against the mask, relative to the beginning of the input record.7 The first data byte of a fixed-length record (FLR) has relative position 1. The first data byte of a variable-length (VLR) record has relative position 5 (because the first 4 bytes contain the record descriptor word). All fields to be tested must start on a byte boundary and must not extend beyond byte 32752. v m1 specifies the length of the field to be tested. The length can be 1 to 256 bytes.
Mask
A hexadecimal string or bit string that indicates the bits in the field selected for testing. If a mask bit is on (1), the corresponding bit in the field is tested. If a mask bit is off (0), the corresponding bit in the field is ignored. Hexadecimal String Format: The format for coding a hexadecimal string mask is:
Xyy...yy
7. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit. Chapter 3. Using DFSORT Program Control Statements
115
The value bbbbbbbb represents 8 bits that constitute a byte. Each bit must be 1 (test bit) or 0 (ignore bit). You can specify up to 256 groups of 8 bits. The total number of bits in the mask must be a multiple of 8. A bit mask string can only be used with a bit operator.
This example illustrates how to only include records in which: v Byte 27 contains D AND v Byte 18 has bit 0 on.
Example 2
INCLUDE COND=(11,1,BI,BM,X'85')
This example illustrates how to only include records in which byte 11 has some, but not all of bits 0, 5 and 7 on. Results for selected field values are shown below:
Table 19. Bit Comparison Example 2: Results for Selected Field Values 11,1,BI Value X85 XC1 X84 X00 11,1,BI Result False True True False Action Omit Record Include Record Include Record Omit Record
Example 3
INCLUDE COND=(11,2,ALL,B'0001001000110100', OR,21,1,NONE,B'01001100'),FORMAT=BI
This example illustrates how to only include records in which: v Bytes 11 through 12 have all of bits 3, 6, 10, 11 and 13 on OR v Byte 21 has none of bits 1, 4, or 5 on.
116
(p1,m1,BI,
EQ NE
, constant )
(p1,m1, BI,
EQ NE
, constant )
Fields
p1,m1: These variables specify the binary field in the input record to be compared to the bit constant. v p1 specifies the first byte of the binary input field to be compared to the bit constant, relative to the beginning of the input record.8 The first data byte of a fixed-length record (FLR) has relative position 1. The first data byte of a variable-length (VLR) record has relative position 5 (because the first 4 bytes contain the record descriptor word). All fields to be tested must start on a byte boundary and must not extend beyond byte 32752. v m1 specifies the length of the field to be tested. The length can be 1 to 256 bytes.
8. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit. Chapter 3. Using DFSORT Program Control Statements
117
Bit Constant
A bit string constant that specifies the pattern to which the binary field is compared. If a bit in the constant is 1 or 0, the corresponding bit in the field is compared to 1 or 0, respectively. If a bit in the constant is . (period), the corresponding bit in the field is ignored. Bit String Format: The format for coding a bit string constant is:
Bbbbbbbbb...bbbbbbbb
The value bbbbbbbb represents 8 bits that constitute a byte. Each bit must be 1 (test bit for 1), 0 (test bit for 0) or . (ignore bit). You can specify up to 256 groups of 8 bits. The total number of bits in the mask must be a multiple of 8. A bit constant can only be used for bit comparison tests (BI format and EQ or NE operator).
This example illustrates how to only include records in which: v Byte 27 contains D AND v Byte 18 is equal to the specified pattern of bit 0 on.
Example 2
INCLUDE COND=(11,1,BI,NE,B'10...1.1')
This example illustrates how to only include records in which byte 11 is not equal to the specified pattern of bit 0 on, bit 1 off, bit 5 on and bit 7 on. Results for selected field values are shown below:
Table 21. Bit Comparison Example 2: Results for Selected Field Values 11,1,BI Value X85 XC1 X84 X97 11,1,BI Result False True True False Action Omit Record Include Record Include Record Omit Record
118
Example 3
INCLUDE COND=(11,2,EQ,B'..01....0......1', OR,21,1,EQ,B'01......'),FORMAT=BI
This example illustrates how to only include records in which: v Bytes 11 through 12 are equal to the specified pattern of bit 2 off, bit 3 on, bit 8 off and bit 15 on OR v Byte 21 is equal to the specified pattern of bit 0 off and bit 1 on. Results for selected field values are shown below:
Table 22. Bit Comparison Example 3: Results for Selected Field Values 11,2,BI Value X1221 X02C4 X1234 X5F7F XFFFF 11,2,BI Result True False False True False 21,1,BI Value XC0 X41 X00 X7F X2F 21,1,BI Result False True False True False Action Include Record Include Record Omit Record Include Record Omit Record
Date Comparisons
You can use DFSORTs Y2 formats in conjunction with the century window in effect, as follows: v Use the full date formats (Y2T, Y2U, Y2V, Y2W, Y2X and Y2Y) to compare a two-digit year date field to a two-digit year date constant, a current, future or past two-digit year date (Y constant), or to another two-digit year date field. v Use the year formats (Y2C, Y2Z, Y2S, Y2P, Y2D and Y2B) to compare a two-digit year field to a two-digit year constant (Y constant) or to another two-digit year field. For example, you can include only those records for which a Zyymm date field is between January 1996 and March 2005. Or you can include only those records for which a Pdddyy field is less than another Pdddyy field. Or you can include only those records for which a Cyyddd field is between todays date and 5 days earlier than todays date. The ordering of dates and special indicators used for comparisons with Y2 fields and Y constants is the same as the ascending orders for sorting and merging Y2 fields (see SORT Control Statement on page 418 for details).
119
(p1,m1, Y2x,
EQ NE GT GE LT LE
Comparison operators are as follows: 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. Fields: p1,m1,Y2x: These variables specify a two-digit year date field in the input record to be compared either to another two-digit year date field in the input record or to a two-digit year date constant. v p1 specifies the first byte of the date field relative to the beginning of the input record.9 The first data byte of a fixed-length record (FLR) has relative position 1. The first data byte of a variable-length (VLR) record has relative position 5 (because the first 4 bytes contain the record descriptor word). All date fields must start on a byte boundary, and no date field can extend beyond byte 32752. v m1 specifies the length of the date field. Appendix C, Data Format Descriptions, on page 815 describes the length and format for each type of date field. v Y2x specifies the Y2 format. Appendix C, Data Format Descriptions, on page 815 describes the length (m) and format (Y2x) for each type of date field. You can use p1,m1 rather than p1,m1,Y2x if you use FORMAT=Y2x to supply the format for the date field. p2,m2,Y2x: These variables specify another two-digit year date field in the input record with which the p1,m1,Y2x field will be compared.
9. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.
120
5,Y2T 5,Y2W
3,Y2U 3,Y2X
6,Y2T 6,Y2W
4,Y2V 4,Y2Y
yy
Y constants for current, future, and past two-digit year dates are as follows. d can be 0 to 9999 days and m can be 0 to 9999 months. v YDATE1 generates a Y constant for the current date in the form Yyymmdd v YDATE1+d generates a Y constant for the current date plus d days in the form Yyymmdd v YDATE1-d generates a Y constant for the current date minus d days in the form Yyymmdd v YDATE2 generates a Y constant for the current date in the form Yyymm v YDATE2+m generates a Y constant for the current date plus m months in the form Yyymm v YDATE2-m generates a Y constant for the current date minus m months in the form Yyymm v YDATE3 generates a Y constant for the current date in the form Yyyddd v YDATE3+d generates a Y constant for the current date plus d days in the form Yyyddd v YDATE3-d generates a Y constant for the current date minus d days in the form Yyyddd. You must use the same number of digits in a Y constant as the type of date; leading zeros must be specified (for example, for Yyymm, use Y0001 for January 2000 and Y0501 for January 2005).
Chapter 3. Using DFSORT Program Control Statements
121
This example illustrates how to only include records in which: v A Cyymm date field in bytes 3 through 6 is between January 1999 and December 2003 OR v Bytes 3 through 6 contain CH zeros (C0000), ZD zeros (Z0000) or BI zeros (X'00000000'). Note that the century window in effect will be used to interpret the Y9901 and Y0312 date constants, as well as real dates in the Cyymm date field. However, the century window will not be used to interpret the Y0000 special indicator constant or special indicators in the Cyymm date field.
Example 2
INCLUDE COND=(2,3,Y2X,LT,36,5,Y2T)
This example illustrates how to only include records in which a Pdddyy date field in bytes 2 through 4 is less than a Zyyddd date field in bytes 36 through 40. Note that the century window in effect will be used to interpret real dates in the Pdddyy and Zyyddd date fields. However, the century window will not be used to interpret special indicators in the Pdddyy and Zyyddd date fields.
Numeric Tests
You can test a field for numerics or non-numerics in character, zoned decimal or packed decimal format. For example, you can include only those records in which a 5-byte field contains only 0-9 characters (that is, character numerics). Or you can include only those records in which a 9-byte field contains invalid zoned decimal data (that is, zoned decimal non-numerics). Or you can include only those records in which a 12-byte field contains valid packed decimal data (that is, packed decimal numerics). A field to be tested for numerics in character format looks like this in hexadecimal:
FdFd...Fd
The field is considered to be character numeric if every d is 0-9. (This is equivalent to 0-9 for each character.) Otherwise, the field is considered to be character
122
The field is considered to be zoned decimal numeric if every z is F, every d is 0-9, and s is C, D or F. Otherwise, the field is considered to be zoned decimal non-numeric. For example, 1234 (XF1F2F3F4), 123D (XF1F2F3C4) and 123M (XF1F2F3D4) are all considered to be zoned decimal numeric, whereas A234 (XC1F2F3F4), 12.3 (XF1F24BF3) and 123X (XF1F2F3E7) are all considered to be zoned decimal non-numeric. A field to be tested for numerics in packed decimal format looks like this in hexadecimal:
dddd...ds
The field is considered to be packed decimal numeric if every d is 0-9, and s is C, D or F. Otherwise, the field is considered to be packed decimal non-numeric. For example, X12345C, X12345D and X12345F are all considered to be packed decimal numeric, whereas XA2345C, X1B345D and X12F45F are all considered to be packed decimal non-numeric.
(p1,m1,f1,
EQ NE
,NUM)
(p1,m1, f1,
EQ NE
,NUM)
Numeric test operators are as follows: EQ Equal to numerics NE Not equal to numerics (non-numerics) Fields: p1,m1,f1: These variables specify the field in the input record for the numeric test. v p1 specifies the first byte of the field relative to the beginning of the input record 10. The first data byte of a fixed-length record (FLR) has relative position 1. The first data byte of a variable-length (VLR) record has relative position 5
10. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit. Chapter 3. Using DFSORT Program Control Statements
123
You can use p1,m1 rather than p1,m1,f1, if you use FORMAT=f to supply the format for the field. NUM: Specifies a test for numerics or non-numerics. The condition will be true if the field is numeric when the EQ operator is specified or if the field is non-numeric when the NE operator is specified.
This example illustrates how to only include records in which the field in bytes 1 through 20 contains valid character numeric data (that is, 0-9 in all bytes).
Example 2
INCLUDE COND=(21,8,ZD,NE,NUM,OR,31,5,PD,NE,NUM)
This example illustrates how to only include records in which the field in bytes 21 through 28 contains invalid zoned decimal data, or the field in bytes 31 through 35 contains invalid packed decimal data (that is, one of the fields is non-numeric).
124
OMIT
False
INCLUDE
True
INCLUDE
False
|
INREC PARSE=(
FIELDS= BUILD=
item
FINDREP=( ,
IFTHEN=(clause) IFOUTLEN=n
The INREC control statement allows you to reformat the input records before they are sorted, merged, or copied. The INREC control statement supports a wide variety of parsing, editing, and reformatting tasks, including:
125
v OVERLAY: Reformat each record by specifying just the items that overlay specific columns. Overlay lets you change specific existing columns without affecting the entire record. Example:
INREC OVERLAY=(45:45,8,TRAN=LTOU)
| | | |
v FINDREP: Reformat each record by doing various types of find and replace operations. Example:
INREC FINDREP=(IN=C'Mr.',OUT=C'Mister')
v IFTHEN clauses: Reformat different records in different ways by specifying how build, overlay, find/replace, or group operation items are applied to records that meet given criteria. IFTHEN clauses let you use sophisticated conditional logic to choose how different record types are reformatted. Example:
126
You can choose to include any or all of the following items in your reformatted INREC records: v Fixed position/length fields or variable position/length fields. For fixed fields, you specify the starting position and length of the field directly. For variable fields, such as delimited fields, comma separated values (CSV), tab separated values, blank separated values, keyword separated fields, null-terminated strings (and many other types), you define rules that allow DFSORT to extract the relevant data into fixed parsed fields, and then use the parsed fields as you would use fixed fields. v Blanks, binary zeros, character strings, and hexadecimal strings v Current date, future date, past date, and current time in various forms v Unedited input fields aligned on byte, halfword, fullword, and doubleword boundaries | v Replaced or removed strings. v Hexadecimal representations of binary input fields v Left-justified, right-justified, left-squeezed, or right-squeezed input fields. v Numeric input fields of various formats converted to different numeric formats, or to character format edited to contain signs, thousands separators, decimal points, leading zeros or no leading zeros, and so on. v Decimal constants converted to different numeric formats, or to character format edited to contain signs, thousands separators, decimal points, leading zeros or no leading zeros, and so on. v The results of arithmetic expressions combining fields, decimal constants, operators (MIN, MAX, MUL, DIV, MOD, ADD and SUB) and parentheses converted to different numeric formats, or to character format edited to contain signs, thousands separators, decimal points, leading zeros or no leading zeros, and so on. v SMF, TOD and ETOD date and time fields converted to different numeric formats, or to character format edited to contain separators, leading zeros or no leading zeros, and so on. v Two-digit year input dates of various formats converted to four-digit year dates in different numeric formats, or to character format edited to contain separators, leading zeros or no leading zeros, and so on. v Sequence numbers in various formats. v A character constant, hexadecimal constant or input field selected from a lookup table, based on a character, hexadecimal or bit constant as input. | | v A zoned decimal group identifier, a zoned decimal group sequence number, or a field propagated from the first record of a group to all of the records of a group. For information concerning the interaction of INREC and OUTREC, see INREC Statement Notes on page 148. PARSE
127
This operand allows you to extract variable position/length fields into fixed parsed fields. Parsed fields (%nn) can be used where fixed position/length fields (p,m) can be used in the BUILD (or FIELDS) or OVERLAY operands as described later in this sect ion. PARSE can be used for many different types of variable fields including delimited fields, comma separated values (CSV), tab separated values, blank separated values, keyword separated fields, null-terminated strings, and so on. You can assign up to 100 %nn parsed fields (%00-%99) to the variable fields you want to extract. Note that if all of the fields in your records have fixed positions and lengths, you dont need to use PARSE. But if any of the fields in your records have variable positions or lengths, you can use PARSE to treat them as fixed parsed fields in BUILD or OVERLAY. You can mix p,m fields (fixed fields) and %nn fields (parsed fields) in BUILD and OVERLAY. See PARSE under OUTFIL Control Statements for complete details. Sample Syntax
INREC PARSE=(%00=(ENDBEFR=C'*',FIXLEN=3), %01=(ENDBEFR=BLANKS,FIXLEN=6), %02=(STARTAT=C'MAX',FIXLEN=8), %03=(STARTAFT=C'(',ENDBEFR=C')',FIXLEN=6), %04=(STARTAFT=BLANKS,FIXLEN=5)), BUILD=(%03,X,%03,HEX,21:%02,31:%01,SFF,M26,LENGTH=7, 18,6,%00,UFF,M11,LENGTH=3,%04,JFY=(SHIFT=RIGHT))
Default for PARSE: None; must be specified. See Appendix B, Specification/Override of DFSORT Options, on page 787. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. FIELDS or BUILD
128
Specifies all of the items in the reformatted INREC record in the order in which they are to be included. The reformatted INREC record consists of the separation fields, edited and unedited input fields (p,m for fixed fields, or %nn for parsed fields - see PARSE),, edited decimal constants, edited results of arithmetic expressions, and sequence numbers you select, in the order in which you select them, aligned on the boundaries or in the columns you indicate. For variable-length records, the first item in the BUILD or FIELDS parameter must specify or include the unedited 4-byte record descriptor word (RDW), that is, you must start with 1,m with m equal to or greater than 4. If you want to include the bytes from a specific position to the end of each input record at the end of each reformatted output record, you can specify that starting position (p) as the last item in the BUILD or FIELDS parameter. For example:
Chapter 3. Using DFSORT Program Control Statements
129
For fixed-length records, the first input and output data byte starts at position 1. For variable-length records, the first input and output data byte starts at position 5, after the RDW in positions 1-4. c: Specifies the position (column) for a separation field, input field, decimal constant, arithmetic expression, or sequence number, relative to the start of the reformatted input record. Unused space preceding the specified column is padded with EBCDIC blanks. The following rules apply: v c must be a number between 1 and 32752. v c: must be followed by a separation field, input field, decimal constant, or arithmetic expression. v c must not overlap the previous input field or separation field in the reformatted input record. v for variable-length records, c: must not be specified before the first input field (the record descriptor word) nor after the variable part of the input record. v The colon (:) is treated like the comma (,) or semicolon (;) for continuation to another line. Both valid and invalid examples are shown in Table 25.
Table 25. Examples of Valid and Invalid Column Alignment Validity Valid Valid Specified 33:CState 20:5,4,30:10,8 Result Columns 1-32 blank Columns 33-38 State Columns Columns Columns Columns 1-19 blank 20-23 input field (5,4) 24-29 blank 30-37 input field (10,8)
Column value cannot be zero. Column value must be specified. Invalid column value must be less than 32753. Column values cannot be adjacent. Column value overlaps previous field.
Specifies that a separation field (blanks, zeros, character string, hexadecimal string, current date, future date, past date, or current time) is to appear in the reformatted input record. It can be specified before or after any input field. Consecutive separation fields can be specified. For variable-length records, separation fields must not be specified before the first input field (the record descriptor word), or after the variable part of the input record. Permissible values are nX, nZ, nCxx...x, nXyy...yy, and various date and time constants. nX Blank separation. n bytes of EBCDIC blanks (X'40') are to appear in the reformatted input records. n can range from 1 to 4095. If n is omitted, 1 is used. Examples of valid and invalid blank separation are shown in Table 26 on page 131.
130
nZ
Binary zero separation. n bytes of binary zeros (X'00') are to appear in the reformatted input records. n can range from 1 to 4095. If n is omitted, 1 is used. Examples of valid and invalid binary zero separation are shown in Table 27.
Table 27. Examples of Valid and Invalid Binary Zero Separation Validity Valid Valid Invalid Invalid Specified Z or 1Z 4095Z 4450Z 0Z Result 1 binary zero 4095 binary zeros Too many repetitions. Use two adjacent separation fields instead (4000Z,450Z for example). 0 is not allowed.
nCxx...x
Character string separation. n repetitions of the character string constant (Cxx...x) are to appear in the reformatted input records. n can range from 1 to 4095. If n is omitted, 1 is used. x can be any EBCDIC character. You can specify from 1 to 256 characters. If you want to include a single apostrophe in the character string, you must specify it as two single apostrophes:
Required: O'NEILL Specify: C'O''NEILL'
Examples of valid and invalid character string separation are shown in Table 28.
Table 28. Examples of Valid and Invalid Character String Separation Validity Valid Valid Valid Valid Valid Valid Valid Invalid Invalid Invalid Specified CJohn Doe CJOHN DOE C$@# C+0.193 4000C Result John Doe JOHN DOE $@# +0.193 8000 blanks **FILLER** repeated 20 times Franks Apostrophes not paired C identifier missing Apostrophe missing Length 8 8 3 6 8000 200 7 n/a n/a n/a
131
0CABC C CFranks
nX'yy...yy'
Hexadecimal string separation. n repetitions of the hexadecimal string constant (X'yy...yy') are to appear in the reformatted input records. n can range from 1 to 4095. If n is omitted, 1 is used. The value yy represents any pair of hexadecimal digits. You can specify from 1 to 256 pairs of hexadecimal digits. Examples of valid and invalid hexadecimal string separation are shown in Table 29.
Table 29. Examples of Valid and Invalid Hexadecimal String Separation Validity Valid Valid Valid Valid Invalid Invalid Invalid Invalid Invalid Specified X'FF' X'BF3C' 3X'00000F' 4000X'FFFF' X'ABGD' X'F1F' BF3C F2F1X 8000X'01' Result FF BF3C 00000F00000F00000F FF repeated 8000 times G is not a hexadecimal digit Incomplete pair of digits X identifier missing X in wrong place Too many repetitions. Use two adjacent separation fields instead (4000X'01',4000X'01', for example). 0 is not allowed No hexadecimal digits specified Length 1 2 9 8000 n/a n/a n/a n/a n/a
Invalid Invalid
0X'23AB' X''
n/a n/a
DATEn, DATEn(c), DATEnP Constant for current date. The current date of the run is to appear in the reformatted input records. See DATEn, DATEn(c), DATEnP under OUTFIL OUTREC for details. &DATEn, &DATEn(c), &DATEnP Can be used instead of DATEn, DATEn(c) and DATEnP, respectively. DATEn+r, DATEn(c)+r, DATEnP+r Constant for future date. A future date relative to the current date of the run is to appear in the reformatted input records. See DATEn+r, DATEn(c)+r, DATEnP+r under OUTFIL OUTREC for details. &DATEn+r, &DATEn(c)+r, &DATEnP+r Can be used instead of DATEn+r, DATEn(c)+r and DATEnP+r, respectively.
132
133
F D
Alignment can be necessary if, for example, the data is to be used in a COBOL application program where items are aligned through the SYNCHRONIZED clause. Unused space preceding aligned fields will always be padded with binary zeros. %nn specifies that an unedited parsed input field is to appear in the reformatted input record. See PARSE for details of parsed fields. See p,m,a for further details. Note that alignment (H, F, D) is not permitted for %nn fields (for example, %nn,F results in an error message and termination). p specifies that the unedited variable part of the input record (that part beyond the minimum record length), is to appear in the reformatted input record, as the last field. p without m can only be used for variable-length records; not for fixed-length records.
11. If your E15 user exit reformats the record, p must refer to the record as reformatted by the exit.
134
135
p,m,Y2x specifies that the four-digit year CH date representation of a two-digit year input date field is to appear in the reformatted input record. Real dates are transformed using the century window established by the Y2PAST option in effect. The century window is not used for special indicators; they are just expanded appropriately (for example, p,6,Y2T transforms C000000 to C00000000). See p,m,Y2x under OUTFIL OUTREC for details. Sample Syntax:
INREC FIELDS=(21,3,Y2V,X,12,5,Y2W)
%nn,Y2x specifies that the four-digit year CH date representation of a two-digit year parsed input date field is to appear in the reformatted input record. See PARSE for details of parsed fields. See p,m,Y2x for further details. p,m,Y2x(c) specifies that the four-digit year CH date representation with separators of a two-digit year input date field is to appear in the reformatted input record. Real dates are transformed using the century window established by the Y2PAST option in effect. The century window is not used for special indicators; they are just expanded appropriately (for example, p,6,Y2T(/) transforms C000000 to C0000/00/00). See p,m,Y2x(c) under OUTFIL OUTREC for details.
136
%nn,Y2x(c) specifies that the four-digit year CH date representation with separators of a two-digit year parsed input date field is to appear in the reformatted input record. See PARSE for details of parsed fields. See p,m,Y2x(c) for further details. p,m,Y2xP specifies that the four-digit year PD date representation of a two-digit year input date field is to appear in the reformatted input record. Real dates are transformed using the century window established by the Y2PAST option in effect. The century window is not used for special indicators; they are just expanded appropriately (for example, p,6,Y2TP transforms C000000 to P00000000). See p,m,Y2xP under OUTFIL OUTREC for details. Sample Syntax:
INREC FIELDS=(11,3,Y2XP,X,21,4,Y2WP)
%nn,Y2xP specifies that the four-digit year PD date representation of a two-digit year parsed input date field is to appear in the reformatted input record. See PARSE for details of parsed fields. See p,m,Y2xP for further details. p,m,f,edit or (p,m,f),edit specifies that an edited numeric input field is to appear in the reformatted input record. You can edit BI, FI, PD, PD0, ZD, FL, CSF, FS, UFF, SFF, DC1, DC2, DC3, DE1, DE2, DE3, DT1, DT2, DT3, TC1, TC2, TC3, TC4, TE1, TE2, TE3, TE4, TM1, TM2, TM3 or TM4 fields using either pre-defined edit masks (M0-M26) or specific edit patterns you define. You can control the way the edited fields look with respect to length, leading or suppressed zeros, thousands separators, decimal points, leading and trailing positive and negative signs, and so on. See p,m,f,edit under OUTFIL OUTREC for details. Sample Syntax:
INREC FIELDS=(5:21,8,ZD,M19,X,46,5,ZD,M13, 31:(35,6,FS),SIGNS=(,,+,-),LENGTH=10, 51:8,4,PD,EDIT=(**II,IIT.TTXS),SIGNS=(,,+,-))
%nn,f,edit or (%nn,f),edit specifies that an edited numeric parsed input field is to appear in the reformatted input record. See PARSE for details of parsed fields. See p,m,f,edit or (p,m,f),edit for further details. p,m,f,to or (p,m,f),to specifies that a converted numeric input field is to appear in the reformatted input record. You can convert BI, FI, PD, PD0, ZD, FL, CSF, FS, UFF, SFF, DC1, DC2, DC3, DE1, DE2, DE3, DT1, DT2, DT3, TC1, TC2, TC3, TC4, TE1, TE2, TE3, TE4, TM1, TM2, TM3, or TM4 fields to BI, FI, PD, PDC, PDF, ZD, ZDF, ZDC, or CSF/FS fields. See p,m,f,to under OUTFIL OUTREC for details. Sample Syntax:
INREC FIELDS=(21,5,ZD,TO=PD,X,(8,4,ZD),FI,LENGTH=2,X,55,4,FL,TO=FS)
137
deccon,to or (deccon),to specifies that a converted decimal constant is to appear in the reformatted input record. The decimal constant must be in the form +n or n where n is 1 to 31 decimal digits. The sign (+ or ) must be specified. A decimal constant produces a signed, 31-digit zoned decimal (ZD) result to be converted as specified. See deccon,to under OUTFIL OUTREC for details. Sample Syntax:
INREC FIELDS=(+0,TO=PD,LENGTH=6,3Z,(-512000),FI)
arexp,edit or (arexp),edit specifies that the edited result of an arithmetic expression is to appear in the reformatted input record. The arithmetic expression can consist of input fields, decimal constants, operators and parentheses. An arithmetic expression produces a signed, 31-digit zoned decimal (ZD) result to be edited as specified. See arexp,edit under OUTFIL OUTREC for details. Sample Syntax:
INREC FIELDS=(C'**',27,2,FI,MIN, 83,4,PD,EDIT=(STTTTTTT),SIGNS=(+,-), 15:(((15,5,ZD,ADD,+1),MUL,+100),DIV,62,2,PD),M25,LENGTH=10)
arexp,to or (arexp),to specifies that the converted result of an arithmetic expression is to appear in the reformatted input record. The arithmetic expression can consist of input fields, decimal constants, operators and parentheses. An arithmetic expression produces a signed, 31-digit zoned decimal (ZD) result to be converted as specified. See arexp,to under OUTFIL OUTREC for details. Sample Syntax:
INREC FIELDS=((15,6,FS,SUB,+5),ADD,(-1,MUL,36,6,FS),ZD,X, 3,2,FI,MIN,-6,LENGTH=4,TO=PD)
p,m,Y2x,edit specifies that an edited four-digit year CH date representation of a two-digit year input date field is to appear in the reformatted input record. See p,m,Y2x,edit under OUTFIL OUTREC for details.
138
p,m,justify specifies that a left-justified or right-justified input field is to appear in the reformatted input record. For a left-justified field, leading blanks are removed and the characters from the first nonblank to the last nonblank are shifted left, with blanks inserted on the right if needed. For a right-justified field, trailing blanks are removed and the characters from the last nonblank to the first nonblank are shifted right, with blanks inserted on the left if needed. Optionally: v specific leading and trailing characters can be changed to blanks before justification begins v a leading string can be inserted v a trailing string can be inserted v the output length can be changed (its equal to the input length by default) See p,m,justify under OUTFIL OUTREC for details. Sample Syntax:
139
%nn,justify specifies that a left-justified or right-justified parsed input field is to appear in the reformatted input record. See PARSE for details of parsed fields. See p,m,justify for further details. p,m,squeeze specifies that a left-squeezed or right-squeezed input field is to appear in the reformatted input record. For a left-squeezed field, all blanks are removed and the characters from the first nonblank to the last nonblank are shifted left, with blanks inserted on the right if needed. For a right-squeezed field, all blanks are removed and the characters from the last nonblank to the first nonblank are shifted right, with blanks inserted on the left if needed. Optionally: v specific characters can be changed to blanks before squeezing begins v a leading string can be inserted v a trailing string can be inserted v a string (for example, a comma delimiter) can be inserted wherever a group of blanks is removed between the first nonblank and the last nonblank v blanks can be kept as is between paired apostrophes (AB CD EF) or paired quotes (AB CD EF) v the output length can be changed (its equal to the input length by default) See p,m,squeeze under OUTFIL OUTREC for details. Sample Syntax:
INREC FIELDS=(21,20,SQZ=(SHIFT=LEFT),5X, 152,18,SQZ=(SHIFT=RIGHT,PREBLANK=X'00', LEAD=C'<',MID=C',',TRAIL=C'>',PAIR=APOST))
%nn,squeeze specifies that a left-squeezed or right-squeezed parsed input field is to appear in the reformatted input record. See PARSE for details of parsed fields. See p,m,squeeze for further details. seqnum specifies that a sequence number is to appear in the reformatted input record. The sequence numbers are assigned in the order in which the records are received for INREC processing. You can create BI, PD, ZD, CSF, or FS sequence numbers and control their lengths, starting values and increment values. You can restart the sequence number at the start value each time a specified input field (p,m) or parsed input field (%nn) changes. See seqnum under OUTFIL OUTREC for details. Sample Syntax:
INREC FIELDS=(1,80,SEQNUM,8,ZD)
Default for BUILD or FIELDS: None; must be specified. See Appendix B, Specification/Override of DFSORT Options, on page 787. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. OVERLAY
140
Specifies each item that is to overlay specific columns in the reformatted record. Columns that are not overlaid remain unchanged. If you want to insert, rearrange, or delete fields, use BUILD or FIELDS rather than OVERLAY. Use OVERLAY only to overlay existing columns or to add fields at the end of every record. OVERLAY can be easier to use then BUILD or FIELDS when you just want to change a few fields without rebuilding the entire record. For fixed-length records, the first input and output data byte starts at position 1. For variable-length records, the first input and output data byte starts at position 5, after the RDW in positions 1-4. Use c: (column) to specify the output positions to be overlaid. If you do not specify c: for the first item, it defaults to 1:. If you do not specify c: for any other item, it starts after the previous item. For example, if you specify:
INREC OVERLAY=(25,2,11:C'A',15,3,C'**')
141
and input position 5 has A. The second item (UTOL) would change A to a and the third item (CHANGE) would change a again to X. If you specify an OVERLAY item that extends the overlay record beyond the end of the input record, the reformatted record length is automatically increased to that length, and blanks are filled in on the left as needed. For variable-length records, the RDW length is also increased to correspond to the larger reformatted record length after all of the OVERLAY items are processed. For example, if your input record has a length of 40 and you specify:
INREC OVERLAY=(16:C'ABC',51:5C'*',35:15,2)
the output record is given a length of 55. Blanks are filled in from columns 41-50. For variable-length records, the length in the RDW is changed from 40 to 55 after all of the OVERLAY items are processed. Missing bytes in specified input fields are replaced with blanks so the padded fields can be processed. See INREC FIELDS for details of the items listed in the OVERLAY syntax diagram above. You can specify all of the items for OVERLAY in the same way that you can specify them for BUILD or FIELDS with the following exceptions: v You cannot specify p or p,HEX or p,TRAN=value for OVERLAY. v For p,m,H or p,m,F or p,m,D fields specified for OVERLAY, fields are aligned as necessary without changing the preceding bytes. v For variable-length records, you must not overlay positions 1-4 (the RDW) for OVERLAY, so be sure to specify the first column (c:) as 5 or greater. If you do not specify the first column, it will default to 1: which is invalid for variable-length records with OVERLAY. Whereas FIELDS=(1,m,...) is required, OVERLAY=(1,m) is not allowed, since it would overlay the RDW. Sample Syntax: Fixed input records:
INREC OVERLAY=(21:21,4,ZD,TO=PD,LENGTH=4, 2:5,8,HEX,45:C'*',32,4,C'*',81:SEQNUM,5,ZD)
Default for OVERLAY: None; must be specified. See Appendix B, Specification/Override of DFSORT Options, on page 787. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. | | FINDREP
142
INOUT=(
incon,outcon
| |
| | | | | | | | | | | | | | | | | | | | | | | You can use FINDREP to find constants anywhere in a record and replace them with other constants of the same or different lengths. You can find character or hexadecimal input constants anywhere in your records and replace them with character, hexadecimal or null output constants. As appropriate, bytes can be shifted left or right, blank padding can be added for fixed-length records, and the length can be changed for variable-length records. Various options of FINDREP allow you to define one or more input constants and a corresponding output constant, define one or more pairs of input and output constants, start and end the find scan at specified positions, stop after a specified number of constants are replaced, increase or decrease the length of the output record, define the action to be taken if nonblank characters overrun the end of the record, and specify whether output constants are to replace or overlay input constants. See FINDREP under OUTFIL Control Statements for complete details. Sample syntax
INREC FINDREP=(IN=C'Goodbye',OUT=C'Bye')
Default for FINDREP: None; must be specified. See Appendix B, Specification/Override of DFSORT Options, on page 787. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. IFTHEN
143
IFTHEN clauses allow you to reformat different records in different ways by specifying how build, overlay, find/replace or group operation items are to be applied to records that meet given criteria. IFTHEN clauses let you use simple or complex conditional logic to choose how different record types are reformatted. If you want to insert, rearrange, or delete fields in the same way for every record, use BUILD or FIELDS rather than IFTHEN. If you want to overlay existing columns in the same way for every record, use OVERLAY rather than IFTHEN. If you want to do find and replace operations in the same way for every record, use FINDREP rather than IFTHEN. Use IFTHEN clauses if you want to insert, rearrange, delete or overlay fields, or perform find/replace operations in different ways for different records., or if you want to perform operations on groups of records. You can use five types of IFTHEN clauses as follows: v WHEN=INIT: Use one or more WHEN=INIT clauses to apply build, overlay or find/replace items to all of your input records. WHEN=INIT clauses and WHEN=GROUP clauses are processed before any of the other IFTHEN clauses. v WHEN=GROUP: Use one or more WHEN=GROUP clauses to propagate fields, identifiers and sequence numbers within specified groups of records. WHEN=INIT clauses and WHEN=GROUP clauses are processed before any of the other IFTHEN clauses. v WHEN=(logexp): Use one or more WHEN=(logexp) clauses to apply build, overlay or find/replace items to your input records that meet specified criteria. A WHEN=(logexp) clause is satisfied when the logical expression evaluates as true. v WHEN=ANY: Use a WHEN=ANY clause after multiple WHEN=(logexp) clauses to apply additional build, overlay or find/replace items to your input records if they satisfied the criteria for any of the preceding WHEN=(logexp) clauses. v WHEN=NONE: Use one or more WHEN=NONE clauses to apply build, overlay or find/replace items to your input records that did not meet the criteria for any of the WHEN=(logexp) clauses. WHEN=NONE clauses are processed after any of the other IFTHEN clauses. If you do not specify a
| | | | | | | | | | | | | |
144
For this example, the IFTHEN clauses are processed as follows: v If IFTHEN clause 1 is satisfied, its overlay item is applied and IFTHEN processing stops. v If IFTHEN clause 1 is not satisfied, its overlay item is not applied and IFTHEN processing continues. v If IFTHEN clause 2 is satisfied, its build items are applied and IFTHEN processing continues. v If IFTHEN clause 2 is not satisfied, its build items are not applied and IFTHEN processing continues. v If IFTHEN clause 3 is satisfied, its build items are applied and IFTHEN processing continues. v If IFTHEN clause 3 is not satisfied, its build items are not applied and IFTHEN processing continues. v If IFTHEN clause 4 is satisfied, its build items are applied and IFTHEN processing stops. v If IFTHEN clause 4 is not satisfied, its build items are not applied and IFTHEN processing continues. v If IFTHEN clause 5 is satisfied, its overlay item is applied and IFTHEN processing stops. v If IFTHEN clause 5 is not satisfied, its overlay item is not applied and IFTHEN processing continues. v If IFTHEN clause 6 is satisfied, its build items are applied and IFTHEN processing stops. v If IFTHEN clause 6 is not satisfied, its build items are not applied and IFTHEN processing stops. All of the IFTHEN clauses operate sequentially on an IFTHEN record. The IFTHEN record is created initially from the input record. Each IFTHEN clause tests and changes the IFTHEN record, as appropriate. Thus, changes made by earlier IFTHEN clauses are seen by later IFTHEN clauses. For example, if you have a 40-byte input record and specify:
INREC IFTHEN=(WHEN=INIT,OVERLAY=(8:8,4,ZD,ADD,+1,TO=ZD,LENGTH=4)), IFTHEN=(WHEN=(8,4,ZD,EQ,+27),OVERLAY=(28:C'Yes')), IFTHEN=(WHEN=NONE,OVERLAY=(28:C'No'))
145
Separate SEQNUM counters are kept for the A record, for the B record, and for the NONE records. WHEN=INIT clause See WHEN=INIT clause under OUTFIL IFTHEN for details. Note that / cannot be used to create blank records or new records. Sample Syntax:
INREC IFTHEN=(WHEN=INIT, BUILD=(1,20,21:C'Department',31:3X,21,60)), IFTHEN=(WHEN=(5,2,CH,EQ,C'D1'),OVERLAY=(31:8,3)), IFTHEN=(WHEN=(5,2,CH,EQ,C'D2'),OVERLAY=(31:12,3))
146
WHEN=(logexp) clause See WHEN=(logexp) clause under OUTFIL IFTHEN for details. Note that although / can be used to create blank records and new records with OUTFIL, it cannot be used with INREC. Sample Syntax:
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'T01',AND, 18,4,ZD,LE,+2000),OVERLAY=(42:C'Type1 <= 2000'),HIT=NEXT), IFTHEN=(WHEN=(1,3,CH,EQ,C'T01',AND,6,1,BI,BO,X'03'), BUILD=(1,21,42,13)), IFTHEN=(WHEN=(1,3,CH,EQ,C'T01',AND, 18,4,ZD,GT,+2000),OVERLAY=(42:C'Type1 > 2000 '),HIT=NEXT), IFTHEN=(WHEN=(1,3,CH,EQ,C'T01',AND,6,1,BI,BO,X'01'), BUILD=(1,25,42,13))
WHEN=ANY clause | See WHEN=ANY clause under OUTFIL IFTHEN for details. Note that although / can be used to create blank records and new records with OUTFIL, it cannot be used with INREC. Sample Syntax:
INREC IFTHEN=(WHEN=(1,3,SS,EQ,C'T01,T02,T03'), BUILD=(C'Group A',X,1,80),HIT=NEXT), IFTHEN=(WHEN=(1,3,SS,EQ,C'T04,T05,T06'), BUILD=(C'Group B',X,1,80),HIT=NEXT), IFTHEN=(WHEN=(1,3,SS,EQ,C'T07,T08,T09,T10'), BUILD=(C'Group C',X,1,80),HIT=NEXT), IFTHEN=(WHEN=ANY,OVERLAY=(16:C'Group Found'))
WHEN=NONE clause See WHEN=NONE clause under OUTFIL IFTHEN for details. Note that although / can be used to create blank records and new records with OUTFIL, it cannot be used with INREC. Sample Syntax:
INREC IFTHEN=(WHEN=INIT,BUILD=(1,20,21:C'Department',31:3X,21,60)), IFTHEN=(WHEN=(5,2,CH,EQ,C'D1'),OVERLAY=(31:8,3)), IFTHEN=(WHEN=(5,2,CH,EQ,C'D2'),OVERLAY=(31:12,3)), IFTHEN=(WHEN=NONE,OVERLAY=(31:C'***'))
Default for IFTHEN clauses: None; must be specified. See Appendix B, Specification/Override of DFSORT Options. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options. IFOUTLEN
IFOUTLEN=n
147
Sample Syntax:
Default for IFOUTLEN: The LRECL determined from the IFTHEN clauses.
148
With OVERLAY, the variable part of the input record must not be included in the reformatted record. v If INREC with FIELDS or BUILD and OUTREC with FIELDS and BUILD are specified, either both must specify position-only for the last part, or neither must specify position-only for the last part. For example:
INREC BUILD=(1,8,20C'*',9) OUTREC BUILD=(1,4,3Z,5)
or:
INREC FIELDS=(1,40,45,5) OUTREC FIELDS=(1,45,C'****')
OVERLAY or IFTHEN, and FIELDS or BUILD, can differ with respect to position-only. For example:
INREC BUILD=(1,24,32:25) OUTREC IFTHEN=(WHEN=(8,1,ZD,GT,+5), BUILD=(1,24,25:C'Yes',28,10)), IFTHEN=(WHEN=NONE, BUILD=(1,24,25:C'No ',28,10))
or:
INREC FIELDS=(1,18,8C'*',23) OUTREC OVERLAY=(24:C'A')
v If the reformatted record includes only the RDW and the variable part of the input record, null records containing only an RDW could result. v The input records are reformatted before processing, as specified by INREC. The output records are in the format specified by INREC, unless OUTREC is also specified. v Fields referenced in INREC statements can overlap each other and control fields or both. v If input is variable records, the output is also variable. This means that each record is given the correct RDW by DFSORT before output.
Chapter 3. Using DFSORT Program Control Statements
149
Case 2:
//SYSIN DD * OPTION COPY,NOSZERO INREC IFTHEN=(WHEN=(1,2,FS,EQ,+0),OVERLAY=(28:C'A')), IFTHEN=(WHEN=NONE,OVERLAY=(28:C'B')) /*
Example 1
INREC Method:
INCLUDE COND=(5,1,GE,C'M'),FORMAT=CH INREC FIELDS=(10,3,20,8,33,11,5,1) SORT FIELDS=(4,8,CH,A,1,3,FI,A) SUM FIELDS=(17,4,BI)
OUTREC Method:
INCLUDE COND=(5,1,GE,C'M'),FORMAT=CH OUTREC FIELDS=(10,3,20,8,33,11,5,1) SORT FIELDS=(20,8,CH,A,10,3,FI,A) SUM FIELDS=(38,4,BI)
150
Identical results are achieved with INREC or OUTREC. However, use of OUTREC makes it easier to code the SORT and SUM statements. In either case, the INCLUDE COND parameters must refer to the fields of the original input records. However, with INREC, the SUM and SORT FIELDS parameters must refer to the fields of the reformatted input records, while with OUTREC, the SUM and SORT FIELDS parameters must refer to the fields of the original input records.
Example 2
INREC FIELDS=(1,35,2Z,36,45) MERGE FIELDS=(20,4,CH,D,10,3,CH,D),FILES=3 SUM FIELDS=(36,4,BI,40,8,PD) RECORD TYPE=F,LENGTH=(80,,82)
This example illustrates how overflow of a summary field can be prevented when three fixed-length data sets are merged and reformatted for output. The input record size is 80 bytes. To illustrate the use of the RECORD statement, assume that SORTIN and SORTOUT are not present (that is, all input/output is handled by user exits). The reformatted input records are fixed-length with a record size of 82 bytes (an insignificant increase from the original size of 80 bytes). They look as follows: Position 1-35 36-37 38-82 Contents Input positions 1 through 35 Binary zeros (to prevent overflow) Input positions 36 through 80
The MERGE and SUM statements must refer to the fields of the reformatted input records. The reformatted output records are identical to the reformatted input records. Thus, the 2-byte summary field at positions 36 and 37 in the original input records expands to a 4-byte summary field in positions 36 through 39 of the reformatted input/output record before merging. This prevents overflow of this summary field. Restriction: If OUTREC were used instead of INREC, the records would be reformatted after merging, and the 2-byte summary field might overflow.
151
Example 3
INREC BUILD=(20,4,12,3) SORT FIELDS=(1,4,D,5,3,D),FORMAT=CH OUTREC BUILD=(5X,1,4,H,19:1,2,5,3,DATE1(),80X'FF')
This example illustrates how a fixed-length input data set can be sorted and reformatted for output. A more efficient sort is achieved by using INREC before sorting to reduce the input records as much as possible, and using OUTREC after sorting to add padding, the current date and repeated fields. The SORTIN LRECL is 80 bytes. The reformatted input records are fixed-length, and have a record size of seven bytes (a significant reduction from the original size of 80 bytes). They look as follows: Position 1-4 5-7 Contents Input positions 20 through 23 Input positions 12 through 14
The SORT and OUTREC statements must refer to the fields of the reformatted input records. The reformatted output records are fixed length with a record size of 113 bytes. SOLRF (the IBM-supplied default) is in effect, so unless the SORTOUT LRECL is specified or available, it will automatically be set to the reformatted record length of 113. The reformatted output records look as follows: Position 1-5 6 7-10 11-18 19-20 21-23 24-33 34-113 Contents EBCDIC blanks Binary zero (for H alignment) Input positions 20 through 23 EBCDIC blanks Input positions 20 through 21 Input positions 12 through 14 The current date in the form Cyyyy-mm-dd Hexadecimal FFs
Thus, the use of INREC and OUTREC allows sorting of 7-byte records rather than 80-byte records, even though the output records are 113 bytes long.
Example 4
OPTION COPY,Y2PAST=1985 INREC FIELDS=(SEQNUM,4,BI, 8,5,ZD,TO=PD, 31,2,PD,TO=FI,LENGTH=2, 15,6,Y2TP, 25,3,CHANGE=(1,C'L92',X'01',C'M72',X'02',C'J42',X'03'), NOMATCH=(X'FF'))
This example illustrates how a sequence number can be generated, how values in one numeric or date format can be converted to another format, and how a lookup table can be used. The reformatted input records will look as follows: Position Contents
152
15
The SORT statement can now refer to the sort field in the reformatted input records. The OUTREC statement is used to restore the records to their original format.
Example 5
INREC OVERLAY=(61:21,11,SFF,ADD,41,11,SFF,TO=PD,LENGTH=5) SORT FIELDS=(61,5,PD,A) OUTREC OVERLAY=(61:61,5,PD,EDIT=(SIII,IIT.TT),SIGNS=(+,-))
This example illustrates how you can use the OVERLAY parameter with INREC and OUTREC to change certain columns in your records without affecting other columns. Positions 61-65 of the reformatted input records are overlaid with a 5-byte PD value derived from adding the sddd,ddd.dd field at positions 21-31 to the sddd,ddd.dd field at positions 41-51. The records are then sorted by this 5-byte PD field. Positions 61-71 of the reformatted output records are overlaid with an sddd,ddd.dd field derived from the 5-byte PD value. The data before positions 61-71 and after positions 61-71 are not affected
Example 6
OPTION COPY INREC IFTHEN=(WHEN=(5,2,CH,EQ,C'GP',AND,2,1,BI,EQ,+1), BUILD=(1,6,16,20,C'T1',X'0003',1,7,20C'1')), IFTHEN=(WHEN=(5,2,CH,EQ,C'GP',AND,2,1,BI,EQ,+2), BUILD=(1,6,45,20,C'T2',X'0008',16,7,20C'2')), IFTHEN=(WHEN=(5,2,CH,EQ,C'GP',AND,2,1,BI,EQ,+3), BUILD=(1,6,31,20,C'T3',X'0005',25,7,20C'3')), IFTHEN=(WHEN=NONE,OVERLAY=(27:C'00',X'FFFF')), IFOUTLEN=57
This example illustrates how you can use IFTHEN clauses with INREC to reformat different records in different ways. IFOUTLEN=57 is used to set the reformatted record length to 57. Records with GP in positions 5-6 and X01 in position 2 are reformatted as follows: Position 1-6 7-26 27-28 29-30 31-37 38-57 Contents Input positions 1-6 Input positions 16-35 T1 X'0003' Input positions 1-7 20 1s
153
Records with GP in positions 5-6 and X'03' in position 2 are reformatted as follows: Position 1-6 7-26 27-28 29-30 31-37 38-57 Contents Input positions 1-6 Input positions 31-50 T3 X'0005' Input positions 25-31 20 3s
Records without GP in positions 5-6 or without X'01', X'02', or X'03' in position 2 are reformatted as follows: Position 1-26 27-28 29-30 31-57 Contents Input positions 1-26 00 X'FFFF' Input positions 31-57
Example 7
INREC OVERLAY=(16:1,15,JFY=(SHIFT=LEFT)) SORT FIELDS=(16,15,CH,A) OUTREC BUILD=(1,15)
This example illustrates how you can left-justify characters in an input field so they can be sorted without regard to the leading blanks. The 15-byte input records might look like this:
CARRIE VICKY FRANK SAM DAVID MARTIN
Note that if we sort these records using just this control statement:
SORT FIELDS=(1,15,CH,A)
154
If we wanted the output to contain the sorted left-justified fields, we could use these control statements:
INREC BUILD=(1,15,JFY=(SHIFT=LEFT)) SORT FIELDS=(1,15,CH,A)
Example 8
INREC PARSE=(%00=(ENDBEFR=C',',FIXLEN=11), %01=(ENDBEFR=C',',FIXLEN=5), %02=(FIXLEN=6)), OVERLAY=(31:%00,42:%01,47:%02) SORT FIELDS=(31,11,CH,A,42,5,UFF,A,47,6,SFF,D) OUTREC BUILD=(1,30)
This example illustrates how you can sort FB input records with variable position/length fields, such as comma separated values. The 30-byte input records might look like this:
Marketing,96218,+27365 Development,3807,+1275 Research,7283,+5001 Development,1700,-5316 Research,978,+13562 Development,3807,-158 Research,7283,+5002 Marketing,52,-8736 Development,5781,+2736 Marketing,52,+1603 Research,16072,-2022
We want to sort the first field as character ascending, the second field as unsigned numeric ascending and the third field as signed numeric descending. Note that each record has three variable fields in comma separated value format. The fields do not start and end in the same position in every record and do not have the same length in every record. The first and second fields end with a comma and the third field ends with a blank. In order to sort variable fields like these, we use the PARSE and OVERLAY functions of INREC to create a fixed parsed copy of each variable field. We use
Chapter 3. Using DFSORT Program Control Statements
155
Since the second fixed parsed field is unsigned and left-justified, we sort it with the UFF format. Since the third fixed parsed field is signed and left-justified, we sort it with the SFF format. After the SORT and OUTREC statements are processed, the output records look like this:
Development,1700,-5316 Development,3807,+1275 Development,3807,-158 Development,5781,+2736 Marketing,52,+1603 Marketing,52,-8736 Marketing,96218,+27365 Research,978,+13562 Research,7283,+5002 Research,7283,+5001 Research,16072,-2022
Example 9
INREC PARSE=(%00=(ENDBEFR=C',',FIXLEN=11), %01=(ENDBEFR=C',',FIXLEN=5), %02=(FIXLEN=6)), BUILD=(1,4,5:%00,16:%01,21:%02,27:5) SORT FIELDS=(5,11,CH,A,16,5,UFF,A,21,6,SFF,D) OUTREC BUILD=(1,4,27)
This example illustrates how you can sort VB input records with variable position/length fields, such as comma separated values. This example is very similar to the previous example for FB records, except that with VB records we need to copy the fixed parsed fields after the 4-byte RDW rather than at the end of the records. The VB input records might look like this:
Length|Data 26|Marketing,96218,+27365 26|Development,3807,+1275 23|Research,7283,+5001 26|Development,1700,-5316 23|Research,978,+13562 25|Development,3807,-158 23|Research,7283,+5002
156
After the INREC statement is processed, the records look like this:
Length|Data 48|Marketing 96218+27365Marketing,96218,+27365 48|Development3807 +1275 Development,3807,+1275 45|Research 7283 +5001 Research,7283,+5001 48|Development1700 -5316 Development,1700,-5316 45|Research 978 +13562Research,978,+13562 47|Development3807 -158 Development,3807,-158 45|Research 7283 +5002 Research,7283,+5002 44|Marketing 52 -8736 Marketing,52,-8736 48|Development5781 +2736 Development,5781,+2736 44|Marketing 52 +1603 Marketing,52,+1603 46|Research 16072-2022 Research,16072,-2022
After the SORT and OUTREC statements are processed, the output records look like this:
Length|Data 26|Development,1700,-5316 26|Development,3807,+1275 25|Development,3807,-158 26|Development,5781,+2736 22|Marketing,52,+1603 22|Marketing,52,-8736 26|Marketing,96218,+27365 23|Research,978,+13562 23|Research,7283,+5002 23|Research,7283,+5001 24|Research,16072,-2022
| | | | | | | | | | | | | | | | | | |
Example 10
OPTION COPY INREC FINDREP=(IN=(X'00',X'FF'),OUT=C'')
This example illustrates how you can remove characters from FB or VB records. The VB input records might look like this in hexadecimal:
RDW----|Data 000F0000D1E4D5C500C1D7D9C9D3FF 00100000C2C5E3E3E800C4C1C9E2E8FF
We want to remove each X00 and XFF character. We use IN=(X00,XFF) to indicate we want to find each X00 and XFF character, and OUT=C (null) to indicate we want to remove it. The output records look like this:
RDW----|Data 000D0000D1E4D5C5C1D7D9C9D3 000E0000C2C5E3E3E8C4C1C9E2E8
Note that the X00 and XFF characters have been removed and the RDW length decreased accordingly. For VB input records, FINDREP processing automatically starts at position 5 after the RDW so the X00 characters in the RDW are not affected.
157
Example 11
OPTION COPY INREC FINDREP=(IN=C'BALANCE', OUT=C'BALANCE 1000',SHIFT=NO,DO=1)
This example illustrates how you can find a value in FB or VB records and overlay it with a larger value without shifting other bytes in the records. The FB input records might look like this:
CUSTOMER1 10100 MNTHLY STMT BALANCE 2000 CUSTOMER2 11100 MNTHLY STMT REQUIRES NO MODIFICATION ACCT BALANCE 5000 CUSTOMER3 11111 YOUR INFO ENCLOSED MNTHLY STMT REQUIRES MODIFICATION ACCT BALANCE 7000
We want to replace every instance of BALANCE dddd with BALANCE 1000 where dddd can be any value. We use IN=CBALANCE to indicate we want to find each instance of BALANCE. We use OUT=BALANCE 1000 to indicate we want to replace it with BALANCE 1000. We use SHIFT=NO to do an overlay, overriding the default of shifting bytes. Since we only have at most one instance of BALANCE dddd in a record, we can use DO=1 to stop processing a record after one replacement of BALANCE dddd with BALANCE 1000. In this case, DO=1 is more efficient than the default of continuing to look for more instances of BALANCE dddd after the first instance. We would get the same result without DO=1, just less efficiently The output records look like this:
CUSTOMER1 10100 MNTHLY STMT BALANCE 1000 CUSTOMER2 11100 MNTHLY STMT REQUIRES NO MODIFICATION ACCT BALANCE 1000 CUSTOMER3 11111 YOUR INFO ENCLOSED MNTHLY STMT REQUIRES MODIFICATION ACCT BALANCE 1000
Example 12
INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,4,CH,EQ,C'RPT.'), PUSH=(31:6,8)) OPTION EQUALS SORT FIELDS=(31,8,CH,A) OUTFIL INCLUDE=(31,8,CH,EQ,C'FRANK',OR, 31,8,CH,EQ,C'SRIHARI'),BUILD=(1,30)
This example illustrates how you can SORT and INCLUDE groups of FB records depending on a value in the first record of each group. We propagate the value in the first record of the group to every record of the group, SORT and INCLUDE on the value, and then remove it. The 30-byte FBA input records might look like this:
1RPT.SRIHARI LINE 1 FOR LINE 2 FOR ... 1RPT.VICKY LINE 1 FOR LINE 2 FOR ... 1RPT.FRANK REPORT 1 REPORT 1 REPORT 2 REPORT 2
158
Each report starts with RPT.reptname in positions 2-13. In the output data set we only want to include records for reports with specific reptname values, and the reptname values we want can change from run to run. We also want to sort by the reptname values in ascending order. For this example, lets say we just want the SRIHARI and FRANK reports. We use an IFTHEN WHEN=GROUP clause to propagate the reptname value to each record of the group. BEGIN indicates a group starts with RPT. in positions 2-5. PUSH overlays the reptname value from the first record of the group (the RPT.reptname record) at positions 31-38 (after the end of the record) in each record of the group including the first. After the IFTHEN GROUP clause is executed, the intermediate records look like this:
1RPT.SRIHARI LINE 1 FOR LINE 2 FOR ... 1RPT.VICKY LINE 1 FOR LINE 2 FOR ... 1RPT.FRANK LINE 1 FOR LINE 2 FOR ... 1RPT.DAVID LINE 1 FOR LINE 2 FOR ... REPORT 1 REPORT 1 REPORT 2 REPORT 2 REPORT 3 REPORT 3 REPORT 4 REPORT 4 SRIHARI SRIHARI SRIHARI SRIHARI VICKY VICKY VICKY VICKY FRANK FRANK FRANK FRANK DAVID DAVID DAVID DAVID
Note that the records of each group have the reptname value from the first record of that group in positions 31-38. We use a SORT statement to sort ascending on the reptname in positions 31-38. We use the EQUALS option to ensure that records in the same group (that is, with the same reptname value) are kept in their original order. After the SORT statement is executed, the intermediate records look like this:
1RPT.DAVID LINE 1 FOR LINE 2 FOR ... 1RPT.FRANK LINE 1 FOR LINE 2 FOR ... 1RPT.SRIHARI LINE 1 FOR LINE 2 FOR ... 1RPT.VICKY LINE 1 FOR LINE 2 FOR ... REPORT 4 REPORT 4 REPORT 3 REPORT 3 REPORT 1 REPORT 1 REPORT 2 REPORT 2 DAVID DAVID DAVID DAVID FRANK FRANK FRANK FRANK SRIHARI SRIHARI SRIHARI SRIHARI VICKY VICKY VICKY VICKY
159
) , FORMAT=f
The MERGE control statement must be used when a merge operation is to be performed; this statement describes the control fields in the input records on which the input data sets have previously been sorted. A MERGE statement can also be used to specify a copy application. User labels will not be copied to the output data sets. You can merge up to 100 data sets with Blockset merge or up to 16 data sets with Conventional merge. If Blockset merge is not selected, you can use a SORTDIAG DD statement to force message ICE800I, which gives a code indicating why Blockset could not be used. The way in which DFSORT processes short MERGE control fields depends on the setting for VLSHRT/NOVLSHRT. A short field is one where the variable-length record is too short to contain the entire field, that is, the field extends beyond the
160
, FIELDS= ( p,m,f,s )
Is written exactly the same way for a merge as it is for a sort. The meanings of p, m, f, and s are described in the discussion of the SORT statement. The defaults for this and the following parameters are also given there. See SORT Control Statement on page 418. FIELDS=COPY
FIELDS=COPY
See the discussion of the COPY option on the OPTION statement, in OPTION Control Statement on page 171.
Chapter 3. Using DFSORT Program Control Statements
161
FORMAT=f
See the discussion of the FORMAT option in SORT Control Statement on page 418. Used the same way for a merge as for a sort. EQUALS or NOEQUALS
EQUALS NOEQUALS
See the discussion of these options on the OPTION statement, in OPTION Control Statement on page 171. FILES=n
FILES=n
Specifies the number of input files for a merge when input is supplied through the E32 exit. Default: None; must be specified when an E32 exit is used. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. FILSZ or SIZE
FILSZ=x SIZE=y
See the discussion of these options on the OPTION statement, in OPTION Control Statement on page 171. SKIPREC
SKIPREC=z
See the discussion of this option on the OPTION statement, in OPTION Control Statement on page 171.
162
STOPAFT=n
See the discussion of this option on the OPTION statement, in OPTION Control Statement on page 171. Note: STOPAFT is used for a copy or sort application, but is not used for a merge application. Y2PAST
Y2PAST=
s f
See the discussion of this option on the OPTION statement, in OPTION Control Statement on page 171. Note: CENTURY=value and CENTWIN=value can be used instead of Y2PAST=value.
FIELDS The control field begins on byte 2 of each record in the input data sets. The field is 5 bytes long and contains character (EBCDIC) data that has been presorted in ascending order. FILSZ The input data sets contain exactly 29483 records.
Example 2
MERGE FIELDS=(3,8,ZD,E,40,6,CH,D)
FIELDS The major control field begins on byte 3 of each record, is 8 bytes long, and contains zoned decimal data that is modified by your routine before the merge examines it. The second control field begins on byte 40, is 6 bytes long, and contains character data in descending order.
Example 3
MERGE FIELDS=(25,4,A,48,8,A),FORMAT=ZD
163
Example 4
MERGE FIELDS=COPY
FIELDS The input data set is copied to output. No merge takes place.
The MODS statement is needed only when DFSORT passes control to your routines at user exits. The MODS statement associates user routines with specific DFSORT exits and provides DFSORT with descriptions of these routines. For details about DFSORT user exits and how user routines can be used, see Chapter 4, Using Your Own User Exit Routines, on page 435. To use one of the user exits, you substitute its three-character name (for example, E31) for the word exit in the MODS statement format above. You can specify any valid user exit, except E32. (E32 can be used only in a merge operation invoked from a program; its address must be passed in a parameter list.) exit
exit= (
n,m , s ,e
The values that follow the exit parameter describe the user routine. These values are: n specifies the name of your routine (member name if your routine is in a library). You can use any valid operating system name for your routine. This allows you to keep several alternative routines with different names in the same library.
m specifies the number of bytes of main storage your routine uses.Include storage obtained (via GETMAIN) by your routine (or, for example, by OPEN) and the storage required to load the COBOL library subroutines.
164
HILEVEL=YES
specifies that: v if an E15 routine is identified on the MODS statement, it is written in COBOL v if an E35 routine is identified on the MODS statement, it is written in COBOL. If you identify an E15 routine and an E35 routine on the MODS statement, specify HILEVEL=YES only if both routines are written in COBOL. If you do not identify an E15 or E35 routine on the MODS statement, HILEVEL=YES is ignored. Note: COBOL=YES can be used instead of HILEVEL=YES.
165
166
E15 At exit E15, DFSORT transfers control to your own routine. Your routine is in the library defined by a job control statement with the ddname MODLIB. Its member name is ADDREC and uses 552 bytes. E35 At exit E35, DFSORT transfers control to your routine. Your routine is in the library defined by the job control statement with the ddname MODLIB. Its member name is ALTREC and will use 11032 bytes.
Example 2
MODS E15=(COBOLE15,7000,,C), E35=(COBOLE35,7000,EXITC,C)
E15 At exit E15, DFSORT transfers control to your own routine. Your routine is written in COBOL and is in the STEPLIB/JOBLIB or link libraries. Its member name is COBOLE15 and it uses 7000 bytes. E35 At exit E35, DFSORT transfers control to your routine. Your routine is written in COBOL and is in the library defined by the job control statement with the ddname EXITC. Its member name is COBOLE35 and it uses 7000 bytes.
OMIT COND=
Use an OMIT statement if you do not want all of the input records to appear in the output data sets. The OMIT statement selects the records you do not want to include. You can specify either an INCLUDE statement or an OMIT statement in the same DFSORT run, but not both. The way in which DFSORT processes short INCLUDE/OMIT compare fields depends on the settings for VLSCMP/NOVLSCMP and VLSHRT/NOVLSHRT. A short field is one where the variable-length record is too short to contain the entire field, that is, the field extends beyond the record. For details about including or omitting short records, see the discussion of the VLSCMP and NOVLSCMP options in OPTION Control Statement on page 171. A logical expression is one or more relational conditions logically combined, based on fields in the input record, and can be represented at a high level as follows:
167
If the logical expression is true for a given record, the record is omitted from the output data set. Five types of relational conditions can be used as follows: 1. Comparisons: Compare two compare fields or a compare field and a decimal, hexadecimal, character or current, future, or past date constant. For example, you can compare the first 6 bytes of each record with its last 6 bytes, and omit those records in which those fields are identical. Or you can compare a date field with todays date, yesterdays date, or tomorrows date and omit those records accordingly. 2. Substring Comparison Tests: Search for a constant within a field value or a field value within a constant. For example, you can search the value in a 6-byte field for the character constant COK, and omit those records for which COK is found somewhere in the field. Or you can search the character constant CJ69,L92,J82 for the value in a 3-byte field, and omit those records for which CJ69, CL92, or CJ82 appears in the field. 3. Bit Logic Tests: Test the state (on or off) of selected bits in a binary field using a bit or hexadecimal mask or a bit constant. For example, you can omit those records which have bits 0 and 2 on in a 1-byte field. Or you can omit those records which have bits 3 and 12 on and bits 6 and 8 off in a 2-byte field. 4. Date Comparisons: Compare a two-digit year date field to a two-digit year date constant, the current two-digit year date or another two-digit year date field, using the century window in effect. For example, you can omit only those records for which a Zyymm date field is between January 1996 and March 2005. Or you can omit only those records for which a Pdddyy field is less than another Pdddyy field. 5. Numeric Tests: Test a field for numerics or non-numerics in character, zoned decimal, or packed decimal format. For example, you can omit only those records in which a 5-byte field contains only 0-9 characters (that is, numerics). Or you can omit only those records in which a 9-byte field contains invalid ZD numeric data (that is, non-numerics). Or you can omit only those records in which a 12-byte field contains valid PD numeric data (that is, numerics). For complete details on the parameters of the OMIT control statement, see INCLUDE Control Statement on page 98.
168
v D2 format can be specified with the OMIT statement but not with the OMIT parameter. See OUTFIL Control Statements on page 224 for more details on the OUTFIL OMIT parameter. COND
COND=
logical expression
specifies one or more relational conditions logically combined, based on fields in the input record. If the logical expression is true for a given record, the record is omitted from the output data sets. specifies that all of the input records are to be omitted from the output data sets. specifies that none of the input records are to be omitted from the output data sets.
ALL NONE
Default: NONE. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. FORMAT
FORMAT=f
For details on this parameter, see INCLUDE Control Statement on page 98.
169
This statement omits records in which: v Byte 27 contains D AND v Bytes 22 through 23 have some, but not all of bits 0, 1 and 12 on OR byte 28 is equal to the specified pattern of bit 1 on, bit 6 off and bit 7 on. Note that the AND and OR operators can be written with the AND and OR signs, and that parentheses are used to change the order in which AND and OR are evaluated. For additional examples of logical expressions, see INCLUDE Control Statement on page 98.
170
, OPTION ARESALL= n nK nM n nK nM
ARESINV=
AVGRLEN=n CHALT NOCHALT CHECK NOCHECK CINV NOCINV CKPT COBEXIT= COPY DSA=n DSPSIZE= DYNALLOC
COB1 COB2
DYNSPC=n EFS= name NONE EQUALS NOEQUALS EXITCK= STRONG WEAK FILSZ= x Ex Ux SIZE= y Ey Uy HIPRMAX= OPTIMAL n p% LIST NOLIST LISTX NOLISTX LOCALE= name CURRENT NONE
Figure 12. Syntax Diagram for the Option Control Statement (Part 1 of 3)
171
MAINSIZE=
n nK nM MAX MOSIZE= MAX n p% MSGDDN=ddname MSGPRT= ALL NONE CRITICAL NOBLKSET NOOUTREL NOOUTSEC NULLOUT= RC0 RC4 RC16 ODMAXBF= n nK nM OVFLO= RC0 RC4 RC16 PAD= RC0 RC4 RC16 RESALL= n nK nM RESET NORESET RESINV= n nK nM SDB= LARGE YES INPUT NO SKIPREC=z SMF= SHORT FULL NO SOLRF NOSOLRF SORTDD=cccc SORTIN=ddname SORTOUT=ddname SPANINC= RC0 RC4 RC16
Figure 12. Syntax Diagram for the Option Control Statement (Part 2 of 3)
172
STOPAFT=n SZERO NOSZERO TRUNC= RC0 RC4 RC16 USEWKDD VERIFY NOVERIFY VLLONG NOVLLONG VLSCMP NOVLSCMP VLSHRT NOVLSHRT VSAMEMT NVSAMEMT VSAMIO NOVSAMIO WRKREL NOWRKREL WRKSEC NOWRKSEC Y2PAST= s f ZDPRINT NZDPRINT
Figure 12. Syntax Diagram for the Option Control Statement (Part 3 of 3)
Note for Syntax Diagram: The keywords EFS, LIST, NOLIST, LISTX, NOLISTX, MSGDDN, MSGPRT, SMF, SORTDD, SORTIN, SORTOUT, and USEWKDD are used only when they are specified on the OPTION control statement passed by an extended parameter list or when specified in the DFSPARM data set. If they are specified on an OPTION statement read from the SYSIN or SORTCNTL data set, the keyword is recognized, but the parameters are ignored. The OPTION control statement allows you to override some of the options available at installation time (such as EQUALS and CHECK) and to supply other optional information (such as DYNALLOC, COPY, and SKIPREC). Some of the options available on the OPTION statement are also available on the SORT or MERGE statement (such as FILSZ and SIZE). It is preferable to specify these options on the OPTION statement. For override rules, see Appendix B, Specification/Override of DFSORT Options, on page 787. Details of aliases for OPTION statement options are given under the description of individual options. Table 34 on page 221 summarizes the available aliases. DFSORT accepts but does not process the following OPTION operands: ALGQ, APP, APPEND, BIAS=value, BLKSET, CASCADE, DIAG, ERASE, EXCPVR=value,
173
ARESALL=
n nK nM
Temporarily overrides the ARESALL installation option, which specifies the number of bytes to be reserved above virtual for system use. ARESALL applies only to the amount of main storage above virtual. This option is normally not needed because of the large amount of storage available above 16MB virtual (the default for ARESALL is 0 bytes). The RESALL option applies to the amount of main storage below 16MB virtual. n specifies that n bytes of storage are to be reserved. Limit: 8 digits. nK specifies that n times 1024 bytes of storage are to be reserved. Limit: 5 digits. nM specifies that n times 1048576 bytes of storage are to be reserved. Limit: 2 digits. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: SeeAppendix B, Specification/Override of DFSORT Options, on page 787. ARESINV
ARESINV=
n nK nM
Temporarily overrides the ARESINV installation option, which specifies the number of bytes to be reserved for an invoking programs user exits that reside in or use space above 16MB virtual. The reserved space is not meant to be used for the invoking programs executable code. ARESINV is used only when DFSORT is dynamically invoked. ARESINV applies only to the amount of main storage above 16MB virtual. The RESINV option applies to the amount of main storage below 16MB virtual. n specifies that n bytes of storage are to be reserved. Limit: 8 digits. nK specifies that n times 1024 bytes of storage are to be reserved.
174
AVGRLEN=n
Specifies the average input record length in bytes for variable-length record sort applications. This value is used when necessary to determine the input file size. The resulting value is important for sort applications, because it is used for several internal optimizations as well as for dynamic work data set allocation (see OPTION DYNALLOC). See Specify Input/Output Data Set Characteristics Accurately on page 729 and Allocation of Work Data Sets on page 779 for more information on file size considerations. n specifies the average input record length. n must be between 4 and 32767 and must include the 4-byte record descriptor word (RDW).
Notes: 1. AVGRLEN=n on the OPTION statement overrides the L5 value on the RECORD statement (LENGTH operand) if both are specified. The L5 value on the RECORD statement is ignored for Blockset. 2. L5=n can be used instead of AVGRLEN=n. Default: If AVGRLEN=n is not specified, DFSORT uses one-half of the maximum record length as the average record length. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. CHALT or NOCHALT
CHALT NOCHALT
Temporarily overrides the CHALT installation option, which specifies whether format CH fields are translated by the alternate collating sequence as well as format AQ or just the latter. CHALT specifies that DFSORT translates character control fields and compare fields with formats CH and AQ using the alternate collating sequence.
Chapter 3. Using DFSORT Program Control Statements
175
CHECK NOCHECK
Temporarily overrides the CHECK installation option, which specifies whether the record count should be checked for applications that use the E35 user exit routine without an output data set. CHECK specifies that the record count should be checked. NOCHECK specifies that the record count should not be checked. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: SeeAppendix B, Specification/Override of DFSORT Options, on page 787. CINV or NOCINV
CINV NOCINV
Temporarily overrides the CINV installation option, which specifies whether DFSORT can use control interval access for VSAM data sets. The Blockset technique uses control interval access for VSAM input data sets, when possible, to improve performance. CINV specifies that DFSORT should use control interval access when possible for VSAM data sets. NOCINV specifies that DFSORT should not use control interval access. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details.
176
CKPT
Activates the Checkpoint/Restart facility for sorts that use the Peerage or Vale techniques. Because CKPT is only supported in the Peerage and Vale techniques, the Blockset technique must be bypassed for the Checkpoint/Restart facility to be used. Installation option IGNCKPT=NO causes Blockset to be bypassed when CKPT is specified at run-time. The NOBLKSET option can also be used to bypass Blockset at run-time. A SORTCKPT DD statement must be coded when you use the Checkpoint/Restart facility (see SORTCKPT DD Statement on page 76). Notes: 1. CHKPT can be used instead of CKPT. 2. Functions such as OUTFIL processing, which are supported only by the Blockset technique, cannot be used if the Checkpoint/Restart facility is used. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. COBEXIT
COBEXIT=
COB1 COB2
Temporarily overrides the COBEXIT installation option, which specifies the library for COBOL E15 and E35 routines. COB1 specifies that COBOL E15 and E35 routines are run with the OS/VS COBOL run-time library or, in some cases, with no COBOL run-time library. COBEXIT=COB1 is obsolete, but is still available for compatibility reasons. Note that Language Environment is the only run-time library for COBOL supported by IBM service. COB2 specifies that COBOL E15 and E35 routines are run with either the VS COBOL II run-time library or the Language Environment run-time library. Note that Language Environment is the only run-time library for COBOL supported by IBM service.
Chapter 3. Using DFSORT Program Control Statements
177
COPY
Causes DFSORT to copy a SORTIN data set or inserted records to the output data sets unless all records are disposed of by an E35 exit routine. Records can be edited by E15 and E35 exit routines; INCLUDE/OMIT, INREC, OUTREC, and OUTFIL statements; and SKIPREC and STOPAFT parameters. E35 is entered after each SORTIN or E15 record is copied. The following must not be used in copy applications: v BDAM data sets v Dynamic link-editing. See message ICE160A in z/OS DFSORT Messages, Codes and Diagnosis Guide for additional restrictions that apply to copy applications. Note: User labels will not be copied to the output data sets. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. DSA
DSA=n
Temporarily overrides the DSA installation option, which specifies the maximum amount of storage available to DFSORT for dynamic storage adjustment of a Blockset sort application when SIZE/MAINSIZE=MAX is in effect. If you specify a DSA value greater than the TMAXLIM value in effect, you allow DFSORT to use more storage than the TMAXLIM value if doing so should improve performance. The amount of storage DFSORT uses is subject to the DSA value as well as system limits such as region size. However, whereas DFSORT always tries to obtain as much storage as it can up to the TMAXLIM value, DFSORT only tries to obtain as much storage as needed to improve performance up to the DSA value. The performance improvement from dynamic storage adjustment usually provides a good tradeoff against the increased storage used by DFSORT. On
178
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. DSPSIZE
DSPSIZE=
MAX n
Temporarily overrides the DSPSIZE installation option, which specifies the maximum amount of data space to be used with dataspace sorting. A data space is an area of contiguous virtual storage that is backed by real and auxiliary storage, whichever is necessary as determined by the system. Because DFSORT is able to sort large pieces of data using data space, CPU time and elapsed time are reduced. Several factors can limit the amount of data space an application uses: v The IEFUSI exit can limit the total amount of Hiperspace, memory objects and data space available to an application. v DSPSIZE can limit the amount of data space available to an application, as detailed below. v Sufficient available storage must be present to back DFSORTs data spaces. Available storage is the storage used to back new data space data and consists of the following two types: 1. Free storage. This is storage not being used by any application. 2. Old storage. This is storage used by another application whose data has been unreferenced for a sufficiently long time so that the system considers it eligible to be paged out to auxiliary storage to make room for new data space data. The amount of available storage constantly changes, depending on current system activity. Consequently, DFSORT checks the amount of available central storage throughout a data space sorting run and switches from using a data space to using disk work data sets if the available central storage is too low. v Other concurrent Hipersorting, memory sorting and dataspace sorting applications further limit the amount of available storage. A dataspace sorting application knows the storage needs of every other Hipersorting, memory object sorting and dataspace sorting application on the system. A dataspace sorting application does not try to back its data space data with storage needed by another Hipersorting, memory object sorting or dataspace sorting application. This prevents overcommitment of storage resources if multiple large concurrent DFSORT applications start at similar times on the same system.
Chapter 3. Using DFSORT Program Control Statements
179
Assigns DFSORT the task of dynamically allocating needed work space. You do not need to calculate and use JCL to specify the amount of work space needed by the program. DFSORT uses the dynamic allocation facility of the operating system to allocate work space for you. Refer to Appendix A, Using Work Space, on page 777 for guidelines on the use of DYNALLOC. d specifies the device name. You can specify any IBM disk or tape device
180
Tip: For optimum allocation of resources such as virtual storage, avoid specifying a large number of work data sets unnecessarily. For tape work data sets, the number of volumes specified (explicitly or by default) is allocated to the program. The program requests standard label tapes. DYNALLOC is not used if SORTWKdd DD statements are provided unless installation option DYNAUTO=IGNWKDD is specified and OPTION USEWKDD is not in effect. If VIO=NO is in effect: v Work space can be allocated on nontemporary data sets (DSNAME parameter specified). v If the device (d) you specify is a virtual device and reallocation to a real device fails, DFSORT will ignore VIO=NO and use the virtual device. Note: Message ICE165I gives information about work data set allocation/use. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. v DYNALLOC can automatically be activated by using the DYNAUTO installation option. v If DYNALLOC is specified without d, the default for d is that specified (or defaulted) by the DYNALOC installation option v If DYNALLOC is specified without n, the default for n is that specified (or defaulted) by the DYNALOC installation option. You can specify DYNALLOC without n, without d, or without both. If DYNALLOC is specified without n, and the IBMsupplied default for the n value of the DYNALOC installation option is chosen, then: v If one of the Blockset techniques is chosen, four work data sets will be requested. v If a technique other than Blockset is chosen, three work data sets will be requested. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. DYNALLOC=OFF
181
Directs DFSORT not to allocate work space dynamically, overriding that function of installation option DYNAUTO=YES, or DYNAUTO=IGNWKDD, or the run-time option DYNALLOC (without OFF). Use this option when you know that an in-core sort can be performed, and you want to suppress dynamic allocation of work space. OFF directs DFSORT not to allocate work space dynamically. Note: When Hipersorting or dataspace sorting is in effect, DFSORT uses dynamic allocation when necessary, even if DYNALLOC=OFF has been specified. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. DYNSPC
DYNSPC=n
DYNSPC=ntemporarily overrides the DYNSPC installation option, which specifies the total default primary space allocation for all of the dynamically allocated work data sets when the input file size is unknown. That is, when DFSORT cannot determine the input file size for a sort application and the number of records is not supplied by a FILSZ or SIZE value. Generally, DFSORT can automatically determine the input file size. However, in a few cases, such as when an E15 supplies all of the input records, when information about a tape data set is not available from a tape management system, or when Blockset is not selected, DFSORT cannot determine an accurate file size. In these cases, if the number of records is not supplied by the FILSZ or SIZE run-time option, and dynamic allocation of work data sets is used, DFSORT uses the DYNSPC value in effect as the approximate amount of primary space. DFSORT uses 20% of the primary space as secondary space. Although the primary space is always allocated, secondary space (up to 15 extents) is only allocated as needed. You may want to use DYNSPC to override the installation default with a larger or smaller value depending on the amount of disk space available for DFSORT work data sets, and the amount of data to be sorted for this application. As a guideline, Table 30 shows the approximate primary space in cylinders that is allocated on a 3390 when Blockset sorts an unknown number of 6000-byte records.
Table 30. Example of DYNSPC Primary Space DYNSPC value (megabytes) 32 Primary space (cylinders) 48
182
The larger your DYNSPC value, the more data DFSORT can sort when the file size is unknown. For example, in a test using just dynamically allocated work space (no Hiperspace or data space) with the primary space shown in Table 30 on page 182, and all of the corresponding secondary space, Blockset is able to sort approximately 150 megabytes with DYNSPC=32 and approximately 1200 megabytes with DYNSPC=256. If Hiperspace or data space can be used along with dynamically allocated work space, the amount of data DFSORT can sort will increase according to the amount of Hiperspace or data space available. n specifies the total default primary space, in megabytes, to be allocated for all dynamically allocated work data sets (n is not the primary space for each data set). n must be a value between 1 and 65535. Do not specify a value which exceeds the available disk space, because this causes dynamic allocation to fail for sort applications that use this value. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. EFS
EFS=
name NONE
Temporarily overrides the EFS installation option, which specifies whether DFSORT is to pass control to an Extended Function Support (EFS) program. See Chapter 8, Using Extended Function Support, on page 693 for more information. name specifies the name of the EFS program that will be called to interface with DFSORT. NONE specifies no call will be made to the EFS program. Notes: 1. EFS is processed only if it is passed on the OPTION control statement in an extended parameter list or in DFSPARM. 2. If you use locale processing for SORT, MERGE, INCLUDE, or OMIT fields, you must not use an EFS program. DFSORTs locale processing may eliminate the need for an EFS program. See the LOCALE option later in this section for information related to locale processing.
183
EQUALS NOEQUALS
Temporarily overrides the EQUALS installation option, which specifies whether the original sequence of records that collate identically for a sort or a merge should be preserved from input to output. EQUALS specifies that the original sequence must be preserved. NOEQUALS specifies that the original sequence need not be preserved. For sort applications, the sequence of the output records depends upon the order of: v The records from the SORTIN file v The records inserted by an E15 user exit routine v The E15 records inserted within input from SORTIN. For merge applications, the sequence of the output records depends upon the order of: v The records from a SORTINnn file. Records that collate identically are output in the order of their file increments. For example, records from SORTIN01 are output before any records that collate identically from SORTIN02. v The records from an E32 user exit routine for the same file increment number. Records that collate identically from E32 are output in the order of their file increments. For example, records from the file with increment 0 are output before any records that collate identically from the file with increment 4. Notes: 1. When EQUALS is in effect, the total number of bytes occupied by all control fields must not exceed 4088. 2. Using EQUALS can degrade performance. 3. When EQUALS is in effect with SUM, the first record of summed records is kept. When NOEQUALS is in effect with SUM, the record to be kept is unpredictable. If a technique other than Blockset is selected, NOEQUALS is forced if SUM is specified. 4. Do not specify EQUALS if variable-length records are sorted using tape work files and the RDW is part of the control field. 5. The number of records to be sorted cannot exceed 4294967295 (4 gigarecords minus 1); if the number of records exceeds this number, message ICE121A is issued and DFSORT terminates.
184
EXITCK
STRONG WEAK
Temporarily overrides the EXITCK installation option, which specifies whether DFSORT terminates or continues when it receives certain invalid return codes from E15 or E35 user exit routines. For full details of the return codes affected by this parameter, see E15/E35 Return Codes and EXITCK on page 480. STRONG specifies that DFSORT issues an error message and terminates when it receives an invalid return code from an E15 or E35 user exit routine. WEAK specifies that DFSORT interprets certain invalid return codes from E15 and E35 user exit routines as valid and continues processing. Use of EXITCK=WEAK can make it difficult to detect errors in the logic of E15 and E35 user exit routines. Note: EXITCK=WEAK is treated like EXITCK=STRONG when: v Tape work data sets are specified for a sort application. v The Blockset technique is not selected for a merge application. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options. FILSZ or SIZE
FILSZ=
SIZE=
x Ex Ux y Ey Uy
The FILSZ parameter specifies either the exact number of records to be sorted or merged, or an estimate of the number of records to be sorted. The SIZE parameter specifies either the exact number of records in the input data sets, or an estimate of the number of records in the input data sets. The supplied record count is used by DFSORT for two purposes: 1. To check that the actual number of records sorted or merged or the number of records in the input data sets is equal to the exact number of records
Chapter 3. Using DFSORT Program Control Statements
185
186
187
Use for file size calculation? Yes n includes records: In input data sets Inserted/deleted by E15 Inserted by E32 Deleted by INCLUDE/OMIT Deleted by SKIPREC Deleted by STOPAFT Update n when number of records changes: Effects of n=0 Yes Yes Yes Yes Yes Yes In any way Hipersorting and DYNALLOC not used
Yes Yes No Yes Yes Yes Significantly Hipersorting and DYNALLOC not used
Use for file size calculation? Yes n includes records: In input data sets Inserted/deleted by E15 Inserted by E32 Deleted by INCLUDE/OMIT Deleted by SKIPREC Deleted by STOPAFT Update n when number of records changes: Effects of n=0 Yes No No No No Yes In any way Hipersorting and DYNALLOC not used
Attention: Using the SIZE or FILSZ parameter to supply inaccurate information to DFSORT can negatively affect DFSORT performance, and, when work space is dynamically allocated, can result in wasted disk space or termination with message ICE083A or ICE046A. Therefore, it is important to update the record count value whenever the number of records to be sorted changes significantly.
188
HIPRMAX=
OPTIMAL n p%
Temporarily overrides the HIPRMAX installation option, which specifies the maximum amount of Hiperspace to be used for Hipersorting. Hiperspace is a high-performance data space that resides in central storage and is backed by auxiliary storage (if necessary). Because I/O processing is reduced for Hipersorting, elapsed time, EXCP counts, and channel usage are also reduced. Several factors can limit the amount of Hiperspace an application uses: v The IEFUSI exit can limit the total amount of Hiperspace, memory objects and data space available to an application. v HIPRMAX can limit the amount of Hiperspace available to an application, as detailed below. v Sufficient available storage must be present to back DFSORTs Hiperspaces. Available storage is the storage used to back new Hiperspace data and consists of the following two types: 1. Free storage. This is storage not being used by any application. 2. Old storage. This is storage used by another application whose data has been unreferenced for a sufficiently long time so that the system considers it eligible to be paged out to auxiliary storage to make room for new Hiperspace data. The amount of available storage constantly changes, depending upon current system activity. Consequently, DFSORT checks the available storage level throughout a Hipersorting application and switches from Hiperspace to work data sets if the available storage level gets too low. v Other concurrent Hipersorting, memory sorting and dataspace sorting applications further limit the amount of available storage. A Hipersorting application knows the storage needs of every other Hipersorting, memory object sorting and dataspace sorting application on the system. A Hipersorting application does not try to back its Hiperspace data with storage needed by another Hipersorting, memory object sorting, or dataspace sorting application. This prevents overcommitment of storage resources if multiple large concurrent DFSORT applications start at similar times on the same system. v The installation options EXPMAX, EXPOLD, and EXPRES can also be used to further limit the amount of storage available to Hipersorting applications. EXPMAX limits the total amount of available storage that can be used at any one time to back DFSORT Hiperspaces, memory objects and data spaces. EXPOLD limits the total amount of old storage that can be used at any one time to back DFSORT Hiperspaces, memory objects and data spaces.
189
p%
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. LIST or NOLIST
190
Temporarily overrides the LIST installation option, which specifies whether DFSORT program control statements should be written to the message data set. See z/OS DFSORT Messages, Codes and Diagnosis Guide for details on use of the message data set. LIST specifies that DFSORT control statements are printed to the message data set. NOLIST specifies that DFSORT control statements are not printed to the message data set. Note: LIST or NOLIST are processed only if they are passed on the OPTION control statement in an extended parameter list or in DFSPARM. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. LISTX or NOLISTX
LISTX NOLISTX
Temporarily overrides the LISTX installation option, which specifies whether DFSORT writes to the message data set program control statements that are returned by an EFS program. See z/OS DFSORT Messages, Codes and Diagnosis Guide for details on use of the message data set. LISTX specifies that control statements returned by an EFS program are printed to the message data set. NOLISTX specifies that control statements returned by an EFS program are not printed to the message data set. Notes: 1. LISTX or NOLISTX are processed only if they are passed on the OPTION control statement in an extended parameter list or in DFSPARM. 2. If EFS=NONE is in effect after final override rules have been applied, NOLISTX is in effect. 3. LISTX and NOLISTX can be used independently of LIST and NOLIST. 4. For more information on printing EFS control statements, see z/OS DFSORT Messages, Codes and Diagnosis Guide
191
LOCALE=
Temporarily overrides the LOCALE installation option, which specifies whether locale processing is to be used and, if so, designates the active locale. DFSORTs collating behavior can be modified according to your cultural environment. Your cultural environment is defined to DFSORT using the X/Open locale model. A locale is a collection of data grouped into categories that describes the information about your cultural environment. The collate category of a locale is a collection of sequence declarations that defines the relative order between collating elements (single character and multi-character collating elements). The sequence declarations define the collating rules. If locale processing is to be used, the active locale will affect the behavior of DFSORTs SORT, MERGE, INCLUDE, and OMIT functions. For SORT and MERGE, the active locale will only be used to process character (CH) control fields. For INCLUDE and OMIT, the active locale will only be used to process character (CH) compare fields, and character and hexadecimal constants compared to character (CH) compare fields. | Note: Locale processing is not used for IFTHEN WHEN, BEGIN or END constants or compare fields. name specifies that locale processing is to be used and designates the name of the locale to be made active during DFSORT processing. The locales are designated using a descriptive name. For example, to set the active locale to represent the French language and the cultural conventions of Canada, specify LOCALE=FR_CA. You can specify up to 32 characters for the descriptive locale name. The locale names themselves are not case-sensitive. See Using Locales for complete locale naming conventions. You can use IBM-supplied and user-defined locales. The state of the active locale prior to DFSORT being entered will be restored on DFSORTs completion. CURRENT specifies that locale processing is to be used, and the current locale active when DFSORT is entered will remain the active locale during DFSORT processing.
192
Notes: 1. LOCALE is processed only if it is passed on the OPTION control statement in an extended parameter list or in DFSPARM. 2. To use an IBM-supplied locale, DFSORT must have access to the Language Environment run-time library. For example, this library might be called SYS1.SCEERUN. If you are unsure of the name of this library at your location, contact your system administrator. To use a user-defined locale, DFSORT must have access to the load library containing it. 3. If you use locale processing for SORT, MERGE, INCLUDE, or OMIT fields: v VLSHRT is not used for SORT or MERGE v INREC or an E61 user exit must not be usedfor SORT or MERGE. v CHALT or an EFS program must not be used. 4. Locale processing is not used for IFTHEN WHEN, BEGIN or END constants or compare fields. 5. Locale processing for DFSORTs SORT, MERGE, INCLUDE, and OMIT functions can improve performance relative to applications that must perform pre-processing or post-processing of data to produce the desired collating results. However, locale processing should be used only when required, because it can show degraded performance relative to collating, using character encoding values. 6. DFSORT locale processing may require an additional amount of storage that depends on the environment supporting the locale as well as the locale itself. It may be necessary to specify a REGION of several MB or more for DFSORT applications that use locale processing. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions:; See Appendix B, Specification/Override of DFSORT Options, on page 787. MAINSIZE
MAINSIZE=
n nK nM MAX
Temporarily overrides the SIZE installation option, which specifies the amount of main storage available to DFSORT. MAINSIZE applies to the total amount of main storage above and below 16MB virtual. DFSORT determines how much storage to allocate above and below 16MB virtual, but the total amount of storage cannot exceed MAINSIZE. Storage used for OUTFIL processing will be adjusted automatically, depending upon several factors, including: v Total available storage v Non-OUTFIL processing storage requirements
Chapter 3. Using DFSORT Program Control Statements
193
MOSIZE=
MAX n p%
Temporarily overrides the MOSIZE installation option, which specifies the maximum size of a memory object to be used for memory object sorting in 64-bit virtual storage. A memory object is a data area in virtual storage that is allocated above the bar and backed by central storage. Because I/O processing is reduced for memory object sorting, elapsed time, EXCP counts, and channel usage are also reduced. Note: The bar refers to the 2-gigabyte address within the 64-bit address space. The bar separates storage below the 2-gigabyte address called below the bar, from storage above the 2-gigabyte address called above the bar. Several factors can limit the size of a memory object an application uses:
194
195
p%
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. MSGDDN
MSGDDN=ddname
Temporarily overrides the MSGDDN installation option, which specifies an alternate ddname for the message data set. MSGDDN must be in effect if: v A program that invokes DFSORT uses SYSOUT (for instance, COBOL uses SYSOUT) and you do not want DFSORT messages intermixed with the program messages. v Your E15 and E35 routines are written in COBOL and you do not want DFSORT messages intermixed with the program messages. v A program invokes DFSORT more than once and you want separate messages for each invocation of DFSORT. The ddname can be any 1- through 8- character name but must be unique within the job step; do not use a name that is used by DFSORT (for example, SORTIN). If the ddname specified is not available at run-time, SYSOUT is used instead. For details on use of the message data set, see z/OS DFSORT Messages, Codes and Diagnosis Guide Note: MSGDDN is processed only if it is passed on the OPTION control statement in an extended parameter list or in DFSPARM. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. MSGPRT
196
Temporarily overrides the MSGPRT installation option, which specifies the class of messages to be written to the message data set. For details on use of the message data set, see z/OS DFSORT Messages, Codes and Diagnosis Guide. ALL specifies that all messages except diagnostic messages (ICE800I to ICE999I) are to be printed. Control statements print only if LIST is in effect. CRITICAL specifies that only critical messages will be printed. Control statements print only if LIST is in effect. NONE specifies that no messages and control statements will be printed. Notes: 1. MSGPRT is processed only if it is passed on the OPTION control statement in an extended parameter list or in DFSPARM. 2. PRINT=value can be used instead of MSGPRT=value. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. NOBLKSET
NOBLKSET
Causes DFSORT to bypass the Blockset technique normally used for a sort or merge application. Using this option generally results in degraded performance. Note: Functions such as OUTFIL processing, which are supported only by the Blockset technique, cause the NOBLKSET option to be ignored. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. NOOUTREL
NOOUTREL
197
NOOUTSEC
Temporarily overrides the OUTSEC installation option, which specifies whether automatic secondary allocation is used for temporary or new output data sets. NOOUTSEC means that automatic secondary allocation for output data sets is not used. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. NULLOUT
NULLOUT=
Temporarily overrides the NULLOUT installation option, which specifies the action to be taken by DFSORT when there are no records for the SORTOUT data set, as indicated by an OUT count of 0 in message ICE054I RC0 specifies that DFSORT should issue message ICE173I, set a return code of 0, and continue processing when there are no records for the SORTOUT data set. RC4 specifies that DFSORT should issue message ICE173I, set a return code of 4, and continue processing when there are no records for the SORTOUT data set. RC16 specifies that DFSORT should issue message ICE206A, terminate, and give a return code of 16 when there are no records for the SORTOUT data set. Notes: 1. The return code of 0 or 4 set when there are no records for the SORTOUT data set can be overridden by a higher return code set for some other reason.
198
ODMAXBF=
n nK nM
Temporarily overrides the ODMAXBF installation option, which specifies the maximum buffer space DFSORT can use for each OUTFIL data set. The actual amount of buffer space used for a particular OUTFIL data set will not exceed the ODMAXBF limit, but can be less than the limit. OUTFIL processing is supported by the Blockset technique for sort, copy, and merge applications. The storage used for OUTFIL processing is adjusted automatically according to the total storage available, the storage needed for non-OUTFIL processing, and the number of OUTFIL data sets and their attributes (for example, block size). OUTFIL processing is subject to the ODMAXBF limit in effect and the system storage limits (for example, IEFUSI), but not to the DFSORT storage limits (that is, SIZE, MAXLIM, and TMAXLIM). DFSORT attempts to use storage above 16MB virtual for OUTFIL processing whenever possible. Lowering ODMAXBF below 2M can cause performance degradation for the application, but may be necessary if you consider the amount of storage used for OUTFIL processing to be a problem. Raising ODMAXBF can improve EXCPs for the application but can also increase the amount of storage needed. n specifies that a maximum of n bytes of buffer space is to be used for each OUTFIL data set. If you specify less than 262144, 262144 is used. If you specify more than 16777216, 16777216 is used. Limit: 8 digits nK specifies that a maximum of n times 1024 bytes of buffer space is to be used for each OUTFIL data set. If you specify less than 256K, 256K is used. If you specify more than 16384K, 16384K is used. Limit: 5 digits
199
OVFLO=
Temporarily overrides the OVFLO installation option, which specifies the action to be taken by DFSORT when BI, FI, PD or ZD summary fields overflow. RC0 specifies that DFSORT should issue message ICE152I (once), set a return code of 0 and continue processing when summary fields overflow. The pair of records involved in a summary overflow is left unsummed and neither record is deleted. Summary overflow does not prevent further summation. RC4 specifies that DFSORT should issue message ICE152I (once), set a return code of 4 and continue processing when summary fields overflow. The pair of records involved in a summary overflow is left unsummed and neither record is deleted. Summary overflow does not prevent further summation. RC16 specifies that DFSORT should issue message ICE195A, terminate and give a return code of 16 when summary fields overflow. Note: The return code of 0 or 4 set for summary overflow can be overridden by a higher return code set for some other reason. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. PAD
PAD=
200
RESALL=
n nK nM
Temporarily overrides the RESALL installation option, which specifies the number of bytes to be reserved in a REGION for system use. Usually, only 4K bytes (the standard default) of main storage must be available in a region for system use. However, in some cases, this may not be enough; for example, if your installation does not have BSAM/QSAM modules resident, you have user exits that open data sets, or you have COBOL exits. RESALL is used only when MAINSIZE/SIZE=MAX is in effect.
Chapter 3. Using DFSORT Program Control Statements
201
RESET NORESET
Temporarily overrides the RESET installation option, which specifies whether DFSORT should process a VSAM output data set defined with REUSE as a NEW or MOD data set. RESET specifies that DFSORT processes a VSAM output data set defined with REUSE as a NEW data set. The high-used RBA is reset to zero and the output data set is effectively treated as an initially empty cluster. NORESET specifies that DFSORT processes a VSAM output data set defined with REUSE as a MOD data set. The high-used RBA is not reset and the output data set is effectively treated as an initially non-empty cluster. Note: A VSAM output data set defined without REUSE is processed as a MOD data set. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. RESINV
202
Temporarily overrides the RESINV installation option, which specifies the number of bytes to be reserved in a REGION for the invoking program. RESINV is used only when DFSORT is dynamically invoked and MAINSIZE/SIZE=MAX is in effect. RESINV applies only to the amount of main storage below 16MB virtual. The ARESINV option applies to the amount of main storage above 16MB virtual. This extra space is usually required for data handling by the invoking program or user exits while DFSORT is running (as is the case with some PL/I- and COBOL- invoked sort applications). Therefore, if your invoking programs user exits do not perform data set handling, you do not need to specify this parameter. The reserved space is not meant to be used for the invoking programs executable code. The amount of space required depends upon what routines you have, how the data is stored, and which access method you use. n specifies that n bytes of storage are to be reserved. Limit: 8 digits nK specifies that n times 1024 bytes of storage are to be reserved. Limit: 5 digits nM specifies n times 1048576 bytes of main storage are to be reserved. Limit: 2 digits. Tip: A better way to reserve the required storage for user exits activated by the MODS statement is to use the m parameter of the MODS statement. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. SDB
SDB=
Temporarily overrides the SDB installation option, which specifies whether DFSORT should use the system-determined optimum block size for output data sets when the block size is specified as zero or defaulted to zero. System-determined block size applies to both SMS-managed and
Chapter 3. Using DFSORT Program Control Statements
203
204
| |
205
SKIPREC=z
Specifies the number of records z you want to skip (delete) before starting to sort or copy the input data set. SKIPREC is usually used if, on a preceding DFSORT run, you have processed only part of the input data set. An application with an input data set that exceeds intermediate storage capacity usually terminates unsuccessfully. However, for a tape work data set sort, you can use a routine at E16 (as described in Chapter 4, Using Your Own User Exit Routines, on page 435) to instruct the program to sort only those records already read in. It then prints a message giving the number of records sorted. You can use SKIPREC in a subsequent sort run to bypass the previously-sorted records, sort only the remaining records, and then merge the output from different runs to complete the application. z specifies the number of records to be skipped.
Limit: 28 digits (15 significant digits) Notes: 1. SKIPREC applies only to records read from SORTIN (not from E15 routines). (See Figure 2 on page 9.) 2. If SKIPREC=0 is in effect, SKIPREC is not used. 3. You may want to consider using the STARTREC parameter of the OUTFIL statement as an alternative to using SKIPREC. Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. SMF
SMF=
SHORT FULL NO
Temporarily overrides the SMF installation option, which specifies whether a DFSORT SMF record is to be produced as described in z/OS DFSORT Installation and Customization. SHORT specifies that DFSORT is to produce a short SMF type-16 record for a successful run. The short SMF record does not contain record-length distribution statistics or data set sections.
206
NO
Notes: 1. SMF is processed only if it is passed on the OPTION control statement in an extended parameter list or in DFSPARM. 2. SMF=FULL can degrade performance for a variable-length record application. 3. The DFSORT SVC is called to write SMF type-16 records. If SMF=SHORT or SMF=FULL is in effect, the correct DFSORT SVC for this release must be loaded in LPA or MLPA. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. SOLRF or NOSOLRF
SOLRF NOSOLRF
Temporarily overrides the SOLRF installation option, which specifies whether DFSORT should set the SORTOUT LRECL to the reformatted record length when the SORTOUT LRECL is unknown. SOLRF specifies that DFSORT should use the reformatted record length for the SORTOUT LRECL when the SORTOUT LRECL is not specified or available. DFSORT will use one of the following for the SORTOUT LRECL, in the order listed: 1. The SORTOUT LRECL if available from the JFCB, format 1 DSCB, DFSMSrmm, ICETPEX, or tape label The L3 length if specified in the RECORD statement The OUTREC length if the OUTREC statement is specified The INREC length if the INREC statement is specified The L2 length if specified in the RECORD statement providing an E15 user exit is present 6. The SORTIN or SORTINnn LRECL if available from the JFCB, format 1 DSCB, DFSMSrmm, ICETPEX, or tape label 7. The L1 length in the RECORD statement 2. 3. 4. 5. NOSOLRF specifies that DFSORT should not use the reformatted record length for the SORTOUT LRECL. DFSORT will use one of the following for the SORTOUT LRECL, in the order listed:
207
SORTDD=cccc
Specifies a four-character prefix for the ddnames to be used when you dynamically invoke DFSORT more than once in a program step. The four characters replace SORT in the following ddnames: SORTIN, SORTOUT, SORTINn, SORTINnn, SORTOFd, SORTOFdd, SORTWKd, SORTWKdd, and SORTCNTL. This allows you to use a different set of ddnames for each call to DFSORT. cccc Specifies a four-character prefix. The four characters must all be alphanumeric or national ($, #, or @). The first character must be alphabetic. The first three characters must not be SYS. For example, if you use ABC# as replacement characters, DFSORT uses DD statements ABC#IN, ABC#CNTL, ABC#WKdd, and ABC#OUT instead of SORTIN, SORTCNTL, SORTWKdd, and SORTOUT. Notes: 1. SORTDD is processed only if it is passed on the OPTION control statement in an extended parameter list, or in DFSPARM. 2. If both SORTIN=ddname and SORTDD=cccc are specified, ddname is used for DFSORT input. 3. If both SORTOUT=ddname and SORTDD=cccc are specified, ddname is used for DFSORT output.
208
SORTIN=ddname
Specifies a ddname to be associated with the SORTIN data set. This allows you to dynamically invoke DFSORT more than once in a program step, passing a different ddname for each input data set. The ddname can be 1 through 8 characters, but must be unique within the job step. Do not use ddnames reserved for use by DFSORT, such as ccccWKd, ccccWKdd, ccccDKd, or ccccDKdd , where cccc is the specified or defaulted value for the SORTDD operand and d is any character. Notes: 1. SORTIN is processed only if it is passed on the OPTION control statement in an extended parameter list, or in DFSPARM. 2. If both SORTIN=ddname and SORTDD=cccc are specified, ddname is used for the input file. The same ddname cannot be specified for SORTIN and SORTOUT. 3. If SORTIN is used for a tape work data set sort, DFSORT terminates. Default: SORTIN, unless SORTDD=cccc is specified in which case ccccIN is the default. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. SORTOUT
SORTOUT=ddname
| |
Specifies a ddname to be associated with the SORTOUT data set or with an OUTFIL data set for which FNAMES and FILES are not specified. This allows you to dynamically invoke DFSORT more than once in a program step, passing a different ddname for each output data set. The ddname can be 1 through 8 characters, but must be unique within the job step. Do not use ddnames reserved for use by DFSORT, such as ccccWKd, ccccWKdd, ccccDKd, or ccccDKdd , where cccc is the specified or defaulted value for the SORTDD operand and d is any character. Notes: 1. SORTOUT is processed only if it is passed on the OPTION control statement in an extended parameter list or in DFSPARM.
209
SPANINC=
Temporarily overrides the SPANINC installation option, which specifies the action to be taken by DFSORT when one or more incomplete spanned records are detected in a variable spanned input data set. RC0 specifies that DFSORT should issue message ICE197I (once), set a return code of 0 and eliminate all incomplete spanned records it detects. Valid records will be recovered. RC4 specifies that DFSORT should issue message ICE197I (once), set a return code of 4 and eliminate all incomplete spanned records it detects. Valid records will be recovered. RC16 specifies that DFSORT should issue message ICE204A, terminate and give a return code of 16 when an incomplete spanned record is detected. Notes: 1. The return code of 0 or 4 set for incomplete spanned records can be overridden by a higher return code set for some other reason. 2. In cases where a spanned record cannot be properly assembled (for example, it has a segment length less than 4 bytes), DFSORT issues ICE141A and terminates with a return code of 16. The SPANINC value has no effect in these cases. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. STOPAFT
210
Specifies the maximum number of records (n) you want accepted for sorting or copying (that is, read from SORTIN or inserted by E15 and not deleted by SKIPREC, E15, or the INCLUDE/OMIT statement). When n records have been accepted, no more records are read from SORTIN; E15 continues to be entered as if EOF were encountered until a return code of 8 is sent, but no more records are inserted. If end-of-file is encountered before n records are accepted, only those records accepted up to that point are sorted or copied. n specifies the maximum number of records to be accepted. Limit: 28 digits (15 significant digits) Default: None; optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. SZERO or NOSZERO
SZERO NOSZERO
Temporarily overrides the SZERO installation option, which specifies whether DFSORT should treat numeric 0 and +0 values as signed (that is, different) or unsigned (that is, the same) for collation, comparisons, editing and conversions, minimums and maximums. The following DFSORT control statements are affected by this option: INCLUDE, INREC, MERGE, OMIT, OUTFIL, OUTREC and SORT. SZERO specifies that DFSORT should treat numeric zero values as signed. 0 and +0 are treated as different values, that is, 0 is treated as a negative value and +0 is treated as a positive value. SZERO affects DFSORT processing of numeric values as follows: v For collation of SORT and MERGE fields, 0 collates before +0 in ascending order and after +0 in descending order. v For comparisons of INCLUDE, OMIT, and OUTFIL compare fields and constants, 0 compares as less than +0. v For editing and conversions of INREC, OUTREC, and OUTFIL reformatting fields, decimal constants, and the results of arithmetic expressions, 0 is treated as negative and +0 is treated as positive. v For minimums and maximums of OUTFIL TRAILERx fields, 0 is treated as negative and +0 is treated as positive. NOSZERO specifies that DFSORT should treat numeric zero values as unsigned. 0 and +0 are treated as the same value, that is, 0 and +0 are both treated as positive values. NOSZERO affects DFSORT processing of numeric values as follows:
Chapter 3. Using DFSORT Program Control Statements
211
| |
Default: Usually, the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. TRUNC
TRUNC=
Temporarily overrides the TRUNC installation option, which specifies the action to be taken by DFSORT when the SORTOUT LRECL is smaller than the SORTIN/SORTINnn LRECL, for the cases where DFSORT allows LRECL truncation. RC0 specifies that DFSORT should issue message ICE171I, set a return code of 0 and continue processing when the SORTOUT LRECL is smaller than the SORTIN/SORTINnn LRECL. RC4 specifies that DFSORT should issue message ICE171I, set a return code of 4 and continue processing when the SORTOUT LRECL is smaller than the SORTIN/SORTINnn LRECL. RC16 specifies that DFSORT should issue message ICE196A, terminate and give a return code of 16 when the SORTOUT LRECL is smaller than the SORTIN/SORTINnn LRECL.
212
USEWKDD
Temporarily overrides the DYNAUTO=IGNWKDD option, which specifies that dynamic work data sets are used even if SORTWKdd DD statements are present. This option allows JCL SORTWKdd data sets to be used rather than deallocated. Note: USEWKDD is processed only if it is passed on the OPTION control statement in an extended parameter list or in DFSPARM. Default: None, optional. See Appendix B, Specification/Override of DFSORT Options, on page 787 for full override details. Applicable Function: See Appendix B, Specification/Override of DFSORT Options, on page 787. VERIFY or NOVERIFY
VERIFY NOVERIFY
Temporarily overrides the VERIFY installation option, which specifies whether sequence checking of the final output records must be performed. VERIFY specifies that sequence checking is performed.
213
VLLONG NOVLLONG
Temporarily overrides the VLLONG installation option, which specifies whether DFSORT is to truncate long variable-length output records. A long output record is one whose length is greater than the LRECL of the SORTOUT or OUTFIL data set it is to be written to. VLLONG is not meaningful for fixed-length output record processing. VLLONG NOVLLONG specifies that DFSORT truncates long variable-length output records to the LRECL of the SORTOUT or OUTFIL data set. specifies that DFSORT terminates if a long variable-length output record is found.
Notes: 1. VLLONG should not be used unless you want the data at the end of long variable-length output records to be truncated for your DFSORT application; inappropriate use of VLLONG can result in unwanted loss of data. 2. VLLONG can be used to truncate long OUTFIL data records, but has no effect on long OUTFIL header or trailer records. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. VLSCMP or NOVLSCMP
VLSCMP NOVLSCMP
Temporarily overrides the VLSCMP installation option, which specifies whether DFSORT is to pad short variable-length INCLUDE/OMIT compare
214
If a variable-length input record has a length less than 71 bytes, the field at bytes 70-71 is short and the following occurs: v With VLSCMP, the record is included if byte 6 of the input record is C1 or omitted if byte 6 is not C1. The comparison of bytes 70-71 equal to CT1 is false because bytes 70-71 contain either Xhh00 (for a record length of 70 bytes) or X0000 (for a record length of less than 70 bytes). The comparison involving the non-short field is performed even though a short field is present. v With NOVLSCMP and VLSHRT, the record is omitted because any short field makes the entire logical expression false. The comparison involving the non-short field is not performed because a short field is present. v With NOVLSCMP and NOVLSHRT, DFSORT terminates because any short field results in termination. In general, comparisons involving short fields are false with VLSCMP. However, if a binary zero value is relevant to the comparison, the use of binary zeros for padding might make the comparison true. For example, suppose the following INCLUDE statement is used:
INCLUDE COND=(21,2,CH,EQ,C'JX',OR, (55,2,CH,EQ,58,2,CH,AND, 70,1,BI,LT,X'08'))
If a variable-length input record has a length less than 70 bytes, the field at byte 70 is short and is padded to X00. This makes the comparison of byte 70 less than X08 true even though byte 70 is a short field and so probably irrelevant. Likewise, if a variable-length record has a length less than 55 bytes, the fields at bytes 55-56 and 58-59 are short and are each padded to X0000, and the field at byte 70 is short and is padded to X00. This makes the comparison of
Chapter 3. Using DFSORT Program Control Statements
215
Now the comparisons involving bytes 55-56, 58-59 and 70 can only be true for records that are 70 bytes (X0046) or longer. Thus, the irrelevant comparisons involving short fields are eliminated. Keep in mind that short compare fields are padded with zeros when VLSCMP is in effect and code your INCLUDE/OMIT logical expressions to allow for that or even take advantage of it. VLSCMP NOVLSCMP specifies that short variable-length compare fields are padded with binary zeros. specifies that short variable-length compare fields are not padded.
Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. VLSHRT or NOVLSHRT
VLSHRT NOVLSHRT
Temporarily overrides the VLSHRT installation option, which specifies whether DFSORT is to continue processing if a short variable-length SORT/MERGE control field, INCLUDE/OMIT compare field, or SUM summary field is found. A short field is one where the variable-length record is too short to contain the entire field, meaning that the field extends beyond the record. VLSHRT applies to the SORT, MERGE, INCLUDE, OMIT and SUM statements, and to the INCLUDE and OMIT parameters of the OUTFIL statement. VLSHRT processing is not meaningful for fixed-length record processing. The way in which DFSORT processes short INCLUDE/OMIT compare fields depends on the settings for VLSCMP/NOVLSCMP and VLSHRT/NOVLSHRT. For details, see the discussion of the VLSCMP and NOVLSCMP options. VLSHRT specifies that DFSORT continues processing if a short control field, compare field or summary field is found. NOVLSHRT specifies that DFSORT terminates if a short control field, compare field or summary field is found.
216
VSAMEMT NVSAMEMT
Temporarily overrides the VSAMEMT installation option, which specifies whether DFSORT should accept an empty VSAM input data set.
217
VSAMIO NOVSAMIO
Temporarily overrides the VSAMIO installation option, which specifies whether DFSORT should allow a VSAM data set defined with REUSE to be sorted in-place. VSAMIO specifies that DFSORT can use the same VSAM data set for input and output when all of the following conditions are met: v The application is a sort. v RESET is in effect. v The VSAM data set was defined with REUSE. These conditions ensure that the VSAM data set is processed as NEW for output and will contain the sorted input records, that is, it will be sorted in-place. DFSORT terminates if the same VSAM data set is specified for input and output and any of the above conditions are not met. NOVSAMIO specifies that DFSORT terminates if the same VSAM data set is used for input and output. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. WRKREL or NOWRKREL
WRKREL NOWRKREL
Temporarily overrides the WRKREL installation option, which specifies whether unused temporary SORTWKdd data set space will be released.
218
WRKSEC NOWRKSEC
Temporarily overrides the WRKSEC installation option, which specifies whether DFSORT uses automatic secondary allocation for temporary JCL SORTWKdd data sets. WRKSEC specifies that automatic secondary allocation for temporary JCL SORTWKdd data sets is used and that 25 percent of the primary allocation will be used as the secondary allocation. NOWRKSEC specifies that automatic secondary allocation for temporary JCL SORTWKdd data sets is not used. Note: SEC=0 can be used instead of NOWRKSEC. SEC=n (n greater than 0) can be used instead of WRKSEC. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Functions: See Appendix B, Specification/Override of DFSORT Options, on page 787. Y2PAST
Y2PAST=
s f
219
Note: CENTURY=value and CENTWIN=value can be used instead of Y2PAST=value. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. ZDPRINT or NZDPRINT
ZDPRINT NZDPRINT
Temporarily overrides the ZDPRINT installation option, which specifies whether positive zoned-decimal (ZD) fields resulting from summing must be converted to printable numbers (that is, whether the zone of the last digit should be changed from a hexadecimal C to a hexadecimal F). See SUM Control Statement on page 428 for further details on the use of ZDPRINT and NZDPRINT. ZDPRINT means convert positive ZD summation results to printable numbers. For example, change hexadecimal F3F2C5 (prints as 32E) to F3F2F5 (prints as 325). means do not convert positive ZD summation results to printable numbers.
NZDPRINT
Note: ZDPRINT=YES can be used instead of ZDPRINT. ZDPRINT=NO can be used instead of NZDPRINT. Default: Usually the installation default. See Appendix B, Specification/ Override of DFSORT Options, on page 787 for full override details. Applicable Function: See Appendix B, Specification/Override of DFSORT Options, on page 787.
220
FIELDS The control field begins on the first byte of each record in the input data set, is 20 bytes long, contains character data, and is to be sorted in ascending order. SIZE The data set to be sorted contains 50000 records.
SKIPREC Five records are skipped (deleted) before starting to process the input data set. EQUALS The sequence of records that collate identically is preserved from input to output. DYNALLOC Two data sets (by default) are allocated on SYSDA (by default). The space on the data set is calculated using the SIZE value in effect.
Example 2
SORT FIELDS=(1,2,CH,A),CKPT OPTION EQUALS,NOCHALT,NOVERIFY,CHECK
221
Example 3
OPTION FILSZ=50,SKIPREC=5,DYNALLOC=3390 SORT FIELDS=(1,2,CH,A),SKIPREC=1,SIZE=200,DYNALLOC=(3380,5)
This example shows how parameters specified on the OPTION control statement override those specified on the SORT control statement, regardless of the order of the two statements. FILSZ DFSORT expects 50 records on the input data set. (Note that there is a difference in meaning between FILSZ and SIZE and that the OPTION specification of FILSZ is used in place of SIZE.) SKIPREC DFSORT causes five records from the beginning of the input file to be skipped. (SKIPREC=1 on the SORT statement is ignored.) DYNALLOC DFSORT allocates two work data sets (by default) on an IBM 3390. FIELDS The control field begins on the first byte of each record in the input data set, is 2 bytes long, contains character data, and is to be sorted in ascending order.
Example 4
OPTION NOBLKSET
NOBLKSET DFSORT does not use the Blockset technique for a sort or merge.
Example 5
OPTION STOPAFT=100
222
Example 6
OPTION RESINV=32000,MSGPRT=NONE, MSGDDN=SORTMSGS,SORTDD=ABCD,SORTIN=MYINPUT, SORTOUT=MYOUTPUT,NOLIST
This example illustrates the parameters RESINV, MSGPRT, MSGDDN, SORTDD, SORTIN, SORTOUT, and NOLIST, and the actions taken when these parameters are supplied on an OPTION statement read from the SYSIN data set or the SORTCNTL data set. The parameters are recognized, but not used. RESINV 32000 bytes of storage are reserved for the user.
MSGPRT=NONE The keyword is ignored, and messages are printed according to the installation default. MSGDDN=SORTMSGS The keyword is ignored, and all messages are written to the SYSOUT data set. SORTDD=ABCD The keyword is ignored, and the standard prefix SORT is used. SORTIN=MYINPUT The keyword is ignored, and the ddname SORTIN is used to reference the input data set. SORTOUT=MYOUTPUT The keyword is ignored, and the ddname SORTOUT is used to reference the output data set. NOLIST The keyword is ignored, and control statements are printed according to the installation defaults.
Example 7
OPTION RESINV=32000,MSGPRT=CRITICAL MSGDDN=SORTMSGS,SORTDD=ABCD,SORTIN=MYINPUT, SORTOUT=MYOUTPUT,NOLIST
This example illustrates keywords RESINV, MSGPRT, MSGDDN, SORTDD, SORTIN, SORTOUT, and NOLIST and the actions taken when these keywords are supplied on the OPTION control statement passed by DFSPARM. These options can also be passed in an extended parameter list, but must be coded as one contiguous statement without continuation lines. RESINV 32000 bytes of storage are reserved for the user.
MSGPRT=CRITICAL Only critical messages are printed on the message data set. MSGDDN=SORTMSGS Messages are written to the SORTMSGS data set. SORTDD=ABCD SORT uses ABCD as a prefix for all sort names. SORTIN=MYINPUT The ddname MYINPUT is used to reference the input data set.
223
Example 8
SORT FIELDS=(3,4,CH,A) OPTION COPY,SKIPREC=10,CKPT MODS E15=(E15,1024,MODLIB),E35=(E35,1024,MODLIB)
SORT The sort statement is ignored because the COPY option has been specified. COPY The copy processing is always done on a record-by-record basis. Each record is therefore read from SORTIN, passed to the E15 exit, passed to the E35 exit, and written to SORTOUT. (Contrast this with a sort, where all the records are read from SORTIN and passed to the E15 exit before any records are passed to the E35 exit and written to SORTOUT.) SKIPREC Ten records are skipped before copying starts. CKPT The checkpoint option is not used for copy applications.
Example 9
SORT FIELDS=(5,4,CH,A) SUM FIELDS=(12,5,ZD,25,6,ZD) OPTION ZDPRINT
ZDPRINT The positive summed ZD values are printable because DFSORT uses an F sign for the last digit.
224
FILES=
( suffix ) STARTREC=n ENDREC=n SAMPLE= n (n,m) INCLUDE= ( logical expression ) ALL NONE OMIT= ( logical expression ) ALL NONE SAVE , PARSE=( definition , ( item )
OUTREC= BUILD=
FINDREP= ( ,
IFTHEN=(clause) IFOUTLEN=n FTOV VLTRIM=byte REPEAT=n SPLIT SPLITBY=n SPLIT1R=n NULLOFL= RC0 RC4 RC16 LINES=n , HEADER1= ( item , item , item , ) )
TRAILER1= (
HEADER2= (
225
OUTFIL control statements allow you to create one or more output data sets for a sort, copy, or merge application from a single pass over one or more input data sets. You can use multiple OUTFIL statements, with each statement specifying the OUTFIL processing to be performed for one or more output data sets. OUTFIL processing begins after all other processing ends (that is, after processing for exits, options, and other control statements). OUTFILE can be used as an alias for OUTFIL. OUTFIL statements support a wide variety of output data set tasks, including: v Creation of multiple output data sets containing unedited or edited records from a single pass over one or more input data sets. v Creation of multiple output data sets containing different ranges or subsets of records from a single pass over one or more input data sets. In addition, records that are not selected for any subset can be saved in a separate output data set. v Conversion of variable-length record data sets to fixed-length record data sets. v Conversion of fixed-length record data sets to variable-length record data sets. v A wide variety of parsing, editing, and reformatting tasks including: The use of fixed position/length fields or variable position/length fields. For fixed fields, you specify the starting position and length of the field directly. For variable fields, such as delimited fields, comma separated values (CSV), tab separated values, blank separated values, keyword separated fields, null-terminated strings (and many other types), you define rules that allow DFSORT to extract the relevant data into fixed parsed fields, and then use the parsed fields as you would use fixed fields. Insertion of blanks, zeros, strings, current date, future date, past date, current time, sequence numbers, decimal constants, and the results of arithmetic expressions before, between, and after the input fields in the reformatted records. Sophisticated conversion capabilities, such as find and replace, hexadecimal display, conversion of EBCDIC letters from lowercase to uppercase or uppercase to lowercase, conversion of characters using the ALTSEQ translation table, conversion of numeric values from one format to another, left justify or left-squeeze (remove leading blanks or all blanks and shift left), and right-justify or right-squeeze (remove trailing blanks or all blanks and shift right).
226
| | | v
v v v
The parameters of OUTFIL are grouped by primary purpose as follows: v FNAMES and FILES specify the ddnames of the OUTFIL data sets to be created. Each OUTFIL data set to be created must be specifically identified using FNAMES or FILES in an OUTFIL statement. By contrast, the SORTOUT data set is created by default if a DD statement for it is present. The term SORTOUT data set denotes the single non-OUTFIL output data set, but in fact, the SORTOUT ddname can be used for an OUTFIL data set either explicitly or by default. If SORTOUT is identified as an OUTFIL ddname, either explicitly (for example, via FILES=OUT) or by default (OUTFIL without FILES or FNAMES), the data set associated with the SORTOUT ddname will be processed as an OUTFIL data set rather than as the SORTOUT data set. OUTFIL data sets have characteristics and requirements similar to those for the SORTOUT data set, but there are differences in the way each is processed. The major differences are that an E39 exit routine is not entered for OUTFIL data sets, and that OUTFIL processing does not permit the use of the LRECL value to pad fixed-format OUTFIL records. (DFSORT will automatically determine and set an appropriate RECFM, LRECL, and BLKSIZE for each OUTFIL data set for which these attributes are not specified or available.) For a single DFSORT application, OUTFIL data sets can be intermixed with respect to VSAM and non-VSAM, tape and disk, and so on. All of the data sets
Chapter 3. Using DFSORT Program Control Statements
227
| |
228
| |
229
Notes: 1. DFSORT accepts but does not process the following OUTFIL operands: BLKSIZE=value, BUFLIM=value, BUFOFF=value, CARDS=value,
230
FNAMES=
ddname , ( ddname )
Specifies ddnames associated with the OUTFIL data sets for this OUTFIL statement. The ddnames specified using the FNAMES and FILES parameters constitute the output data sets for this OUTFIL group to which all of the other parameters for this OUTFIL statement apply. | | | If FNAMES specifies the ddname in effect for the SORTOUT data set (that is, whichever is in effect among ddname from SORTOUT=ddname, ccccOUT from SORTDD=cccc, or SORTOUT) DFSORT will treat the data set associated with that ddname as an OUTFIL data set rather than as the SORTOUT data set. ddname specifies a 1- through 8-character ddname. A DD statement must be present for this ddname. Sample Syntax:
OUTFIL FNAMES=(OUT1,OUT2,PRINTER,TAPE) OUTFIL FNAMES=BACKUP
| | | | |
Default for FNAMES: If neither FNAMES nor FILES is specified for an OUTFIL statement, the default ddname is: v ddname if SORTOUT=ddname is in effect v ccccOUT if SORTDD=cccc is in effect and SORTOUT=ddname is not in effect v SORTOUT if neither SORTOUT=ddname nor SORTDD=cccc is in effect. FILES
FILES=
d dd OUT , ( d dd OUT )
Specifies suffixes for ddnames to be associated with the OUTFIL data sets for this OUTFIL statement. The ddnames specified using the FNAMES and FILES
231
dd specifies the 2-character suffix to be used to form the ddname SORTOFdd or ccccOFdd if SORTDD=cccc is in effect. A DD statement must be present for this ddname. OUT specifies the suffix OUT is to be used to form the ddname SORTOUT or ccccOUT if SORTDD=cccc is in effect. A DD statement must be present for this ddname. Sample Syntax:
OUTFIL FILES=(1,2,PR,TP) OUTFIL FILES=OUT
| | | | |
Default for FILES: If neither FNAMES nor FILES is specified for an OUTFIL statement, the default ddname is: v ddname if SORTOUT=ddname is in effect v ccccOUT if SORTDD=cccc is in effect and SORTOUT=ddname is not in effect v SORTOUT if neither SORTOUT=ddname nor SORTDD=cccc is in effect. STARTREC
STARTREC=n
Specifies the OUTFIL input record at which OUTFIL processing is to start for this OUTFIL group. OUTFIL input records before this starting record are not included in the data sets for this OUTFIL group. n specifies the relative record number. The value for n starts at 1 (the first record) and is limited to 28 digits (15 significant digits).
Sample Syntax:
OUTFIL FNAMES=SKIP20,STARTREC=21
ENDREC=n
232
Sample Syntax:
SAMPLE=
n (n,m)
Specifies a sample of OUTFIL input records to be processed for this OUTFIL group. The sample consists of the first m records in every nth interval. n m specifies the interval size. The value for n starts at 2 (sample every other record) and is limited to 28 digits (15 significant digits). specifies the number of records to be processed in each interval. The value for m starts at 1 (process the first record in each interval) and is limited to 28 digits (15 significant digits). If m is not specified, 1 is used for m. If m is specified, it must be less than n.
Sample Syntax:
* PROCESS RECORDS 1, 6, 11, ... OUTFIL FNAMES=OUT1,SAMPLE=5 * PROCESS RECORDS 1, 2, 1001, 1002, 2001, 2002 OUTFIL FNAMES=OUT2,SAMPLE=(1000,2),ENDREC=2500 * PROCESS RECORDS 23, 48, 73 OUTFIL FNAMES=OUT3,STARTREC=23,ENDREC=75,SAMPLE=25 * PROCESS RECORDS 1001, 1002, 1003, 1101, 1102, 1103, ... OUTFIL FNAMES=OUT4,STARTREC=1001,SAMPLE=(100,3)
INCLUDE=
Selects the records to be included in the data sets for this OUTFIL group.
Chapter 3. Using DFSORT Program Control Statements
233
v D2 format can be specified with the INCLUDE statement, but not with the INCLUDE parameter. See INCLUDE Control Statement on page 98 for complete details. logical expression specifies one or more relational conditions logically combined based on fields in the OUTFIL input record. If the logical expression is true for a given record, the record is included in the data sets for this OUTFIL group. ALL NONE specifies that all of the OUTFIL input records are to be included in the data sets for this OUTFIL group. specifies that none of the OUTFIL input records are to be included in the data sets for this OUTFIL group.
Sample Syntax:
OUTFIL FNAMES=J69,INCLUDE=(5,3,CH,EQ,C'J69') OUTFIL FNAMES=J82,INCLUDE=(5,3,CH,EQ,C'J82')
OMIT=
Selects the records to be omitted from the data sets for this OUTFIL group. The OMIT parameter operates in the same way as the OMIT statement, except that: v The OMIT statement applies to all input records; the OMIT parameter applies only to the OUTFIL input records for its OUTFIL group. v FORMAT=f can be specified with the OMIT statement, but not with the OMIT parameter. Thus, you can use FORMAT=f and p,m or p,m,f fields with the OMIT statement, but you must only use p,m,f fields with the OMIT parameter. For example:
234
v The D2 format can be specified with the OMIT statement, but not with the OMIT parameter. See OMIT Control Statement on page 167 and INCLUDE Control Statement on page 98 for complete details. logical expression specifies one or more relational conditions logically combined based on fields in the OUTFIL input record. If the logical expression is true for a given record, the record is omitted from the data sets for this OUTFIL group. ALL specifies that all of the OUTFIL input records are to be omitted from the data sets for this OUTFIL group. NONE specifies that none of the OUTFIL input records are to be omitted from the data sets for this OUTFIL group. Sample Syntax:
OUTFIL FILES=01,OMIT=NONE OUTFIL OMIT=(5,1,BI,EQ,B'110.....') OUTFIL FNAMES=(OUT1,OUT2), OMIT=(7,2,CH,EQ,C'32',OR,18,3,CH,EQ,C'XYZ')
SAVE
Specifies that OUTFIL input records not included by STARTREC, ENDREC, SAMPLE, INCLUDE or OMIT for any other OUTFIL group are to be included in the data sets for this OUTFIL group. SAVE operates in a global fashion over all of the other OUTFIL statements for which SAVE is not specified, enabling you to keep any OUTFIL input records that would not be kept otherwise. SAVE will include the same records for each group for which it is specified. Sample Syntax:
OUTFIL INCLUDE=(8,6,CH,EQ,C'ACCTNG'),FNAMES=GP1 OUTFIL INCLUDE=(8,6,CH,EQ,C'DVPMNT'),FNAMES=GP2 OUTFIL SAVE,FNAMES=NOT1OR2
235
This operand allows you to extract variable position/length fields into fixed parsed fields. Parsed fields (%nn) can be used where fixed position/length fields (p,m) can be used in the BUILD (or OUTREC) or OVERLAY operands as described later in this section. PARSE can be used for many different types of variable fields including delimited fields, comma separated values (CSV), tab separated values, blank separated values, keyword separated fields, null-terminated strings, and so on. You can assign up to 100 %nn parsed fields (%00-%99) to the variable fields you want to extract. Note that if all of the fields in your records have fixed positions and lengths, you dont need to use PARSE. But if any of the fields in your records have variable positions or lengths, you can use PARSE to treat them as fixed parsed fields in BUILD or OVERLAY. You can mix p,m fields (fixed fields) and %nn fields (parsed fields) in BUILD and OVERLAY. For each %nn parsed field, you define where the data to be extracted starts and ends, and the length (m) of the fixed field to contain the extracted data. For example, if your input records contained CSV data as follows:
AA,BBBB,C,DDDDD EEEEE,,F,GG HHH,IIIII,JJ,K
and you wanted to reformat the data into fixed positions like this:
AA EEEEE HHH BBBB IIIII C F JJ DDDDD GG K
236
237
For this example, the Start Pointer advances as follows for the first record: v For %00: Set Start Pointer to position 1. Start searching for * end string at position 1. Extract 11 (per ENDBEFR=C*). Set Start Pointer after * (at +). v For %01: Start searching for end blank at the Start Pointer (at +). Extract +23 (per ENDBEFR=BLANKS). Set Start Pointer after the blanks (at N). v For %02: Start searching for MAX start string at the Start Pointer (at N). Extract MAXCC=00 (per FIXLEN=8). Increment Start Pointer by m (8) bytes from the start of the extracted string (at blank after 00). v For %03: Start searching for ( start string at Start Pointer (at blank after 00). Set Start Pointer after ( (at M). Start searching for ) end string at Start Pointer (at M). Extract Monica (per ENDBEFR=C)). Set Start Pointer after ) (at blank after )). v For %04: Start searching for start blank at the Start Pointer (at blank after )). Extract 18 (per FIXLEN=5). If the Start Pointer advances past the end of the record, PARSE processing stops. For example, if you had these input records:
238
the %01 parsed field (middle name) is not found in the first record, so PARSE processing stops and the %02 parsed field is set to blanks. You can handle this kind of possible missing field situation by using IFTHEN PARSE instead of PARSE. For example:
OUTFIL FNAMES=OUT1, IFTHEN=(WHEN=INIT, PARSE=(%00=(STARTAFT=C'First=',ENDBEFR=C' ',FIXLEN=12))), IFTHEN=(WHEN=INIT, PARSE=(%01=(STARTAFT=C'Middle=',ENDBEFR=C' ',FIXLEN=12))), IFTHEN=(WHEN=INIT, PARSE=(%02=(STARTAFT=C'Last=',ENDBEFR=C' ',FIXLEN=12)), BUILD=(%00,%01,%02))
By default, the Start Pointer is set to 1 (F) or 5 (V) for each IFTHEN PARSE, so the missing middle name in the first record does not prevent the last name from being extracted. See the discussion of IFTHEN for more information on IFTHEN PARSE. You must define each %nn field with PARSE before you use it in BUILD or OVERLAY, so generally you would want to specify PARSE before BUILD or OVERLAY. If you define a %nn field with PARSE, but do not use it in BUILD or OVERLAY, data will not be extracted for that parsed field. Each %nn parsed field (%00-%99) can only be defined once per run with PARSE, but can be used as many times as needed in BUILD or OVERLAY. The %nn parsed fields defined for a particular source (INREC, OUTREC or OUTFIL) can only be used in the BUILD or OVERLAY operands for that source. Generally, you will only use PARSE for one source (for example, INREC) per run. But you could define a separate set of %nn parsed fields for each source, if needed. For example, you could define %21 and %22 for the INREC statement, %01, %02 and %03 for the OUTREC statement, %40 and %45 for OUTFIL statement 1, and %30, %31 and %32 for OUTFIL statement 2. You could then use %21 and %22 for INREC BUILD or OVERLAY, %02 and %03 for OUTREC BUILD or OVERLAY, %40 and %45 for OUTFIL statement 1 BUILD or OVERLAY, and %30, %31 and %32 for OUTFIL statement 2 BUILD or OVERLAY. Note that you could not, for example, use %21 and %22 for OUTREC BUILD or OVERLAY. If you specify PARSE=(...),IFTHEN=(...) or IFTHEN=(...),PARSE=(...), DFSORT will terminate. If you need to specify PARSE with IFTHEN, specify it within one or more individual IFTHEN clauses, as appropriate. For details, see the description of IFTHEN. %nn Assigns %nn to a parsed field. The variable-length data defined for the parsed field is extracted to a fixed length area (padded with blanks or truncated as appropriate) and can be used where a p,m field can be used in BUILD or OVERLAY.
Chapter 3. Using DFSORT Program Control Statements
239
% Specifies a parsed field to be ignored. No data is extracted, but the starting point for the next parsed field advances according to the suboperands specified. Use % when you dont need the data from a particular field, but you do need to get to the next field. For example, if we had the four CSV fields shown earlier as input, but we only wanted to extract the first and fourth fields, we could use this OUTFIL statement:
OUTFIL PARSE=(%01=(ENDBEFR=C',',FIXLEN=5), %=(ENDBEFR=C','), %=(ENDBEFR=C','), %04=(FIXLEN=5)), BUILD=(1:%01,11:%04,21:%01,HEX)
Data is extracted for %01 (first field) and %04 (fourth field), but not for % (second and third fields). FIXLEN=m Specifies the length (m) of the fixed area to contain the extracted variable-length data for this %nn fixed parsed field. m can be 1 to 32752. You must specify FIXLEN=m for each %nn parsed field. FIXLEN=m is optional for a % ignored field. When %nn is specified in BUILD or OVERLAY, the variable-length data is extracted to the fixed area and then used for BUILD or OVERLAY processing. The fixed area always contains m bytes. If the extracted data is longer than m, the fixed area contains the first m bytes of the extracted data (the data is truncated on the right to m bytes). If the extracted data is shorter than m, the fixed area contains the extracted data padded with blanks on the right to m bytes. If no data is extracted, the fixed area contains all blanks. The length m from FIXLEN=m for fixed parsed fields (%nn) corresponds to the length (m) for fixed fields (p,m). Keep in mind that %nn fields are left-aligned and may be padded on the right with blanks. You must ensure that the data in each %nn field and its length (m) are valid for the way you want to use that %nn field in BUILD or OVERLAY. For example, if you had these records as input:
123,8621 1,302 18345,17
240
Note that the 5-byte extracted parsed fields for %00 are left-aligned and padded with blanks (b) like this:
123bb 1bbbb 18345
and the 5-byte extracted parsed fields for %01 are left-aligned and padded with blanks (b) like this:
8621b 302bb 17bbb
Thus, you cannot use numeric formats like ZD or FS for these parsed fields, but you can use UFF. Note also that you must ensure that m from FIXLEN=m for each %nn parsed field is valid for the specific BUILD or OVERLAY item in which you use %nn. For example, you could use 1-44 as m for UFF, but you couldnt use 45 as m. If ENDBEFR and ENDAT are not specified, the Start Pointer is set m bytes past the start of the extracted data. For example, if you had this record as input:
MAX=(ABCDEF)
Sample Syntax
OUTFIL PARSE=(%00=(STARTAFT=C'KW=',FIXLEN=12)), BUILD=(%00)
ABSPOS=p Sets the Start Pointer for this parsed field to p. p can be 1 to 32752. By default, the Start Pointer for the first %nn parsed field is position 1 for fixed-length records or position 5 for variable-length records, and the Start Pointer for each subsequent %nn parsed field is the Start Pointer set by the previous %nn field. You can use ABSPOS=p to set the Start Pointer to position p to override the default Start Pointer. If the resulting Start Pointer is less than position 5 for variable length records, it will be set to position 5. Example If your input is:
****|BB|CCCC| ****|EEEE|FF|
and you wanted to reformat the data into fixed positions like this:
**** BB CCCC **** EEEE FF
241
The initial Start Pointer for the %01 parsed field is set to position 6 instead of to position 1. ADDPOS=x Increments the Start Pointer for this parsed field by x. x can be 1 to 32752. By default, the Start Pointer for the first %nn parsed field is position 1 for fixed-length records or position 5 for variable-length records, and the Start Pointer for each subsequent %nn parsed field is the Start Pointer set by the previous %nn field. You can use ADDPOS=x to increment the Start Pointer by x to override the default Start Pointer. Sample Syntax
OUTFIL PARSE=(%00=(ENDAT=C'||',FIXLEN=10), %01=(ADDPOS=5,STARTAFT=C';',FIXLEN=6)), BUILD=(%00,TRAN=ALTSEQ,%01)
SUBPOS=y Decrements the Start Pointer for this parsed field by y. y can be 1 to 32752. By default, the Start Pointer for the first %nn parsed field is position 1 for fixed-length records or position 5 for variable-length records, and the Start Pointer for each subsequent %nn parsed field is the Start Pointer set by the previous %nn field. You can use SUBPOS=y to decrement the Start Pointer by x to override the default Start Pointer. If the resulting Start Pointer is less than position 1 for fixed-length records, it will be set to position 1. If the resulting Start Pointer is less than position 5 for variable-length records, it will be set to position 5. Sample Syntax
OUTFIL PARSE=(%00=(ENDBEFR=C'|;|',FIXLEN=10), %01=(SUBPOS=1,STARTAT=C'|',ENDAT=C'|',FIXLEN=12)), BUILD=(%00,TRAN=ALTSEQ,%01)
STARTAFT=string Data is to be extracted for this parsed field starting after the last byte of the specified string. The search for the string begins at the Start Pointer. If the specified string is not found, data is not extracted for this parsed field or any subsequent parsed fields. If the specified string is found, data is extracted to the fixed area for this parsed field starting at the byte after the end of the string, and the Start Pointer is set to the byte after the end of the string. string can be 1 to 256 characters specified using a character string constant (Cxx...x) or a hexadecimal string constant (Xyy...yy). See INCLUDE Control Statement on page 98 for details of coding character and hexadecimal string constants. Example If your input is:
MAX=25,832 MAX=1,275 MIN=17 %3 MIN=2,831 $4
and you wanted your output to contain MAX-MIN, you could use this OUTFIL statement:
OUTFIL PARSE=(%00=(STARTAFT=C'MAX=',ENDBEFR=X'40',FIXLEN=6), %01=(STARTAFT=C'MIN=',ENDBEFR=X'40',FIXLEN=6)), OVERLAY=(50:C'DELTA: ',%00,UFF,SUB,%01,UFF,TO=ZD,LENGTH=8)
242
STARTAT=string Data is to be extracted for this parsed field starting at the first byte of the specified string. The search for the string begins at the Start Pointer. If the specified string is not found, data is not extracted for this parsed field or any subsequent parsed fields. If the specified string is found, data is extracted to the fixed area for this parsed field starting at the first byte of the string, and the Start Pointer is set to the byte after the end of the string. string can be 1 to 256 characters specified using a character string constant (Cxx...x) or a hexadecimal string constant (Xyy...yy). See INCLUDE Control Statement on page 98 for details of coding character and hexadecimal string constants. Example If your input is:
MAX=58321 MIN=00273 MAX=01275 MIN=00017
STARTAT=BLANKS Data is to be extracted for this parsed field starting at the first blank. The search for a blank begins at the Start Pointer. If a blank is not found, data is not extracted for this parsed field or any subsequent parsed fields. If a blank is found, data is extracted to the fixed area for this parsed field starting at the first blank, and the Start Pointer is set to the first nonblank.
243
Note: Multiple STARTAFT/STARTAT strings, BLANKS or NONBLANK can be used for a %nn parsed field to search for more than one string, blanks or a nonblank. The first search satisfied is used. Example If your input is:
12 MAXCC=08 58 MINCC=00 MAXCC=04
ENDBEFR=string Data is to be extracted for this parsed field ending before the first byte of the specified string. The search for the string begins at the Start Pointer. If the specified string is not found, data is extracted to the fixed area for this parsed field up to the end of the record, but data is not extracted for any subsequent parsed fields. If the specified string is found, data is extracted to the fixed area for this parsed field up to the byte before the start of the string, and the Start Pointer is set to the byte after the end of the string. string can be 1 to 256 characters specified using a character string constant (Cxx...x) or a hexadecimal string constant (Xyy...yy). See INCLUDE Control Statement on page 98 for details of coding character and hexadecimal string constants.
244
ENDBEFR=X00 can be used to extract null-terminated strings to fixed parsed fields. Example If your input contains null-terminated strings that look like this in hex:
F0F5F800 F1F2F3F4F500 F9F7F2F000 F500 F0F0F3F700
and you wanted to convert the null-terminated strings to right-aligned numeric values like this:
58 12345 9720 5 37
ENDBEFR=BLANKS Data is to be extracted for this parsed field ending before the first blank. The search for a blank begins at the Start Pointer. If a blank is not found, data is extracted to the fixed area for this parsed field up to the end of the record, but data is not extracted for any subsequent parsed fields. If a blank is found, data is extracted to the fixed area for this parsed field up to the byte before the blank, and the Start Pointer is set to the first nonblank. Example If your input is:
1 Frank 2 Loretta D28 123 D52 No 58 Yes
245
ENDAT=string Data is to be extracted for this parsed field ending at the last byte of the specified string. The search for the string begins at the Start Pointer. If the specified string is not found, data is extracted to the fixed area for this parsed field up to the end of the record, but data is not extracted for any subsequent parsed fields. If the specified string is found, data is extracted to the fixed area for this parsed field up to the last byte of the string, and the Start Pointer is set to the byte after the end of the string string can be 1 to 256 characters specified using a character string constant (Cxx...x) or a hexadecimal string constant (Xyy...yy). See INCLUDE Control Statement on page 98 for details of coding character and hexadecimal string constants. Example If your input is:
12,(June) 5852,(Gracie)
ENDAT=BLANKS Data is to be extracted for this parsed field ending at the last blank before a nonblank. The search for a blank begins at the Start Pointer. If a blank is not found, data is extracted to the fixed area for this parsed field up to the end of the record, but data is not extracted for any subsequent parsed fields. If a blank is found, data is extracted to the fixed area for this parsed field up to the byte before the first nonblank, and the Start Pointer is set to the first nonblank. Note: Multiple ENDBEFR/ENDAT strings or BLANKS can be used for a %nn parsed field to search for more than one string or blanks. The first search satisfied is used. Example If your input is:
12; 58: 04/
246
PAIR=APOST Do not search for strings or blanks between apostrophe () pairs. Use POST=APOST when you might have strings you are searching for within literals that should not satisfy the search. Once an apostrophe is found, searching is discontinued until another apostrophe is found. Searching then continues after the second apostrophe of the pair. If an unpaired apostrophe is found, strings or BLANKS will not be recognized from that point on, so be careful not to set the Start Pointer in the middle of an apostrophe pair. Do not specify PAIR=APOST if you want to search for a string containing an apostrophe, because the string will not be searched for within the paired apostrophes. Example If your input is:
'23','12,567,823','5,032' '9,903','18,321','8'
With PAIR=APOST, the commas outside the apostrophe pairs satisfy the search, but the commas within the apostrophe pairs do not satisfy the search. PAIR=QUOTE Do not search for strings or blanks between quote () pairs. Use POST=QUOTE when you might have strings you are searching for within literals that should not satisfy the search. Once a quote is found, searching is discontinued until another quote is found. Searching then continues after the second quote of the pair. If an unpaired quote is found, strings or BLANKS will not be recognized from that point on, so be careful not to set the Start Pointer in the middle of a quote pair. Do not specify PAIR=QUOTE if you want to search for a string containing a quote, because the string will not be searched for within the paired quotes. Example If your input is:
"23","12,567,823","5,032" "9,903","18,321","8"
247
With PAIR=QUOTE, the commas outside the quote pairs satisfy the search, but the commas within the quote pairs do not satisfy the search. Default for PARSE: None; must be specified. | OUTREC, BUILD, OVERLAY, FINDREP, or IFTHEN
FINDREP=( ( ,
IFTHEN=(clause)
These operands allow you to reformat the OUTFIL input records in this OUTFIL group. You can create the reformatted OUTFIL records in one of the following ways using unedited, edited, or converted input fields (p,m for fixed fields, or %nn for parsed fields - see PARSE) and a variety of constants: v BUILD or OUTREC: Reformat each record by specifying all of its items one by one. Build gives you complete control over the items you want in your reformatted OUTFIL records and the order in which they appear. You can delete, rearrange and insert fields and constants. Examples:
OUTFIL FNAMES=OUT1,BUILD=(1,20,C'ABC',26:5C'*', 15,3,PD,EDIT=(TTT.TT),21,30,80:X) OUTFIL FNAMES=OUT2, PARSE=(%00=(ENDBEFR=C',',FIXLEN=6), %01=(ENDBEFR=C',',FIXLEN=5), %=(ENDBEFR=C','), %02=(FIXLEN=6)), BUILD=(C'|',%01,SFF,ADD,%02,SFF,M4,LENGTH=12, C'|',%00,C'|')
v OVERLAY: Reformat each record by specifying just the items that overlay specific columns. Overlay lets you change specific existing columns without affecting the entire record. Example:
OUTFIL OVERLAY=(45:45,8,TRAN=LTOU)
248
v IFTHEN clauses: Reformat different records in different ways by specifying how build, overlay, find/replace, or group operation items are applied to records that meet given criteria. IFTHEN clauses let you use sophisticated conditional logic to choose how different record types are reformatted. Example:
OUTFIL IFTHEN=(WHEN=(1,5,CH,EQ,C'TYPE1'), BUILD=(1,40,C'**',+1,TO=PD)), IFTHEN=(WHEN=(1,5,CH,EQ,C'TYPE2'), BUILD=(1,40,+2,TO=PD,X'FFFF')), IFTHEN=(WHEN=NONE,OVERLAY=(45:C'NONE'))
You can choose to include any or all of the following items in your reformatted OUTFIL records: v Fixed position/length fields or variable position/length fields. For fixed fields, you specify the starting position and length of the field directly. For variable fields, such as delimited fields, comma separated values (CSV), tab separated values, blank separated values, keyword separated fields, null-terminated strings (and many other types), you define rules that allow DFSORT to extract the relevant data into fixed parsed fields, and then use the parsed fields as you would use fixed fields. v Blanks, binary zeros, character strings, and hexadecimal strings. v Current date, future date, past date, and current time in various forms. | v Replaced or removed strings. v Unedited input fields aligned on byte, halfword, fullword, and doubleword boundaries. v Hexadecimal representations of binary input fields. v Left-justified, right-justified, left-squeezed or right-squeezed input fields. v Numeric input fields of various formats converted to different numeric formats, or to character format edited to contain signs, thousands separators, decimal points, leading zeros or no leading zeros, and so on. v Decimal constants converted to different numeric formats, or to character format edited to contain signs, thousands separators, decimal points, leading zeros or no leading zeros, and so on. v The results of arithmetic expressions combining fields, decimal constants, operators (MIN, MAX, MUL, DIV, MOD, ADD and SUB) and parentheses converted to different numeric formats, or to character format edited to contain signs, thousands separators, decimal points, leading zeros or no leading zeros, and so on. v SMF, TOD, and ETOD date and time fields converted to different numeric formats, or to character format edited to contain separators, leading zeros or no leading zeros, and so on. v Two-digit year input dates of various formats converted to four-digit year dates in different numeric formats, or to character format edited to contain separators, leading zeros or no leading zeros, and so on. v Sequence numbers in various formats. v A character constant, hexadecimal constant or input field selected from a lookup table, based on a character, hexadecimal or bit constant as input. v A zoned decimal group identifier, a zoned decimal group sequence number, or a field propagated from the first record of a group to all of the records of a group.
Chapter 3. Using DFSORT Program Control Statements
| | |
249
, OUTREC= BUILD= ( c: s p,m ,a %nn p p,m,HEX %nn,HEX p,HEX p,m,TRAN=LTOU %nn,TRAN=LTOU p,TRAN=LTOU p,m,TRAN=UTOL %nn,TRAN=UTOL p,TRAN=UTOL p,m,TRAN=ALTSEQ %nn,TRAN=ALTSEQ p,TRAN=ALTSEQ p,m,Y2x %nn,Y2x p,m,Y2x(c) %nn,Y2x(c) p,m,Y2xP %nn,Y2xP p,m,f ,edit %nn,f ,to (p,m,f) (%nn,f) deccon ,edit (deccon) ,to arexp ,edit (arexp) ,to p,m,Y2x ,edit ,to %nn,Y2x ,edit ,to p,m,lookup %nn,lookup p,m,justify %nn,justify p,m,squeeze %nn,squeeze seqnum )
Specifies all of the items in the reformatted OUTFIL record in the order in which they are to be included. The reformatted OUTFIL record consists of the separation fields, edited and unedited input fields (p,m for fixed fields, or %nn for parsed fields - see PARSE), edited decimal constants, edited results of arithmetic expressions, and sequence numbers you select, in the order in which you select them, aligned on the boundaries or in the columns you indicate. For variable-length records, the first item in the BUILD or OUTREC parameter must specify or include the unedited 4-byte record descriptor word (RDW), that is, you must start with 1,m with m equal to or greater than 4. If you want
250
For fixed-length records, the first input and output data byte starts at position 1. For variable-length records, the first input and output data byte starts at position 5, after the RDW in positions 1-4. You can use the BUILD or OUTREC parameter to produce multiple reformatted output records for each OUTFIL input record, with or without intervening blank output records. You can use the BUILD or OUTREC parameter in conjunction with the VTOF or CONVERT parameter to convert variable-length record data sets to fixed-length record data sets. You can use the BUILD or OUTREC parameter with the FTOV parameter to convert fixed-length record data sets to variable-length record data sets. You can use the VLFILL parameter to allow processing of variable-length input records which are too short to contain all specified BUILD or OUTREC fields. You can use the VLTRIM parameter in conjunction with the BUILD or OUTREC parameter to remove specified trailing bytes from the end of variable-length records. The BUILD or OUTREC parameter can be used with any or all of the report parameters (LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS, BLKCCH1, BLKCCH2, BLKCCT1, and NODETAIL) to produce reports. The report parameters specify the report records to be produced, while the BUILD or OUTREC parameter specifies the reformatted data records to be produced. DFSORT uses ANSI carriage control characters to control page ejects and the placement of the lines in your report, according to your specifications. You can use the REMOVECC parameter to remove the ANSI carriage control characters. When you create an OUTFIL report, the length for the longest or only data record must be equal to or greater than the maximum report record length. You can use the BUILD or OUTREC parameter to force a length for the data records that is longer than any report record; you can then either let DFSORT compute and set the LRECL, or ensure that the computed LRECL is equal to the existing or specified LRECL. Remember to allow an extra byte in the LRECL for the ANSI carriage control character. For example, if your data records are 40 bytes, but your longest report record is 60 bytes, you can use a BUILD or OUTREC parameter such as:
OUTREC=(1,40,80:X)
DFSORT will then set the LRECL to 81 (1 byte for the ANSI carriage control character plus 80 bytes for the length of the data records), and pad the data records with blanks on the right. If you dont want the ANSI carriage control characters to appear in the