z/os v1r6.0 dfsort application programming guide · pdf file · 2012-02-16dfsort...

796
z/OS DFSORT Application Programming Guide SC26-7523-01

Upload: vanxuyen

Post on 28-Mar-2018

228 views

Category:

Documents


2 download

TRANSCRIPT

  • z/OS

    DFSORT Application Programming Guide

    SC26-7523-01

  • z/OS

    DFSORT Application Programming Guide

    SC26-7523-01

  • Note Before using this information and the product it supports, be sure to read the general information under Notices on page 745.

    Second Edition, March 2005

    This edition applies to Version 1 Release 6 of z/OS (5694-A01), Version 1 Release 6 of z/OS.e (5655-G52) and to all subsequent releases and modifications until otherwise indicated in new editions.

    This edition replaces SC26752300.

    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 Department 55JA, Mail Station P384

    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 commentWhen 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, 2005. All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

    http://www.ibm.com/servers/eserver/zseries/zos/webqs.html

  • 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 Accessing z/OS licensed documents on the Internet xvi Notational conventions . . . . . . . . . . xvi

    Summary of Changes . . . . . . . . xix Summary of Changes for SC26-7523-01 z/OS Version 1 Release 6 (PTFs - December, 2004) . . . xix

    New Information . . . . . . . . . . . xix Operational Changes that may Require User Action . . . . . . . . . . . . . . xxiii

    Summary of Changes for SC26-7523-00 z/OS Version 1 Release 5 . . . . . . . . . . . xxiv

    New Information . . . . . . . . . . . xxiv Summary of Changes for SC33-4035-21 DFSORT Release 14 (PTFs - February, 2003) . . . . . . xxv

    New Information . . . . . . . . . . . xxv Summary of Changes for SC33-4035-21 DFSORT Release 14 (PTFs - March, 2002) . . . . . . . xxvii

    New Information . . . . . . . . . . xxvii

    Chapter 1. Introducing DFSORT . . . . 1 DFSORT Overview . . . . . . . . . . . . 1 DFSORT on the Web . . . . . . . . . . . . 4 DFSORT FTP Site . . . . . . . . . . . . . 4 Invoking DFSORT . . . . . . . . . . . . 4 How DFSORT Works . . . . . . . . . . . 5

    Operating Systems . . . . . . . . . . . 5 Control Fields and Collating Sequences . . . . 5 Cultural Environment Considerations . . . . . 6 DFSORT Processing . . . . . . . . . . . 7

    Input Data SetsSORTIN and SORTINnn . . . . 11 Output Data SetsSORTOUT and OUTFIL . . . . 12 Data Set Considerations . . . . . . . . . . 12

    Sorting or Copying Records . . . . . . . . 12 Merging Records . . . . . . . . . . . 13 Data Set Notes and Limitations . . . . . . . 13

    HFS File Considerations . . . . . . . . . . 16 Installation Defaults . . . . . . . . . . . 16 Migrating to DFSORT from Other Sort Products . . 22 DFSORT Messages and Return Codes . . . . . 22 Use Blockset Whenever Possible . . . . . . . 23

    Chapter 2. Invoking DFSORT with Job Control Language . . . . . . . . . . 25 Using the JCL . . . . . . . . . . . . . 25

    Using the JOB Statement . . . . . . . . . . 27 Using the EXEC Statement . . . . . . . . . 27

    Specifying EXEC Statement Cataloged Procedures 27 Specifying EXEC/DFSPARM PARM Options . . 29 Aliases for PARM Options . . . . . . . . 61

    Using DD Statements . . . . . . . . . . . 62 Duplicate Ddnames . . . . . . . . . . . 64 Shared Tape Units . . . . . . . . . . . 65 System DD Statements . . . . . . . . . 65 Program DD Statements . . . . . . . . . 67

    Chapter 3. Using DFSORT Program Control Statements . . . . . . . . . 83 Using Program Control Statements . . . . . . 84 Control Statement Summary . . . . . . . . . 85

    Describing the Primary Task . . . . . . . . 85 Including or Omitting Records . . . . . . . 85 Reformatting and Editing Records . . . . . . 85 Producing Multiple Output and Reports and Converting Records . . . . . . . . . . . 85 Invoking Additional Functions and Options . . 86 Using Symbols . . . . . . . . . . . . 86

    General Coding Rules . . . . . . . . . . . 86 Continuation Lines . . . . . . . . . . . 88 Inserting Comment Statements . . . . . . . 90 Coding Restrictions . . . . . . . . . . . 90

    ALTSEQ Control Statement . . . . . . . . . 91 Altering EBCDIC Collating SequenceExamples 92

    DEBUG Control Statement . . . . . . . . . 93 Specifying Diagnostic OptionsExamples . . . 98

    END Control Statement . . . . . . . . . . 99 Discontinue Reading Control StatementsExamples . . . . . . . . . . 99

    INCLUDE Control Statement . . . . . . . . 99 Relational Condition . . . . . . . . . . 102 Comparisons . . . . . . . . . . . . 102 Including Records in the Output Data SetComparison Examples . . . . . . . 109 Substring Comparison Tests . . . . . . . 111 Including Records in the Output Data SetSubstring Comparison Example . . . . 112 Bit Logic Tests . . . . . . . . . . . . 113 Method 1: Bit Operator Tests . . . . . . . 113 Padding and Truncation . . . . . . . . . 115 Including Records in the Output Data SetBit Operator Test Examples . . . . . . . . . 115 Method 2: Bit Comparison Tests . . . . . . 116 Including Records in the Output Data SetBit Comparison Test Examples . . . . . . . . 117 Date Comparisons . . . . . . . . . . . 118 Including Records in the Output Data SetDate Comparisons . . . . . . . . . . . . 120 INCLUDE/OMIT Statement Notes . . . . . 121

    INREC Control Statement . . . . . . . . . 122 INREC Statement Notes . . . . . . . . . 139

    Copyright IBM Corp. 1973, 2005 iii

    ||||||||

  • Reformatting Records Before Processing Examples . . . . . . . . . . . . . . 141

    MERGE Control Statement . . . . . . . . . 146 Specifying a MERGE or COPYExamples . . 149

    MODS Control Statement . . . . . . . . . 150 Identifying User Exit RoutinesExamples . . . 152

    OMIT Control Statement . . . . . . . . . 153 Omitting Records from the Output Data SetExample . . . . . . . . . . . . 155

    OPTION Control Statement . . . . . . . . 157 Aliases for OPTION Statement Options . . . . 207 Specifying DFSORT Options or COPYExamples . . . . . . . . . . . 208

    OUTFIL Control Statements . . . . . . . . 212 OUTFIL Statements Notes . . . . . . . . 302 OUTFIL FeaturesExamples . . . . . . . 306

    OUTREC Control Statement . . . . . . . . 322 OUTREC Statement Notes . . . . . . . . 338 Reformatting the Output RecordExamples . . 339

    RECORD Control Statement . . . . . . . . 344 Describing the Record Format and LengthExamples . . . . . . . . . . 347

    SORT Control Statement . . . . . . . . . . 349 SORT/MERGE Statement Notes . . . . . . 357 Specifying a SORT or COPYExamples . . . 357

    SUM Control Statement . . . . . . . . . . 359 SUM Statement Notes . . . . . . . . . 361 Adding Summary FieldsExamples . . . . . 362

    Chapter 4. Using Your Own User Exit Routines . . . . . . . . . . . . . 365 User Exit Routine Overview . . . . . . . . 365 DFSORT Program Phases . . . . . . . . . 366 Functions of Routines at User Exits . . . . . . 368

    DFSORT Input/User Exit/Output Logic Examples . . . . . . . . . . . . . . 368 Opening and Initializing Data Sets . . . . . 369 Modifying Control Fields . . . . . . . . 369 Inserting, Deleting, and Altering Records . . . 370 Summing Records . . . . . . . . . . . 370 Handling Special I/O . . . . . . . . . 370 VSAM User Exit Functions . . . . . . . . 371 Determining Action when Intermediate Storage Is Insufficient . . . . . . . . . . . . 371 Closing Data Sets . . . . . . . . . . . 371 Terminating DFSORT . . . . . . . . . . 371

    Addressing and Residence Modes for User Exits 371 How User Exit Routines Affect DFSORT Performance . . . . . . . . . . . . . . 372 Summary of Rules for User Exit Routines . . . . 372

    Loading User Exit Routines . . . . . . . 373 User Exit Linkage Conventions . . . . . . 373 Dynamically Link-Editing User Exit Ro