0% found this document useful (0 votes)
185 views734 pages

DFSORT Application Programming Guide V1R5

ewerw rwrewe rwe

Uploaded by

Llamazares
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
185 views734 pages

DFSORT Application Programming Guide V1R5

ewerw rwrewe rwe

Uploaded by

Llamazares
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

z/OS 

DFSORT Application Programming Guide

SC26-7523-00
z/OS 

DFSORT Application Programming Guide

SC26-7523-00
Note
Before using this information and the product it supports, be sure to read the general information under Notices on page
679.

First Edition, March 2004


This edition applies to Version 1 Release 5 of z/OS (5694-A01), Version 1 Release 5 of z/OS.e (5655-G52) and to
all subsequent releases and modifications until otherwise indicated in new editions.
This edition replaces SC33-4035-21.
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 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, 2004. All rights reserved.
US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract
with IBM Corp.
Contents
Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi

Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

About this document . . . . . . . . . . . . . . . . . . . . . . xv


How to use this document . . . . . . . . . . . . . . . . . . . . . xv
Required product knowledge . . . . . . . . . . . . . . . . . . . . xvi
Referenced documents . . . . . . . . . . . . . . . . . . . . . . xvi
Accessing z/OS DFSORT documents on the Internet . . . . . . . . . . xvii
Using LookAt to look up message explanations. . . . . . . . . . . . . xvii
Accessing z/OS licensed documents on the Internet . . . . . . . . . . . xviii
Notational conventions . . . . . . . . . . . . . . . . . . . . . xviii

Summary of Changes . . . . . . . . . . . . . . . . . . . . . xxi


Summary of Changes for SC26-7523-00 z/OS Version 1 Release 5 . . . . . xxi
New Information . . . . . . . . . . . . . . . . . . . . . . . xxi
Summary of Changes for SC33-4035-21 DFSORT Release 14 (PTFs -
February, 2003) . . . . . . . . . . . . . . . . . . . . . . . xxii
New Information . . . . . . . . . . . . . . . . . . . . . . . xxii
Summary of Changes for SC33-4035-21 DFSORT Release 14 (PTFs - March,
2002) . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
New Information . . . . . . . . . . . . . . . . . . . . . . . xxiv

Chapter 1. Introducing DFSORT . . . . . . . . . . . . . . . . . . 1


DFSORT Overview . . . . . . . . . . . . . . . . . . . . . . . . 1
DFSORT on the Web . . . . . . . . . . . . . . . . . . . . . . . 3
DFSORT FTP Site . . . . . . . . . . . . . . . . . . . . . . . . 4
Invoking DFSORT . . . . . . . . . . . . . . . . . . . . . . . . 4
How DFSORT Works . . . . . . . . . . . . . . . . . . . . . . . 4
Operating Systems . . . . . . . . . . . . . . . . . . . . . . . 5
Control Fields and Collating Sequences . . . . . . . . . . . . . . . 5
Cultural Environment Considerations . . . . . . . . . . . . . . . . 6
DFSORT Processing . . . . . . . . . . . . . . . . . . . . . . 7
Input Data SetsSORTIN and SORTINnn . . . . . . . . . . . . . . . 10
Output Data SetsSORTOUT and OUTFIL . . . . . . . . . . . . . . 11
Data Set Considerations . . . . . . . . . . . . . . . . . . . . . 11
Sorting or Copying Records . . . . . . . . . . . . . . . . . . . 11
Merging Records . . . . . . . . . . . . . . . . . . . . . . . 12
Data Set Notes and Limitations . . . . . . . . . . . . . . . . . . 12
HFS File Considerations . . . . . . . . . . . . . . . . . . . . . 15
Installation Defaults . . . . . . . . . . . . . . . . . . . . . . . 15
Migrating to DFSORT from Other Sort Products . . . . . . . . . . . . . 21
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 . . . . . . . . . . 28
Specifying EXEC/DFSPARM PARM Options . . . . . . . . . . . . . 29
Aliases for PARM Options . . . . . . . . . . . . . . . . . . . . 59
Using DD Statements . . . . . . . . . . . . . . . . . . . . . . 60

Copyright IBM Corp. 1973, 2004 iii


Duplicate Ddnames . . . . . . . . . . . . . . . . . . . . . . 62
Shared Tape Units . . . . . . . . . . . . . . . . . . . . . . 62
System DD Statements . . . . . . . . . . . . . . . . . . . . . 63
Program DD Statements . . . . . . . . . . . . . . . . . . . . 65

Chapter 3. Using DFSORT Program Control Statements . . . . . . . . 79


Using Program Control Statements . . . . . . . . . . . . . . . . . 81
Control Statement Summary . . . . . . . . . . . . . . . . . . . . 82
Describing the Primary Task . . . . . . . . . . . . . . . . . . . 82
Including or Omitting Records . . . . . . . . . . . . . . . . . . 82
Reformatting and Editing Records . . . . . . . . . . . . . . . . . 83
Producing Multiple Output and Reports and Converting Records . . . . . 83
Invoking Additional Functions and Options . . . . . . . . . . . . . . 83
Using Symbols . . . . . . . . . . . . . . . . . . . . . . . . 83
General Coding Rules . . . . . . . . . . . . . . . . . . . . . . 84
Continuation Lines . . . . . . . . . . . . . . . . . . . . . . 85
Inserting Comment Statements . . . . . . . . . . . . . . . . . . 87
Coding Restrictions . . . . . . . . . . . . . . . . . . . . . . 87
ALTSEQ Control Statement . . . . . . . . . . . . . . . . . . . . 88
Altering EBCDIC Collating SequenceExamples . . . . . . . . . . . 89
DEBUG Control Statement . . . . . . . . . . . . . . . . . . . . 90
Specifying Diagnostic OptionsExamples . . . . . . . . . . . . . . 94
END Control Statement . . . . . . . . . . . . . . . . . . . . . . 95
Discontinue Reading Control StatementsExamples . . . . . . . . . . 95
INCLUDE Control Statement . . . . . . . . . . . . . . . . . . . . 96
Relational Condition . . . . . . . . . . . . . . . . . . . . . . 98
Comparisons . . . . . . . . . . . . . . . . . . . . . . . . 99
Including Records in the Output Data SetComparison Examples . . . . 105
Substring Comparison Tests . . . . . . . . . . . . . . . . . . 107
Including Records in the Output Data SetSubstring Comparison Example 108
Bit Logic Tests . . . . . . . . . . . . . . . . . . . . . . . 108
Method 1: Bit Operator Tests . . . . . . . . . . . . . . . . . . 109
Padding and Truncation . . . . . . . . . . . . . . . . . . . . 110
Including Records in the Output Data SetBit Operator Test Examples 110
Method 2: Bit Comparison Tests . . . . . . . . . . . . . . . . . 111
Including Records in the Output Data SetBit Comparison Test Examples 113
Date Comparisons . . . . . . . . . . . . . . . . . . . . . . 114
Including Records in the Output Data SetDate Comparisons . . . . . . 116
INCLUDE/OMIT Statement Notes . . . . . . . . . . . . . . . . 116
INREC Control Statement . . . . . . . . . . . . . . . . . . . . 117
INREC Statement Notes . . . . . . . . . . . . . . . . . . . . 127
Reformatting Records Before Processing Examples . . . . . . . . . 129
MERGE Control Statement . . . . . . . . . . . . . . . . . . . . 132
Specifying a MERGE or COPYExamples . . . . . . . . . . . . . 135
MODS Control Statement . . . . . . . . . . . . . . . . . . . . 135
Identifying User Exit RoutinesExamples . . . . . . . . . . . . . 138
OMIT Control Statement . . . . . . . . . . . . . . . . . . . . . 139
Omitting Records from the Output Data SetExample . . . . . . . . . 141
OPTION Control Statement . . . . . . . . . . . . . . . . . . . . 142
Aliases for OPTION Statement Options . . . . . . . . . . . . . . 189
Specifying DFSORT Options or COPYExamples . . . . . . . . . . 189
OUTFIL Control Statements . . . . . . . . . . . . . . . . . . . . 194
OUTFIL Statements Notes . . . . . . . . . . . . . . . . . . . 262
OUTFIL FeaturesExamples . . . . . . . . . . . . . . . . . . 265
OUTREC Control Statement . . . . . . . . . . . . . . . . . . . 281
OUTREC Statement Notes . . . . . . . . . . . . . . . . . . . 289

iv z/OS V1R5.0 DFSORT Application Programming Guide


Reformatting the Output RecordExamples . . . . . . . . . . . . 290
RECORD Control Statement . . . . . . . . . . . . . . . . . . . 293
Describing the Record Format and LengthExamples . . . . . . . . . 297
SORT Control Statement . . . . . . . . . . . . . . . . . . . . . 298
SORT/MERGE Statement Notes . . . . . . . . . . . . . . . . . 305
Specifying a SORT or COPYExamples . . . . . . . . . . . . . . 305
SUM Control Statement . . . . . . . . . . . . . . . . . . . . . 307
SUM Statement Notes . . . . . . . . . . . . . . . . . . . . . 309
Adding Summary FieldsExamples . . . . . . . . . . . . . . . . 311

Chapter 4. Using Your Own User Exit Routines . . . . . . . . . . . 313


User Exit Routine Overview . . . . . . . . . . . . . . . . . . . . 314
DFSORT Program Phases . . . . . . . . . . . . . . . . . . . . 315
Functions of Routines at User Exits . . . . . . . . . . . . . . . . . 317
DFSORT Input/User Exit/Output Logic Examples . . . . . . . . . . . 317
Opening and Initializing Data Sets . . . . . . . . . . . . . . . . 318
Modifying Control Fields . . . . . . . . . . . . . . . . . . . . 318
Inserting, Deleting, and Altering Records . . . . . . . . . . . . . . 319
Summing Records . . . . . . . . . . . . . . . . . . . . . . 319
Handling Special I/O . . . . . . . . . . . . . . . . . . . . . 319
VSAM User Exit Functions . . . . . . . . . . . . . . . . . . . 320
Determining Action when Intermediate Storage Is Insufficient . . . . . . 320
Closing Data Sets . . . . . . . . . . . . . . . . . . . . . . 320
Terminating DFSORT . . . . . . . . . . . . . . . . . . . . . 320
Addressing and Residence Modes for User Exits . . . . . . . . . . . . 320
How User Exit Routines Affect DFSORT Performance . . . . . . . . . . 321
Summary of Rules for User Exit Routines . . . . . . . . . . . . . . 321
Loading User Exit Routines . . . . . . . . . . . . . . . . . . . 321
User Exit Linkage Conventions . . . . . . . . . . . . . . . . . 322
Dynamically Link-Editing User Exit Routines . . . . . . . . . . . . . 323
Assembler User Exit Routines (Input Phase User Exits) . . . . . . . . . 324
E11 User Exit: Opening Data Sets/Initializing Routines . . . . . . . . . 324
E15 User Exit: Passing or Changing Records for Sort and Copy Applications 324
E16 User Exit: Handling Intermediate Storage Miscalculation . . . . . . 327
E17 User Exit: Closing Data Sets . . . . . . . . . . . . . . . . 328
E18 User Exit: Handling Input Data Sets . . . . . . . . . . . . . . 328
E19 User Exit: Handling Output to Work Data Sets . . . . . . . . . . 331
E61 User Exit: Modifying Control Fields . . . . . . . . . . . . . . 332
Assembler User Exit Routines (Output Phase User Exits) . . . . . . . . . 334
E31 User Exit: Opening Data Sets/Initializing Routines . . . . . . . . . 334
E32 User Exit: Handling Input to a Merge Only . . . . . . . . . . . 334
E35 User Exit: Changing Records . . . . . . . . . . . . . . . . 335
E37 User Exit: Closing Data Sets . . . . . . . . . . . . . . . . 339
E38 User Exit: Handling Input Data Sets . . . . . . . . . . . . . . 339
E39 User Exit: Handling Output Data Sets . . . . . . . . . . . . . 339
Sample Routines Written in Assembler . . . . . . . . . . . . . . . . 340
E15 User Exit: Altering Record Length . . . . . . . . . . . . . . . 340
E16 User Exit: Sorting Current Records When NMAX Is Exceeded . . . . 341
E35 User Exit: Altering Record Length . . . . . . . . . . . . . . . 342
E61 User Exit: Altering Control Fields . . . . . . . . . . . . . . . 342
COBOL User Exit Routines . . . . . . . . . . . . . . . . . . . . 343
COBOL User Exit Requirements . . . . . . . . . . . . . . . . . 343
COBOL User Exit Routines (Input Phase User Exit) . . . . . . . . . . . 345
COBOL E15 User Exit: Passing or Changing Records for Sort . . . . . . 345
COBOL User Exit Routines (Output Phase User Exit) . . . . . . . . . . 351
COBOL E35 User Exit: Changing Records . . . . . . . . . . . . . 351

Contents v
Sample Routines Written in COBOL. . . . . . . . . . . . . . . . . 357
COBOL E15 User Exit: Altering Records . . . . . . . . . . . . . . 357
COBOL E35 User Exit: Inserting Records . . . . . . . . . . . . . 358
E15/E35 Return Codes and EXITCK . . . . . . . . . . . . . . . . 360

Chapter 5. Invoking DFSORT from a Program . . . . . . . . . . . . 363


Invoking DFSORT Dynamically . . . . . . . . . . . . . . . . . . 363
What Are System Macro Instructions? . . . . . . . . . . . . . . . . 363
Using System Macro Instructions . . . . . . . . . . . . . . . . . . 363
Using JCL DD Statements . . . . . . . . . . . . . . . . . . . . 364
Overriding DFSORT Control Statements from Programs . . . . . . . . . 364
Invoking DFSORT With the 24-Bit Parameter List . . . . . . . . . . . . 365
Providing Program Control Statements. . . . . . . . . . . . . . . 365
Invoking DFSORT With The Extended Parameter List . . . . . . . . . . 371
Providing Program Control Statements. . . . . . . . . . . . . . . 371
Writing the Macro Instruction . . . . . . . . . . . . . . . . . . . 375
Parameter List Examples. . . . . . . . . . . . . . . . . . . . 375
Restrictions for Dynamic Invocation . . . . . . . . . . . . . . . . . 379
Merge Restriction . . . . . . . . . . . . . . . . . . . . . . 379
Copy Restrictions . . . . . . . . . . . . . . . . . . . . . . 379

Chapter 6. Using ICETOOL . . . . . . . . . . . . . . . . . . . 381


Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 383
ICETOOL/DFSORT Relationship . . . . . . . . . . . . . . . . . 383
ICETOOL JCL Summary . . . . . . . . . . . . . . . . . . . . 384
ICETOOL Operator Summary . . . . . . . . . . . . . . . . . . 384
Complete ICETOOL Examples . . . . . . . . . . . . . . . . . . 386
Using Symbols . . . . . . . . . . . . . . . . . . . . . . . 386
Invoking ICETOOL . . . . . . . . . . . . . . . . . . . . . . 386
Putting ICETOOL to Use . . . . . . . . . . . . . . . . . . . . 387
Job Control Language for ICETOOL . . . . . . . . . . . . . . . . 390
JCL Restrictions . . . . . . . . . . . . . . . . . . . . . . . 392
ICETOOL Statements . . . . . . . . . . . . . . . . . . . . . . 392
General Coding Rules . . . . . . . . . . . . . . . . . . . . . 392
COPY Operator . . . . . . . . . . . . . . . . . . . . . . . . 393
Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 394
COPY Examples . . . . . . . . . . . . . . . . . . . . . . . 395
COUNT Operator . . . . . . . . . . . . . . . . . . . . . . . 397
Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 398
COUNT Examples . . . . . . . . . . . . . . . . . . . . . . 399
DEFAULTS Operator . . . . . . . . . . . . . . . . . . . . . . 400
Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 401
DEFAULTS Example . . . . . . . . . . . . . . . . . . . . . 402
DISPLAY Operator . . . . . . . . . . . . . . . . . . . . . . . 404
Simple Report . . . . . . . . . . . . . . . . . . . . . . . . 405
Tailored Report . . . . . . . . . . . . . . . . . . . . . . . 406
Sectioned Report . . . . . . . . . . . . . . . . . . . . . . 407
Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 407
DISPLAY Examples . . . . . . . . . . . . . . . . . . . . . . 426
MODE Operator . . . . . . . . . . . . . . . . . . . . . . . . 441
Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 442
MODE Example . . . . . . . . . . . . . . . . . . . . . . . 442
OCCUR Operator . . . . . . . . . . . . . . . . . . . . . . . 443
Simple Report . . . . . . . . . . . . . . . . . . . . . . . . 444
Tailored Report . . . . . . . . . . . . . . . . . . . . . . . 445
Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 446

vi z/OS V1R5.0 DFSORT Application Programming Guide


OCCUR Examples . . . . . . . . . . . . . . . . . . . . . . 452
RANGE Operator . . . . . . . . . . . . . . . . . . . . . . . 455
Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 456
RANGE Example . . . . . . . . . . . . . . . . . . . . . . 457
SELECT Operator . . . . . . . . . . . . . . . . . . . . . . . 458
Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 460
SELECT Examples . . . . . . . . . . . . . . . . . . . . . . 462
SORT Operator . . . . . . . . . . . . . . . . . . . . . . . . 466
Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 466
SORT Examples . . . . . . . . . . . . . . . . . . . . . . . 468
| SPLICE Operator . . . . . . . . . . . . . . . . . . . . . . . 470
| Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 472
| SPLICE Examples . . . . . . . . . . . . . . . . . . . . . . 474
STATS Operator . . . . . . . . . . . . . . . . . . . . . . . . 492
Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 492
STATS Example . . . . . . . . . . . . . . . . . . . . . . . 494
UNIQUE Operator . . . . . . . . . . . . . . . . . . . . . . . 494
Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 494
UNIQUE Example . . . . . . . . . . . . . . . . . . . . . . 496
VERIFY Operator . . . . . . . . . . . . . . . . . . . . . . . 496
Operand Descriptions . . . . . . . . . . . . . . . . . . . . . 496
VERIFY Example . . . . . . . . . . . . . . . . . . . . . . 497
Calling ICETOOL from a Program . . . . . . . . . . . . . . . . . 498
TOOLIN Interface . . . . . . . . . . . . . . . . . . . . . . 498
Parameter List Interface . . . . . . . . . . . . . . . . . . . . 498
ICETOOL Notes and Restrictions . . . . . . . . . . . . . . . . . . 504
ICETOOL Return Codes . . . . . . . . . . . . . . . . . . . . . 505

Chapter 7. Using Symbols for Fields and Constants . . . . . . . . . 507


Field and Constant Symbols Overview . . . . . . . . . . . . . . . . 507
DFSORT Example . . . . . . . . . . . . . . . . . . . . . . 508
SYMNAMES DD Statement . . . . . . . . . . . . . . . . . . . . 510
SYMNOUT DD Statement . . . . . . . . . . . . . . . . . . . . 510
SYMNAMES Statements . . . . . . . . . . . . . . . . . . . . . 510
Comment and Blank Statements . . . . . . . . . . . . . . . . . 511
Symbol Statements . . . . . . . . . . . . . . . . . . . . . . 511
Keyword Statements . . . . . . . . . . . . . . . . . . . . . 517
Using SYMNOUT to Check Your SYMNAMES Statements . . . . . . . 520
Using Symbols in DFSORT Statements . . . . . . . . . . . . . . . 520
SORT and MERGE . . . . . . . . . . . . . . . . . . . . . . 521
SUM . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
INCLUDE and OMIT . . . . . . . . . . . . . . . . . . . . . 522
INREC and OUTREC . . . . . . . . . . . . . . . . . . . . . 522
OUTFIL . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Using Symbols in ICETOOL Operators. . . . . . . . . . . . . . . . 525
COUNT . . . . . . . . . . . . . . . . . . . . . . . . . . 526
DISPLAY . . . . . . . . . . . . . . . . . . . . . . . . . 526
OCCUR . . . . . . . . . . . . . . . . . . . . . . . . . . 526
RANGE . . . . . . . . . . . . . . . . . . . . . . . . . . 526
SELECT . . . . . . . . . . . . . . . . . . . . . . . . . . 526
| SPLICE . . . . . . . . . . . . . . . . . . . . . . . . . . 526
STATS, UNIQUE and VERIFY . . . . . . . . . . . . . . . . . . 526
ICETOOL Example . . . . . . . . . . . . . . . . . . . . . . 527
Notes for Symbols . . . . . . . . . . . . . . . . . . . . . . . 528

Chapter 8. Using Extended Function Support . . . . . . . . . . . . 531

Contents vii
Using EFS . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Addressing and Residence Mode of the EFS Program . . . . . . . . . . 532
How EFS Works . . . . . . . . . . . . . . . . . . . . . . . . 533
DFSORT Program Phases . . . . . . . . . . . . . . . . . . . 533
DFSORT Calls to Your EFS Program . . . . . . . . . . . . . . . 534
What You Can Do with EFS. . . . . . . . . . . . . . . . . . . . 538
Opening and Initializing Data Sets . . . . . . . . . . . . . . . . 539
Examining, Altering, or Ignoring Control Statements . . . . . . . . . . 539
Processing User-Defined Data Types with EFS Program User Exit Routines 541
Supplying Messages for Printing to the Message Data Set . . . . . . . 541
Terminating DFSORT . . . . . . . . . . . . . . . . . . . . . 541
Closing Data Sets and Housekeeping . . . . . . . . . . . . . . . 541
Structure of the EFS Interface Parameter List . . . . . . . . . . . . . 541
Action Codes . . . . . . . . . . . . . . . . . . . . . . . . 543
Control Statement Request List . . . . . . . . . . . . . . . . . 544
Control Statement String Sent to the EFS program . . . . . . . . . . 544
Control Statement String Returned by the EFS Program . . . . . . . . 546
EFS Formats for SORT, MERGE, INCLUDE, and OMIT Control Statements 547
D1 Format on FIELDS Operand . . . . . . . . . . . . . . . . . 547
D2 Format on COND Operand . . . . . . . . . . . . . . . . . 548
Length of Original Control Statement . . . . . . . . . . . . . . . 549
Length of the Altered Control Statement . . . . . . . . . . . . . . 550
EFS Program Context Area . . . . . . . . . . . . . . . . . . . 550
Extract Buffer Offsets List . . . . . . . . . . . . . . . . . . . 550
Record Lengths List . . . . . . . . . . . . . . . . . . . . . 550
Information Flags . . . . . . . . . . . . . . . . . . . . . . 550
Message List . . . . . . . . . . . . . . . . . . . . . . . . 552
EFS Program Exit Routines . . . . . . . . . . . . . . . . . . . . 552
EFS01 and EFS02 Function Description . . . . . . . . . . . . . . 553
EFS01 User Exit Routine. . . . . . . . . . . . . . . . . . . . 553
EFS02 User Exit Routine. . . . . . . . . . . . . . . . . . . . 554
Addressing and Residence Mode of EFS Program User Exit Routines 556
EFS Program Return Codes You Must Supply . . . . . . . . . . . . . 557
Record Processing Order . . . . . . . . . . . . . . . . . . . . 557
How to Request a SNAP Dump . . . . . . . . . . . . . . . . . . 559
EFS Program Example . . . . . . . . . . . . . . . . . . . . . 560
DFSORT Initialization Phase: . . . . . . . . . . . . . . . . . . 560
DFSORT Termination Phase . . . . . . . . . . . . . . . . . . 562

Chapter 9. Improving Efficiency . . . . . . . . . . . . . . . . . 563


Improving Performance . . . . . . . . . . . . . . . . . . . . . 564
Design Your Applications to Maximize Performance . . . . . . . . . . . 564
Directly Invoke DFSORT Processing . . . . . . . . . . . . . . . 564
Plan Ahead When Designing New Applications. . . . . . . . . . . . 565
Specify Efficient Sort/Merge Techniques . . . . . . . . . . . . . . 565
Specify Input/Output Data Set Characteristics Accurately . . . . . . . . 566
Use Sequential Striping . . . . . . . . . . . . . . . . . . . . 567
Use Compression . . . . . . . . . . . . . . . . . . . . . . 567
Use DFSMSrmm-Managed Tapes, or ICETPEX . . . . . . . . . . . 567
Specify Devices that Improve Elapsed Time . . . . . . . . . . . . . 567
Use Options that Enhance Performance . . . . . . . . . . . . . . 567
Use DFSORTs Fast, Efficient Productivity Features . . . . . . . . . . 570
Avoid Options that Degrade Performance. . . . . . . . . . . . . . 571
Use Main Storage Efficiently . . . . . . . . . . . . . . . . . . 571
Allocate Temporary Work Space Efficiently . . . . . . . . . . . . . 575
Use Hipersorting . . . . . . . . . . . . . . . . . . . . . . . 576

viii z/OS V1R5.0 DFSORT Application Programming Guide


Sort with Data Space . . . . . . . . . . . . . . . . . . . . . 577
| Use Memory Object Sorting . . . . . . . . . . . . . . . . . . . 578
Use ICEGENER Instead of IEBGENER . . . . . . . . . . . . . . 579
ICEGENER Return Codes . . . . . . . . . . . . . . . . . . . 581
Use DFSORTs Performance Booster for The SAS System . . . . . . . . 582
Use DFSORTs BLDINDEX Support. . . . . . . . . . . . . . . . . 582

Chapter 10. Examples of DFSORT Job Streams . . . . . . . . . . . 583


Summary of Examples . . . . . . . . . . . . . . . . . . . . . 583
Storage Administrator Examples . . . . . . . . . . . . . . . . . . 584
REXX Examples . . . . . . . . . . . . . . . . . . . . . . . . 584
CLIST Examples . . . . . . . . . . . . . . . . . . . . . . . . 585
Sort Examples . . . . . . . . . . . . . . . . . . . . . . . . 586
Example 1. Sort with ALTSEQ . . . . . . . . . . . . . . . . . . 586
Example 2. Sort with OMIT, SUM, OUTREC, DYNALLOC and ZDPRINT 587
Example 3. Sort with ISCII/ASCII Tapes . . . . . . . . . . . . . . 588
Example 4. Sort with E15, E35, FILSZ, AVGRLEN and DYNALLOC . . . . 589
Example 5. Called sort with SORTCNTL, CHALT, DYNALLOC and FILSZ 590
Example 6. Sort with VSAM Input/Output, DFSPARM and Option Override 592
Example 7. Sort with COBOL E15, EXEC PARM and MSGDDN . . . . . 593
Example 8. Sort with Dynamic Link-Editing of Exits . . . . . . . . . . 595
Example 9. Sort with the Extended Parameter List Interface . . . . . . . 597
Example 10. Sort with OUTFIL . . . . . . . . . . . . . . . . . 600
Example 11. Sort with Pipes and OUTFIL SPLIT . . . . . . . . . . . 602
Example 12. Sort with INCLUDE and LOCALE. . . . . . . . . . . . 603
Example 13: Sort with HFS Files . . . . . . . . . . . . . . . . . 604
Merge Examples . . . . . . . . . . . . . . . . . . . . . . . . 605
Example 1. Merge with EQUALS . . . . . . . . . . . . . . . . . 605
Example 2. Merge with LOCALE and OUTFIL . . . . . . . . . . . . 606
Copy Examples . . . . . . . . . . . . . . . . . . . . . . . . 607
Example 1. Copy with EXEC PARMs, SKIPREC, MSGPRT and ABEND 608
Example 2. Copy with INCLUDE and VLSHRT . . . . . . . . . . . . 609
ICEGENER Example . . . . . . . . . . . . . . . . . . . . . . 610
ICETOOL Example . . . . . . . . . . . . . . . . . . . . . . . 611

Appendix A. Using Work Space . . . . . . . . . . . . . . . . . 615


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 615
Hiperspace . . . . . . . . . . . . . . . . . . . . . . . . . . 615
Work Data Set Devices . . . . . . . . . . . . . . . . . . . . . 616
Disk and Tape Devices . . . . . . . . . . . . . . . . . . . . 616
Number of Devices . . . . . . . . . . . . . . . . . . . . . . 616
Non-Synchronous Storage Subsystems . . . . . . . . . . . . . . 617
Allocation of Work Data Sets . . . . . . . . . . . . . . . . . . . 617
Dynamic Allocation of Work Data Sets . . . . . . . . . . . . . . . 618
Dynamic Over-Allocation of Work Space . . . . . . . . . . . . . . 620
JCL Allocation of Work Data Sets . . . . . . . . . . . . . . . . 620
Disk Capacity Considerations . . . . . . . . . . . . . . . . . . . 621
Exceeding Disk Work Space Capacity . . . . . . . . . . . . . . . 622
Tape Capacity Considerations . . . . . . . . . . . . . . . . . . . 622
Exceeding Tape Work Space Capacity . . . . . . . . . . . . . . . 623

Appendix B. Specification/Override of DFSORT Options . . . . . . . . 625


Main Features of Sources of DFSORT Options . . . . . . . . . . . . 626
DFSPARM Data Set . . . . . . . . . . . . . . . . . . . . . 626
EXEC Statement PARM Options . . . . . . . . . . . . . . . . . 626
SORTCNTL Data Set . . . . . . . . . . . . . . . . . . . . . 626

Contents ix
SYSIN Data Set . . . . . . . . . . . . . . . . . . . . . . . 626
Parameter Lists . . . . . . . . . . . . . . . . . . . . . . . 626
Override Tables . . . . . . . . . . . . . . . . . . . . . . . 627
Directly Invoked DFSORT . . . . . . . . . . . . . . . . . . . . 627
Notes to Directly Invoked DFSORT Table . . . . . . . . . . . . . . 636
Program Invoked DFSORT with the Extended Parameter List . . . . . . . 636
Notes to Extended Parameter List Table . . . . . . . . . . . . . . 645
Program Invoked DFSORT with the 24-Bit Parameter List . . . . . . . . 645
Notes to 24-Bit List Table . . . . . . . . . . . . . . . . . . . 655

| Appendix C. Data Format Descriptions . . . . . . . . . . . . . . . 657


| DFSORT Data Formats . . . . . . . . . . . . . . . . . . . . . 657
Where DFSORT Formats Can be Used . . . . . . . . . . . . . . . 663
| DFSORT Formats for COBOL Data Types . . . . . . . . . . . . . . 664

Appendix D. EBCDIC and ISCII/ASCII Collating Sequences . . . . . . . 667


EBCDIC . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
ISCII/ASCII . . . . . . . . . . . . . . . . . . . . . . . . . . 669

Appendix E. DFSORT Abend Processing . . . . . . . . . . . . . . 673


Checkpoint/Restart . . . . . . . . . . . . . . . . . . . . . . . 673
DFSORT Abend Categories . . . . . . . . . . . . . . . . . . . . 674
Abend Recovery Processing for Unexpected Abends . . . . . . . . . . 674
Processing of Error Abends with A-Type Messages . . . . . . . . . . . 675
CTRx Abend processing . . . . . . . . . . . . . . . . . . . . . 675

Appendix F. Accessibility . . . . . . . . . . . . . . . . . . . . 677


Using assistive technologies . . . . . . . . . . . . . . . . . . . 677
Keyboard navigation of the user interface. . . . . . . . . . . . . . . 677

Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
Programming Interface Information . . . . . . . . . . . . . . . . . 680
Trademarks. . . . . . . . . . . . . . . . . . . . . . . . . . 680

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681

x z/OS V1R5.0 DFSORT Application Programming Guide


Figures
1. Control Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
| 2. Record Processing Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3. Syntax Diagram for EXEC PARM . . . . . . . . . . . . . . . . . . . . . . . . . 31
4. Aliases for MSGPRT/MSGCON Options . . . . . . . . . . . . . . . . . . . . . . 45
5. Control Statement Format . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
6. Continuation Line Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7. Valid and Invalid Decimal Constants . . . . . . . . . . . . . . . . . . . . . . . 102
8. Valid and Invalid Character String Constants . . . . . . . . . . . . . . . . . . . . 103
9. Valid and Invalid Strings with Double-Byte Data . . . . . . . . . . . . . . . . . . . 103
10. Valid and Invalid Hexadecimal Constants . . . . . . . . . . . . . . . . . . . . . 104
11. Sample Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
12. Syntax Diagram for the Option Control Statement . . . . . . . . . . . . . . . . . . 142
13. SDB=LARGE Block Sizes for Tape Output Data Sets . . . . . . . . . . . . . . . . . 173
| 14. OUTFIL Processing Order . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
15. Examples of Notation for Binary Fields . . . . . . . . . . . . . . . . . . . . . . 300
16. Examples of DFSORT Input/User Exit/Output Logic . . . . . . . . . . . . . . . . . 316
17. E18 User Exit Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
18. E38 User Exit Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
19. E39 User Exit Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
20. E15 User Exit Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
21. E16 User Exit Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
22. E35 User Exit Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
23. E61 User Exit Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
24. E15 DFSORT Interface with COBOL . . . . . . . . . . . . . . . . . . . . . . . 347
25. LINKAGE SECTION Code Example for E15 (Fixed-Length Records) . . . . . . . . . . . 348
26. LINKAGE SECTION Code Example for E15 (Variable-Length Record) . . . . . . . . . . . 348
27. E35 Interface with COBOL . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
28. LINKAGE SECTION Code Example for E35 (Fixed-Length Records) . . . . . . . . . . . 354
29. LINKAGE SECTION Code Example for E35 (Variable-Length Records) . . . . . . . . . . 354
30. COBOL E15 Routine Example (FLR) . . . . . . . . . . . . . . . . . . . . . . . 358
31. COBOL E35 Routine Example (VLR) . . . . . . . . . . . . . . . . . . . . . . . 359
32. The 24-Bit Parameter List . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
33. The Extended Parameter List . . . . . . . . . . . . . . . . . . . . . . . . . . 373
34. Specifying the Main Storage Option (24-Bit Parameter List) . . . . . . . . . . . . . . . 376
35. Specifying E32 and ESTAE Routine (24-Bit Parameter List) . . . . . . . . . . . . . . 376
36. The 24-Bit Parameter List in Main Storage . . . . . . . . . . . . . . . . . . . . . 377
37. Coding a 24-Bit Parameter List . . . . . . . . . . . . . . . . . . . . . . . . . 378
38. Coding an Extended Parameter List . . . . . . . . . . . . . . . . . . . . . . . 379
39. Parameter List for Parameter List Interface . . . . . . . . . . . . . . . . . . . . . 499
40. ICETOOL Parameter List Interface Example . . . . . . . . . . . . . . . . . . . . 502
41. Relationship Between DFSORT and an EFS Program . . . . . . . . . . . . . . . . . 533
42. EFS Program Calls for a Sort . . . . . . . . . . . . . . . . . . . . . . . . . . 534
43. EFS Program Calls for a Merge or Copy . . . . . . . . . . . . . . . . . . . . . 535
44. Control Statement Processing Sequence . . . . . . . . . . . . . . . . . . . . . 540
45. EFS Interface Parameter List . . . . . . . . . . . . . . . . . . . . . . . . . . 542
46. Information Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
47. DFSORT Register Convention . . . . . . . . . . . . . . . . . . . . . . . . . 553
48. Calling Sequence to EFS02 by DFSORT . . . . . . . . . . . . . . . . . . . . . 555
49. EFS Record Processing Sequence for a Sort or Merge . . . . . . . . . . . . . . . . 558
50. EFS Record Processing Sequence for a Copy . . . . . . . . . . . . . . . . . . . 559
51. Faster Sorting with COBOL . . . . . . . . . . . . . . . . . . . . . . . . . . 569

Copyright IBM Corp. 1973, 2004 xi


xii z/OS V1R5.0 DFSORT Application Programming Guide
Tables
1. Related documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
2. Referenced documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
3. Using ICETOOL to List Installation Defaults . . . . . . . . . . . . . . . . . . . . . 16
4. Options That Can Ease Migration . . . . . . . . . . . . . . . . . . . . . . . . . 21
5. FILSZ Variations Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6. Aliases for PARM Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7. DD Statement Parameters Used by DFSORT . . . . . . . . . . . . . . . . . . . . 60
8. DCB Subparameters Used by DFSORT . . . . . . . . . . . . . . . . . . . . . . 61
9. Compare Field Formats and Lengths . . . . . . . . . . . . . . . . . . . . . . . 99
10. Permissible Field-to-Field Comparisons for INCLUDE/OMIT . . . . . . . . . . . . . . 101
11. Permissible Field-to-Constant Comparisons for INCLUDE/OMIT. . . . . . . . . . . . . . 101
12. Current Date Operand Decimal Numbers . . . . . . . . . . . . . . . . . . . . . 102
13. Current Date Operand Character Strings . . . . . . . . . . . . . . . . . . . . . 104
14. Bit Comparison Example 2: Results for Selected Field Values . . . . . . . . . . . . . . 111
15. Bit Comparison Example 3: Results for Selected Field Values . . . . . . . . . . . . . . 111
16. Bit Comparison Example 2: Results for Selected Field Values . . . . . . . . . . . . . . 113
17. Bit Comparison Example 3: Results for Selected Field Values . . . . . . . . . . . . . . 113
18. Permissible Comparisons for Dates . . . . . . . . . . . . . . . . . . . . . . . 115
19. Logic Table for INCLUDE/OMIT. . . . . . . . . . . . . . . . . . . . . . . . . . 117
20. Examples of Valid and Invalid Column Alignment. . . . . . . . . . . . . . . . . . . 119
21. Examples of Valid and Invalid Blank Separation . . . . . . . . . . . . . . . . . . . 120
22. Examples of Valid and Invalid Binary Zero Separation . . . . . . . . . . . . . . . . . 120
23. Examples of Valid and Invalid Character String Separation . . . . . . . . . . . . . . . 121
24. Examples of Valid and Invalid Hexadecimal String Separation . . . . . . . . . . . . . . 121
25. Current date constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
26. Current time constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
27. Example of DYNSPC Primary Space . . . . . . . . . . . . . . . . . . . . . . . 152
28. FILSZ Variations Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
29. SIZE Variations Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
30. Aliases for OPTION Statement Options . . . . . . . . . . . . . . . . . . . . . . 189
31. Current date constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
32. Current time constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
33. p,m,Y2x Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
34. p,m,Y2x(c) Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
35. p,m,Y2xP Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
36. Edit Field Formats and Lengths . . . . . . . . . . . . . . . . . . . . . . . . . 214
37. Edit Mask Patterns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
38. Edit Mask Signs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
39. Digits Needed for Numeric Fields . . . . . . . . . . . . . . . . . . . . . . . . 218
40. Edit Mask Output Field Lengths . . . . . . . . . . . . . . . . . . . . . . . . . 218
41. To Output Field Lengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
42. Digits Needed for TOTAL Fields . . . . . . . . . . . . . . . . . . . . . . . . . 244
43. Current date constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
44. Current time constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
45. Control Field Formats and Lengths . . . . . . . . . . . . . . . . . . . . . . . . 301
46. Summary Field Formats and Lengths . . . . . . . . . . . . . . . . . . . . . . . 308
47. Functions of Routines at Program User Exits (Sort). . . . . . . . . . . . . . . . . . 317
48. Functions of Routines at Program User Exits (Copy and Merge) . . . . . . . . . . . . . 318
49. E15 User Exit Parameter List . . . . . . . . . . . . . . . . . . . . . . . . . . 326
50. E32 User Exit Parameter List . . . . . . . . . . . . . . . . . . . . . . . . . . 335
51. E35 User Exit Parameter List . . . . . . . . . . . . . . . . . . . . . . . . . . 337
52. E15 Without a SORTIN Data Set . . . . . . . . . . . . . . . . . . . . . . . . 360
53. E15 With a SORTIN Data Set Before End of Input . . . . . . . . . . . . . . . . . . 360
Copyright IBM Corp. 1973, 2004 xiii
54. E15 With a SORTIN Data Set After End of Input . . . . . . . . . . . . . . . . . . . 361
55. E35 With a SORTOUT or OUTFIL Data Set Before End of Input . . . . . . . . . . . . . 361
56. E35 Without a SORTOUT or OUTFIL Data Set Before End of Input . . . . . . . . . . . . 361
57. E35 With a SORTOUT or OUTFIL Data Set After End of Input . . . . . . . . . . . . . 361
58. E35 without a SORTOUT or OUTFIL Data Set After End of Input . . . . . . . . . . . . 362
59. Aliases for Message Option . . . . . . . . . . . . . . . . . . . . . . . . . . 370
60. Simple ICETOOL Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
61. Obtaining Various Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . 387
62. Creating Multiple Versions/Combinations of Data Sets . . . . . . . . . . . . . . . . . 388
63. JCL Statements for ICETOOL . . . . . . . . . . . . . . . . . . . . . . . . . 390
64. Attributes of Edit Masks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
65. Edit Mask Patterns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
66. Return Area Lengths/Operation-Specific Values . . . . . . . . . . . . . . . . . . . 501
67. JCL for Parameter List Interface Program Example . . . . . . . . . . . . . . . . . . 504
68. Functions of an Extended Function Support (EFS) Program . . . . . . . . . . . . . . 538
69. D1 Format Returned by an EFS Program . . . . . . . . . . . . . . . . . . . . . 548
70. Correlator Identifier and D2 Format Returned by an EFS Program . . . . . . . . . . . . 549
71. Original and Altered Control Statements . . . . . . . . . . . . . . . . . . . . . . 561
72. Number of Tracks per Cylinder for Disk Devices . . . . . . . . . . . . . . . . . . . 566
73. Minimum Storage Required for Various File Sizes . . . . . . . . . . . . . . . . . . 617
74. Work Space Requirements for Various Input Characteristics . . . . . . . . . . . . . . 621
75. Number of Tracks per Cylinder for Disk Devices . . . . . . . . . . . . . . . . . . . 622
76. Work Space Requirements of the Various Tape Techniques . . . . . . . . . . . . . . . 622
77. Directly Invoked DFSORT Option Specification/Override . . . . . . . . . . . . . . . . 628
78. Extended Parameter List DFSORT Option Specification/Override . . . . . . . . . . . . 637
79. 24-Bit List DFSORT Option Specification/Override . . . . . . . . . . . . . . . . . . 646
80. Allowed with Frequently Used Data Types . . . . . . . . . . . . . . . . . . . . . 663
81. Allowed with Other Data Types . . . . . . . . . . . . . . . . . . . . . . . . . 663
| 82. Equivalent DFSORT formats for various COBOL data types . . . . . . . . . . . . . . 664
83. EBCDIC Collating Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . 667
84. ISCII/ASCII Collating Sequence . . . . . . . . . . . . . . . . . . . . . . . . . 669

xiv z/OS V1R5.0 DFSORT Application Programming Guide


About this document
This document is intended to help you to sort, merge, and copy data sets using
DFSORT. This document is not designed to teach you how to use DFSORT, but is
for programmers who already have a basic understanding of DFSORT, and need a
task-oriented guide and reference to its functions and options. If you are a new
user, then you should read z/OS DFSORT: Getting Started first. z/OS DFSORT:
Getting Started is a self-study guide that tells you what you need to know to begin
using DFSORT quickly, with step-by-step examples and illustrations.

How to use this document


The various sections of this document present related information grouped
according to tasks you want to do. The first three chapters of the document explain
what you need to know to invoke and use DFSORTs primary record-processing
functions. The remaining chapters explain more specialized features. The
appendixes provide specific information about various topics.
v Chapter 1, Introducing DFSORT, on page 1, presents an overview of DFSORT,
explaining what you can do with DFSORT and how you invoke DFSORT
processing. It describes how DFSORT works, discusses data set formats and
limitations, and explains the defaults that might have been modified during
installation at your site.
v Chapter 2, Invoking DFSORT with Job Control Language, on page 25, explains
how to use job control language (JCL) to run your DFSORT jobs. It explains how
to code JOB, EXEC, and DD statements, and how you can use cataloged
procedures and EXEC PARM options to simplify your JCL and override DFSORT
defaults set during installation.
v Chapter 3, Using DFSORT Program Control Statements, on page 79, presents
the DFSORT control statements you use to sort, merge, and copy data. It
explains how to filter your data so you work only with the records you need, how
to edit data by reformatting and summing records, and how to produce multiple
output data sets and reports. It explains how to write statements that direct
DFSORT to use your own routines during processing.
v Chapter 4, Using Your Own User Exit Routines, on page 313, describes how to
use DFSORTs program exits to call your own routines during program
processing. You can write routines to delete, insert, alter, and summarize records,
and you can incorporate your own error-recovery routines.
v Chapter 5, Invoking DFSORT from a Program, on page 363, describes how you
use a system macro instruction to initiate DFSORT processing from your own
assembler program. It also lists specific restrictions on invoking DFSORT from
PL/I and COBOL.
v Chapter 6, Using ICETOOL, on page 381, describes how to use the
multi-purpose DFSORT utility ICETOOL. It explains the JCL and operators you
can use to perform a variety of tasks with ICETOOL.
v Chapter 7, Using Symbols for Fields and Constants, on page 507, explains how
to define symbols and use them in DFSORT control statements and ICETOOL
operators.
v Chapter 8, Using Extended Function Support, on page 531, explains how to use
the Extended Function Support (EFS) interface to tailor control statements, to
handle user-defined data types and collating sequences, and to have DFSORT
issue customized informational messages during processing.

Copyright IBM Corp. 1973, 2004 xv


v Chapter 9, Improving Efficiency, on page 563, 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 583, contains
annotated example job streams for sorting, merging, and copying records.
v Appendix A, Using Work Space, on page 615, 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 625, 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 657, gives examples of the
assembled data formats.
v Appendix D, EBCDIC and ISCII/ASCII Collating Sequences, on page 667, lists
the collating sequences from low to high order for EBCDIC and ISCII/ASCII
characters.
v Appendix E, DFSORT Abend Processing, on page 673, describes the ESTAE
recovery routine for processing abends, and the Checkpoint/Restart facility.
v Notices on page 679, includes the notices, Programming Interface information,
and the trademark list.

Required product knowledge


To use this document effectively, you should be familiar with the following
information:
v Job control language (JCL)
v Data management
v Tape and disk hardware

You should also be familiar with the information presented in the following related
documents:
Table 1. Related documents
Document Title Document Order Number
z/OS DFSORT Messages, Codes and SC26-7525
Diagnosis Guide
z/OS MVS JCL Reference SA22-7597
z/OS MVS JCL Users Guide SA22-7598
z/OS DFSMS: Using Data Sets SC26-7410
z/OS DFSMS: Using Magnetic Tapes SC26-7412

Referenced documents
This document refers to the following documents:
Table 2. Referenced documents
Document title Order number
z/OS DFSMS Checkpoint/Restart SC26-7401

xvi z/OS V1R5.0 DFSORT Application Programming Guide


Table 2. Referenced documents (continued)
Document title Order number
z/OS DFSMS Macro Instructions for Data SC26-7408
Sets
z/OS DFSMS: Using Data Sets SC26-7410
z/OS MVS JCL Reference SA22-7597
z/OS MVS JCL Users Guide SA22-7598
z/OS MVS Programming: Assembler SA22-7607
Services Reference IAR-XCT
z/OS DCE Application Development SC24-5908
Reference
z/OS Program Directory GI10-0670
z/OS UNIX System Services Users Guide SA22-7801

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 Publication Title Order Number


Planning For and z/OS DFSORT Installation SC26-7524
Customizing DFSORT and Customization
Learning to Use DFSORT DFSORT Panels Guide GC26-7037
Panels
Learning to Use DFSORT z/OS DFSORT: Getting SC26-7527
Started
Diagnosing Failures and z/OS DFSORT Messages, SC26-7525
Interpreting Messages Codes and Diagnosis Guide
Tuning DFSORT z/OS DFSORT Tuning Guide SC26-7526

Accessing z/OS DFSORT documents on the Internet


In addition to making softcopy documents available on CD-ROM, IBM provides
access to unlicensed z/OS softcopy documents on the Internet. To find z/OS
documents on the Internet, first go to the z/OS home page:
http://www.ibm.com/servers/eserver/zseries/zos

From this Web site, you can link directly to the z/OS softcopy documents by
selecting the Library icon. You can also link to the IBM Publications Center to order
printed documentation.

Using LookAt to look up message explanations


LookAt is an online facility that lets you look up explanations for most of the IBM
messages you encounter, as well as for some system abends and codes. Using
LookAt to find information is faster than a conventional search because in most
cases LookAt goes directly to the message explanation.

You can use LookAt from the following locations to find IBM message explanations
for z/OS elements and features, z/VM, and VSE:

About this document xvii


v The Internet. You can access IBM message explanations directly from the LookAt
Web site at http://www.ibm.com/eserver/zseries/zos/bkserv/lookat/.
v Your z/OS TSO/E host system. You can install code on your z/OS or z/OS.e
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 running OMVS).
v Your Windows workstation. You can install code to access IBM message
explanations on the z/OS Collection (SK3T-4269), using LookAt from a Windows
DOS command line.
v Your wireless handheld device. You can use the LookAt Mobile Edition with a
handheld device that has wireless access and an Internet browser (for example,
Internet Explorer for Pocket PCs, Blazer, or Eudora for Palm OS, or Opera for
Linux handheld devices). Link to the LookAt Mobile Edition from the LookAt Web
site.

You can obtain code to install LookAt on your host system or Windows workstation
from a disk on your z/OS Collection (SK3T-4269), or from the LookAt Web site
(click Download, and 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.

Accessing z/OS licensed documents on the Internet


z/OS licensed documentation is available on the Internet in PDF format at the IBM
Resource Link Web site at: http://www.ibm.com/servers/resourcelink

Licensed documents are available only to customers with a z/OS license. Access to
these documents requires an IBM Resource Link user ID and password, and a key
code. With your z/OS order you received a Memo to Licensees, (GI10-0671), that
includes this key code.

To obtain your IBM Resource Link user ID and password, log on to:
http://www.ibm.com/servers/resourcelink

To register for access to the z/OS licensed documents:


1. Sign in to Resource Link using your Resource Link user ID and password.
2. Select User Profiles located on the left-hand navigation bar.

Note: You cannot access the z/OS licensed documents unless you have registered
for access to them and received an e-mail confirmation informing you that
your request has been processed.

Printed licensed documents are not available from IBM.

You can use the PDF format on either z/OS Licensed Product Library CD-ROM or
IBM Resource Link to print licensed documents.

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
xviii z/OS V1R5.0 DFSORT Application Programming Guide
Notational Conventions

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.

A continuation line begins with a single arrowhead.

v Strings in upper-case letters, and punctuation (parentheses, apostrophes, and so


on), must be coded exactly as shown.
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 Required Choice 1 


Required Choice 2 Optional Choice 1
Required Choice 3 Optional Choice 2

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 Choice-1
Choice-2
Choice-3

About this document xix


Notational Conventions

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.

xx z/OS V1R5.0 DFSORT Application Programming Guide


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-7523-00 z/OS Version 1 Release 5


This document contains information that was previously presented in DFSORT
Application Programming Guide R14, SC33-4035-21.

The following sections summarize the changes to that information.

New Information
This edition includes the following new enhancements:

Improvements in Performance
Memory object sorting is a new DFSORT capability that uses a memory object on
64-bit real architecture to improve the performance of sort applications. A memory
object is a data area in virtual storage that is allocated above the bar and backed
by central storage. With memory object sorting, a memory object can be used
exclusively, or along with disk space, for temporary storage of records. Memory
object sorting can reduce I/O processing, elapsed time, EXCPs, and channel usage.
When a memory object is used, Hiperspace and data space are not needed.

Installation and Run-Time Options


A new MOSIZE installation (ICEMAC) and run-time option allows you to specify the
maximum size of a memory object to be used for memory object sorting. The
existing EXPMAX, EXPOLD and EXPRES installation (ICEMAC) options now apply
to memory object sorting as well as Hipersorting.

A new NULLOUT installation (ICEMAC) and run-time option allows you to specify
what you want DFSORT to do when there are no records for the SORTOUT data
set. This gives you control over the action (continue or terminate), type of message
(informational or error) and return code (0, 4 or 16) for a SORTOUT data set with
no records.

A new NULLOFL installation (ICEMAC) option and OUTFIL run-time option allows
you to specify what you want DFSORT to do when there are no data records for an
OUTFIL data set. This gives you control over the action (continue or terminate),
type of message (informational or error) and return code (0, 4 or 16) for an OUTFIL
data set with no data records.

The IBM-supplied default for ICEMAC option COBEXIT has been changed from
COB1 to COB2.

The IBM-supplied default for ICEMAC option DSA has been changed from 32MB to
64MB.

Copyright IBM Corp. 1973, 2004 xxi


The IBM-supplied default for ICEMAC option TMAXLIM has been changed from
4MB to 6MB.

The IBM-supplied default for ICEMAC option ZDPRINT has been changed from NO
to YES.

Summary of Changes for SC33-4035-21 DFSORT Release 14 (PTFs -


February, 2003)
This document contains information that was previously presented in DFSORT
Application Programming Guide R14, SC33-4035-20.

The following sections summarize the changes to that information.

New Information
This edition includes the following new enhancements:

ICETOOL Enhancements
A new SPLICE operator helps you to perform various file join and match
operations. SPLICE allows you to create output records in a variety of ways by
splicing together fields from records that have the same key, but different
information. For example, for the same userid, you could create output records
consisting of the division and department from one type of record (originating in
input file1) with the account number and phone number from another type of record
(originating in input file2). Spliced records can be created by combining the first
duplicate and:
v one or more fields from the last duplicate, or
v one or more fields for each subsequent duplicate, or
v one field from each subsequent duplicate.
Non-duplicate records can be deleted or kept.

The USING(xxxx) option can now be used with ICETOOLs SELECT operator to
process DFSORT control statements like INCLUDE, OMIT and OUTFIL for a
SELECT operation.

New LISTSDB and LISTNOSDB options for ICETOOLs DEFAULTS, DISPLAY and
OCCUR operators allow you to control the use of system-determined optimum
blocksize for LIST data sets.

OUTFIL Enhancements
New SAMPLE=n and SAMPLE=(n,m) options of OUTFIL allow you to sample
records in a variety of ways.

A new REPEAT=n option of OUTFIL allows you to write each output record multiple
times.

A new SPLITBY=n option of OUTFIL allows you to write groups of records in


rotation among multiple output data sets.

A new DATE4 option of OUTFIL OUTREC allows you to insert a timestamp for your
DFSORT run in the form yyyy-mm-dd-hh.mm.ss into your records.

xxii z/OS V1R5.0 DFSORT Application Programming Guide


A new DATE4 option of OUTFIL INCLUDE and OUTFIL OMIT allows you to
compare fields to a timestamp for your DFSORT run in the form
yyyy-mm-dd-hh.mm.ss or to a portion of that timestamp truncated on the right.

OUTFIL OUTREC now allows you to insert decimal constants (+n and n) in your
records as BI, FI, PD, ZD, FS or edited CH values.

OUTFIL OUTREC now allows you to combine fields (p,m,f), decimal constants (+n
and n), operators (MIN, MAX, MUL, DIV, MOD, ADD, SUB) and parentheses to
form arithmetic expressions, and place the results in your records as BI, FI, PD, ZD,
FS or edited CH values.

The maximum length for an SS field used with OUTFIL INCLUDE and OUTFIL
OMIT has been raised to 32752.

A PD0 field can now be compared to a hexadecimal constant or to another PD0


field for OUTFIL INCLUDE and OMIT.

OUTFILE can now be used as an alias for OUTFIL.

INREC and OUTREC Enhancements


A new DATE4 option of INREC and OUTREC allows you to insert a timestamp for
your DFSORT run in the form yyyy-mm-dd-hh.mm.ss into your records.

INREC and OUTREC now allow you to insert decimal constants (+n and n) in your
records as BI, FI, PD, ZD, FS or edited CH values.

INREC and OUTREC now allow you to combine fields (p,m,f), decimal constants
(+n and n), operators (MIN, MAX, MUL, DIV, MOD, ADD, SUB) and parentheses
to form arithmetic expressions, and place the results in your records as BI, FI, PD,
ZD, FS or edited CH values.

INCLUDE and OMIT Enhancements


A new DATE4 option of INCLUDE and OMIT allows you to compare fields to a
timestamp for your DFSORT run in the form yyyy-mm-dd-hh.mm.ss or to a portion
of that timestamp truncated on the right.

The maximum length for an SS field used with INCLUDE and OMIT has been
raised to 32752.

A PD0 field can now be compared to a hexadecimal constant or to another PD0


field for INCLUDE and OMIT.

FORMAT=f can now be used with mixed p,m and p,m,f fields in the COND operand
for INCLUDE and OMIT. f from FORMAT=f will be used for p,m fields but not for
p,m,f fields.

SORT, MERGE and SUM Enhancement


FORMAT=f can now be used with mixed p,m and p,m,f fields in the FIELDS
operand for SORT, MERGE and SUM. f from FORMAT=f will be used for p,m fields
but not for p,m,f fields.

Other Enhancements
Enhancements to DFSORTs control statement continuation rules allow you to
continue a line that breaks at column 71 anywhere in columns 2 to 16 of the next
line.

Summary of Changes xxiii


When PARMDDN=ddname is specified at installation-time, DFSORT will now use a
//DFSPARM DD data set if a //ddname DD data set is not present. When
PARMDDN=DFSPARM is specified or defaulted at installation-time, DFSORT will
continue to use a //$ORTPARM DD data set if a //DFSPARM DD data set is not
present.

Summary of Changes for SC33-4035-21 DFSORT Release 14 (PTFs -


March, 2002)
This document contains information that was previously presented in DFSORT
Application Programming Guide R14, SC33-4035-20.

The following sections summarize the changes to that information.

New Information
This edition includes the following new enhancements:

z900
DFSORT can now exploit the z900s 64-bit real architecture by backing storage and
data spaces in real storage above 2 gigabytes, and by using central storage instead
of expanded storage for Hipersorting.

Multiple Hiperspaces
DFSORT can now use multiple Hiperspaces for external storage requirements,
increasing DFSORTs ability to use Hipersorting for large sort applications when
sufficient system resources are available.

Managed Tapes
DFSORT can now automatically obtain accurate input file size information for tapes
managed by tape management systems that supply a tape exit routine (ICETPEX).
This can result in improved sort performance and more accurate dynamic work
space allocation.

DFSORT can now automatically obtain input and output attributes such as RECFM,
LRECL and BLKSIZE, for tapes managed by tape management systems that supply
a tape exit routine (ICETPEX).

ICETOOL Enhancements
New EMPTY, NOTEMPTY, HIGHER(n), LOWER(n), EQUAL(n) and NOTEQUAL(n)
options of ICETOOLs COUNT operator allow you to set RC=12 or RC=0 based on
the count of records in a data set.

A new FIRSTDUP option of ICETOOLs SELECT operator allows you to keep just
the first record of each set of duplicates.

A new LASTDUP option of ICETOOLs SELECT operator allows you to keep just
the last record of each set of duplicates.

The DISCARD(savedd) option of ICETOOLs SELECT operator can now be


specified without the TO(outdd) operand.

The maximum length for a CH field used with ICETOOL has been raised to 1500.

The maximum length for a HEX field used with ICETOOL has been raised to 1000.

xxiv z/OS V1R5.0 DFSORT Application Programming Guide


New DT1, DT2 and DT3 formats of ICETOOLs DISPLAY and OCCUR operators
allow you to produce meaningful representations of SMF date values.

New TM1, TM2, TM3 and TM4 formats of ICETOOLs DISPLAY and OCCUR
operators allow you to produce meaningful representations of SMF time values.

A new INDENT(n) option of ICETOOLs DISPLAY and OCCUR operators allows you
to specify the number of blanks for indentation.

A new BETWEEN(n) option of ICETOOLs DISPLAY and OCCUR operators allows


you to specify the number of blanks between columns.

A new STATLEFT option of ICETOOLs DISPLAY operator allows you to print the
headings for statistics to the left of the first column of data.

The use of formatting items has been extended to the record length, record number
and break field of ICETOOLs DISPLAY operator, and to the data field, record
length and value count of ICETOOLs OCCUR operator.

Additional formatting items are now provided as follows: Epattern (use a specified
pattern for numeric digits such as phone numbers, social security numbers, dates,
and so on), /D (divide by 10), /C (divide by 100), /DK (divide by 10000), /CK (divide
by 100000), LZ (leading zeros for mask), NOST (no statistics), and Ndd (dd digits).

A new DATENS(abc) option of ICETOOLs DISPLAY and OCCUR operators allows


you to insert the date of your ICETOOL run into your titles without a separator.
Separators are included for existing options DATE and DATE(abcd).

A new TIMENS(ab) option of ICETOOLs DISPLAY and OCCUR operators allows


you to insert the time of your ICETOOL run into your titles without a separator.
Separators are included for existing options TIME and TIME(abc).

OUTFIL Enhancements
A new FTOV option of OUTFIL allows you to convert fixed-length input records (for
example, FB) to variable-length output records (for example, VB). A new VTOF
option of OUTFIL (an alias for CONVERT) allows you to convert variable-length
input records (for example, VB) to fixed-length output records (for example, FB).

A new VLTRIM=byte option of OUTFIL allows you to remove trailing bytes such as
blanks, binary zeros or asterisks, from variable-length output records.

A new REMOVECC option of OUTFIL allows you to remove the ANSI control
characters from a report.

New DATEn, DATEn(c) and DATEnP options of OUTFIL OUTREC allow you to
insert the date of your DFSORT run into your records in various forms.

New TIMEn, TIMEn(c) and TIMEnP options of OUTFIL OUTREC allow you to insert
the time of your DFSORT run into your records in various forms.

New DT1, DT2 and DT3 formats of OUTFIL OUTREC allow you to produce
meaningful representations of SMF date values.

New TM1, TM2, TM3 and TM4 formats of OUTFIL OUTREC allow you to produce
meaningful representations of SMF time values.

Summary of Changes xxv


A new TRAN=LTOU option of OUTFIL OUTREC allows you to change lowercase
EBCDIC letters anywhere in a field to uppercase EBCDIC letters.

A new TRAN=UTOL option of OUTFIL OUTREC allows you to change uppercase


EBCDIC letters anywhere in a field to lowercase EBCDIC letters.

A new TRAN=ALTSEQ option of OUTFIL OUTREC allows you to change characters


anywhere in a field according to the ALTSEQ translation table in effect.

A new M26 edit mask of OUTFIL OUTREC allows you to edit numeric values
according to the pattern ST...T (S is the sign and T is a significant digit).

The maximum position for the end of a field used with OUTFIL INCLUDE and OMIT
has been raised to 32752.

New DATEn, DATEn(c) and DATEnP options of OUTFIL INCLUDE and OMIT allow
you to compare fields with various formats to the date of your DFSORT run.

A positive decimal number (n or +n) can now be compared to a binary (BI) field for
OUTFIL INCLUDE and OMIT.

A new DATENS=(abc) option of OUTFIL HEADERx and TRAILERx allows you to


insert the date of your DFSORT run into your headers and trailers without a
separator. Separators are included for existing options DATE and DATE=(abcd).

A new TIMENS=(ab) option of OUTFIL HEADERx and TRAILERx allows you to


insert the time of your DFSORT run into your headers and trailers without a
separator. Separators are included for existing options TIME and TIME=(abc).

A new SKIP=0L option of OUTFIL SECTIONS allows you to suppress blank lines
between sections on the same page.

INREC and OUTREC Enhancements


New DATEn, DATEn(c) and DATEnP options of INREC and OUTREC allow you to
insert the date of your DFSORT run into your records in various forms.

New TIMEn, TIMEn(c) and TIMEnP options of INREC and OUTREC allow you to
insert the time of your DFSORT run into your records in various forms.

New DT1, DT2 and DT3 formats of INREC and OUTREC allow you to produce
meaningful representations of SMF date values.

New TM1, TM2, TM3 and TM4 formats of INREC and OUTREC allow you to
produce meaningful representations of SMF time values.

A new TRAN=LTOU option of INREC and OUTREC allows you to change


lowercase EBCDIC letters anywhere in a field to uppercase EBCDIC letters.

A new TRAN=UTOL option of INREC and OUTREC allows you to change


uppercase EBCDIC letters anywhere in a field to lowercase EBCDIC letters.

A new TRAN=ALTSEQ option of INREC and OUTREC allows you to change


characters anywhere in a field according to the ALTSEQ translation table in effect.

A new M26 edit mask of INREC and OUTREC allows you to edit numeric values
according to the pattern ST...T (S is the sign and T is a significant digit).

xxvi z/OS V1R5.0 DFSORT Application Programming Guide


SUM Enhancement
The VLSHRT option can now be used to process short SORT and MERGE control
fields, and INCLUDE and OMIT compare fields, when a SUM statement is
specified. Records with short SUM summary fields are left unsummed.

SORT and MERGE Enhancements


The maximum position for the end of a field used with SORT and MERGE has been
raised to 32752.

The maximum length for an AQ or AC field used with SORT and MERGE has been
raised to 4092.

INCLUDE and OMIT Enhancements


New DATEn, DATEn(c) and DATEnP options of INCLUDE and OMIT allow you to
compare fields with various formats to the date of your DFSORT run.

The maximum position for the end of a field used with INCLUDE and OMIT has
been raised to 32752.

A positive decimal number (n or +n) can now be compared to a binary (BI) field for
INCLUDE and OMIT.

Other Enhancements
The IBM-supplied default for ICEMAC option DYNSPC has been changed from 32
megabytes to 256 megabytes. This allows DFSORT to sort more data by default
with dynamically allocated work space when the input file size is unknown.

DYNSPC can now be specified as a run-time option. This allows you to adjust the
dynamically allocated work space for individual sort applications for which the input
file size is unknown.

DFSORT now issues message ICE118I, and sets on bit 3 of SMF type-16 record
field ICEFSZFL, when the input file size is unknown for a sort application. This
identifies sort applications which may benefit from a FILSZ=En or DYNSPC=n
value.

DFSORT copy can now be used when ICEGENER is called by a program that uses
an alternate SYSIN ddname with DUMMY. This can result in improved performance
for RACFs IRRUT200 utility when ICEGENER is installed as a replacement for
IEBGENER.

When all of the input for variable-length records is supplied through an E15 or E32
exit, and RECFM is not specified for the output data set, DFSORT now sets the
output RECFM as blocked rather than unblocked, if that allows the use of the
system-determined optimum block size for output.

A hyphen (-) can now be used as the second or subsequent character in a


DFSORT symbol name.

DFSORT now issues message ICE042A and terminates if the QNAME option is
specified on an output DD statement.

Summary of Changes xxvii


xxviii z/OS V1R5.0 DFSORT Application Programming Guide
Chapter 1. Introducing DFSORT
DFSORT Overview . . . . . . . . . . . . . . . . . . . . . . . . 1
DFSORT on the Web . . . . . . . . . . . . . . . . . . . . . . . 3
DFSORT FTP Site . . . . . . . . . . . . . . . . . . . . . . . . 4
Invoking DFSORT . . . . . . . . . . . . . . . . . . . . . . . . 4
How DFSORT Works . . . . . . . . . . . . . . . . . . . . . . . 4
Operating Systems . . . . . . . . . . . . . . . . . . . . . . . 5
Control Fields and Collating Sequences . . . . . . . . . . . . . . . 5
Cultural Environment Considerations . . . . . . . . . . . . . . . . 6
DFSORT Processing . . . . . . . . . . . . . . . . . . . . . . 7
Input Data SetsSORTIN and SORTINnn . . . . . . . . . . . . . . . 10
Output Data SetsSORTOUT and OUTFIL . . . . . . . . . . . . . . 11
Data Set Considerations . . . . . . . . . . . . . . . . . . . . . 11
Sorting or Copying Records . . . . . . . . . . . . . . . . . . . 11
Merging Records . . . . . . . . . . . . . . . . . . . . . . . 12
Data Set Notes and Limitations . . . . . . . . . . . . . . . . . . 12
General Considerations . . . . . . . . . . . . . . . . . . . . 12
Padding and Truncation . . . . . . . . . . . . . . . . . . . 13
QSAM Considerations . . . . . . . . . . . . . . . . . . . . 14
VSAM Considerations . . . . . . . . . . . . . . . . . . . . 14
HFS File Considerations . . . . . . . . . . . . . . . . . . . . . 15
Installation Defaults . . . . . . . . . . . . . . . . . . . . . . . 15
Migrating to DFSORT from Other Sort Products . . . . . . . . . . . . . 21
DFSORT Messages and Return Codes . . . . . . . . . . . . . . . . 22
Use Blockset Whenever Possible . . . . . . . . . . . . . . . . . . 23

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

Copyright IBM Corp. 1973, 2004 1


DFSORT Overview

office location. Or perhaps you want to leave out any record dated after 1987 if it
also contains a value greater than 20 for the number of employees.

You can 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 tasks including:
| v Insertion of blanks, zeros, strings, current 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 hexadecimal display, conversion of
EBCDIC letters from lowercase to uppercase or uppercase to lowercase,
conversion of characters using the ALTSEQ translation table, and conversion of
numeric values from one format to another.
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 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 or hexadecimal string from a lookup table, based on a
character, hexadecimal, or bit string as input (that is, lookup and change).

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.
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 Insertion of blanks, zeros, strings, current 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 hexadecimal display, conversion of
EBCDIC letters from lowercase to uppercase or uppercase to lowercase,
conversion of characters using the ALTSEQ translation table, and conversion of
numeric values from one format to another.

2 z/OS V1R5.0 DFSORT Application Programming Guide


DFSORT Overview

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 date and time values to more usable forms.
v Transformation 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 or hexadecimal string for output from a lookup table,
based on a character, hexadecimal, or bit string as input (that is, lookup and
change).
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,page
number, character strings, and blank lines) or derive from the input records (for
example, character fields; edited numeric input fields; record counts; and edited
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.
| 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 or constant 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. See Chapter 7, Using Symbols for Fields and
Constants, on page 507.

DFSORT on the Web


For articles, online documents, news, tips, techniques, examples, and more, visit
the DFSORT/MVS home page at:
| http://www.ibm.com/storage/dfsort

Chapter 1. Introducing DFSORT 3


DFSORT Overview

DFSORT FTP Site


You can obtain DFSORT articles and examples via anonymous FTP to:
ftp.software.ibm.com/storage/dfsort/mvs/

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)

| Restriction: TSO users cannot invoke DSORT using:


| iceman

| or any other alias for DFSORT (for example, SORT) in this form.

See Chapter 10, Examples of DFSORT Job Streams, on page 583 for
examples of invoking DFSORT from REXX and CLISTs.
v With a program written in basic assembler language using a system macro
instruction. See Chapter 5, Invoking DFSORT from a Program, on page 363.
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 381.
v With interactive panels supported under ISPF and ISMF. See DFSORT Panels
Guide for complete information.

Note: DFSORT Panels supports interactive panels for a subset of the functions
available with DFSORT. Although interactive panels for functions such as
DFSORTs Year 2000 Features and the OUTFIL Statement are not provided,
you can use Free Form Entry panels to specify complete DFSORT Control
Statements for these functions.

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.

How DFSORT Works


This section contains a list of the operating systems supported by DFSORT and an
explanation of how DFSORT uses control fields and collating sequences to sort,
merge, and copy the records of a data set.

The Blockset technique is DFSORTs most efficient technique for sorting, merging
and copying data sets. DFSORT uses the Blockset technique whenever possible to

4 z/OS V1R5.0 DFSORT Application Programming Guide


How DFSORT Works

take advantage of its highly optimized internal algorithms and efficient utilization of
IBM hardware. If Blockset cannot be used, DFSORT uses another of its techniques
Peerage/Vale or Conventional.

Operating Systems
DFSORT runs under control of your operating system and must be initiated
according to the appropriate conventions. The operating systems this release
supports are:
v z/OS
| v z/OS.e

| Throughout this document, z/OS is used to refer to the z/OS and z/OS.e operating
| systems.

Additionally, DFSORT runs under z/OS when it is running as a guest under z/VM or
VM/ESA.

DFSORT is compatible with all of the IBM processors supported by z/OS. In


addition to any device supported by these operating systems for program residence,
DFSORT also operates with any device QSAM or VSAM uses for input or output.

Control Fields and Collating Sequences


You define control fields to identify the information you want DFSORT to sort or
merge. When thinking of the contents of your data sets, you probably think of
names, dates, account numbers, or similar pieces of useful information. For
example, when sorting your data sets, you might choose to arrange your records in
alphabetical order, by family name. By using the byte position and length (in bytes)
of the portion of each record containing a family name, you can define it as a
control field to manipulate with DFSORT.

DFSORT uses the control fields you define as keys in processing. A key is a
concept, such as family name, that you have in mind when you design a record
processing strategy for a particular application. A control field, on the other hand, is
a discrete portion of a record that contains the text or symbols corresponding to that
information in a form that can be used by DFSORT to identify and sort, or merge
the records. For all practical purposes, you can think of keys as equivalent to the
control fields DFSORT uses in processing.

To arrange your records in a specific order, identify one or more control fields of
your records to use as keys. The sequence in which you list the control fields
becomes the order of priority DFSORT uses to arrange your records. The first
control field you specify is called the major control field. Subsequent control fields
are called minor control fields, as in first, second, third minor control fields, and so
on.

If two or more records have identical values for the first control field, they are
arranged according to the values in the second. Records with identical values for
the first and second are arranged according to the third, and so on, until a
difference is found or no more control fields are available.

Records with identical values for all the control fields specified retain their original
input order or are arranged randomly, depending upon which of the two options,

Chapter 1. Introducing DFSORT 5


How DFSORT Works

EQUALS or NOEQUALS, is in effect. You can direct DFSORT to retain the original
input order for records with identical values for all control fields by specifying
EQUALS.

Control fields may overlap, or be contained within other control fields (such as a
three-digit area code, within a 10-digit telephone number). They do not need to be
contiguous but must be located within the first 32752 bytes of the record (see
Figure 1).

Record

Control Control Control


field 3 field 4 Control field 1 field 2
(major)

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 ISCII/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 during installation with the ICEMAC ALTSEQ 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.

Cultural Environment Considerations


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.

6 z/OS V1R5.0 DFSORT Application Programming Guide


Cultural Environment Considerations

The cultural environment is established by selecting the active locale. The active
locale affects the behavior of locale-sensitive functions. In particular, the active
locales collating rules affect DFSORTs SORT, MERGE, INCLUDE, and OMIT
processing as follows:
v Sort and Merge
DFSORT produces sorted or merged records for output according to the collating
rules defined in the active locale. This provides sorting and merging for single- or
multi-byte character data based on defined collating rules that retain the cultural
and local characteristics of a language.
v Include and Omit
DFSORT includes or omits records for output according to the collating rules
defined in the active locale. This provides inclusion or omission for single- or
multi-byte character data based on defined collating rules that retain the cultural
and local characteristics of a language.

The DFSORT option LOCALE specifies whether locale processing is to be used


and, if so, designates the active locale. Only one locale can be active at a time for
any DFSORT application.

DFSORT Processing
Unless you use DFSORT Panels to prepare and submit your job (see DFSORT
Panels Guide), 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 363) 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 79) 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 615.
3. A combination of Hiperspace and work data sets.

Merge and copy applications do not require intermediate storage.

Figure 2 on page 8 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.

Chapter 1. Introducing DFSORT 7


DFSORT Processing

| Sorting or Copying Merging

SORTIN SORTINnn

SKIPREC

E15 E15 E32

INCLUDE / OMIT

STOPAFT INCLUDE / OMIT

INREC INREC

SORT / SUM
or MERGE / SUM
COPY

OUTREC OUTREC

E35 E35 E35 E35

OUTFIL input records SORTOUT OUTFIL input records


SORTOUT

OUTFIL STARTREC OUTFIL STARTREC


OUTFIL SAMPLE OUTFIL SAMPLE
OUTFIL ENDREC OUTFIL ENDREC

OUTFIL INCLUDE OUTFIL INCLUDE


OUTFIL OMIT OUTFIL OMIT
OUTFIL SAVE OUTFIL SAVE

OUTFIL OUTREC OUTFIL OUTREC


OUTFIL FTOV OUTFIL FTOV
OUTFIL VTOF or OUTFIL VTOF or
CONVERT CONVERT
OUTFIL VLFILL OUTFIL VLFILL
OUTFIL VLTRIM OUTFIL VLTRIM
OUTFIL REPEAT OUTFIL REPEAT
OUTFIL Reports OUTFIL Reports

OUTFIL SPLIT OUTFIL SPLIT


OUTFIL SPLITBY OUTFIL SPLITBY

OUTFIL Data Sets OUTFIL Data Sets

|
| Figure 2. Record Processing Order
|
As shown in Figure 2, DFSORT processing follows this order:

8 z/OS V1R5.0 DFSORT Application Programming Guide


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 modify the record format, the
INCLUDE/OMIT control field definitions 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. If you
changed record format before this step, the INREC control and separation field
definitions you specify must apply to the current format rather than to the
original one.
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 made any changes to the record format prior
to this step, the SORT or MERGE and SUM field definitions you specify
must apply to the current format rather than to the original one.
8. DFSORT performs processing specified in an OUTREC statement. If you
changed record format prior to this step, the OUTREC control or separation
field definitions must apply to the current format rather than to the original one.

Chapter 1. Introducing DFSORT 9


DFSORT Processing

9. If an E35 user exit is present, DFSORT transfers control to your user exit
routine after all statement processing is completed. If you changed record
format, the E35 user exit receives the records in the current format rather than
in the original one. 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 OUTREC, FTOV, VTOF (or
| CONVERT), VLFILL, VLTRIM and REPEAT options. Data records are
| reformatted, converted and repeated according to the options specified.
| v DFSORT performs processing specified with the LINES, HEADER1,
| TRAILER1, HEADER2, TRAILER2, SECTIONS, NODETAIL, and
| REMOVECC options. Report records are reformatted and report records are
| generated for the OUTFIL data sets.
| v DFSORT performs SPLIT or SPLITBY 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.

Input Data SetsSORTIN and SORTINnn


DFSORT processes two types of input data sets, referred to as the SORTIN data
set (or just SORTIN) and the SORTINnn data sets (or just SORTINnn).

The SORTIN DD statement specifies the input data set (or concatenated input data
sets) for a sort or copy application. If a SORTIN DD statement is present, it will be
used by default for a sort or copy application unless you invoke DFSORT from a
program with the address of an E15 user exit in the parameter list.

The SORTINnn DD statements (where nn can be 00 to 99) specify the data sets for
a merge application. If a SORTINnn DD statement is present, it will be used by
default for a merge application unless you invoke DFSORT from a program with the
address of an E32 user exit in the parameter list.

Data Set Considerations on page 11 contains general information about input data
sets. For specific information about the SORTIN data set, see SORTIN DD
Statement on page 67. For specific information about the SORTINnn data sets,
see SORTINnn DD Statement on page 68.

10 z/OS V1R5.0 DFSORT Application Programming Guide


Output Data SetsSORTOUT and OUTFIL

Output Data SetsSORTOUT and OUTFIL


DFSORT processes two types of output data sets, referred to as the SORTOUT
data set (or just SORTOUT) and the OUTFIL data sets.

The SORTOUT DD statement specifies the single non-OUTFIL output data set for a
sort, copy, or merge application. OUTFIL processing does not apply to SORTOUT. If
a SORTOUT DD statement is present, it will be used by default for a sort, copy, or
merge application unless you invoke DFSORT from a program with the address of
an E35 user exit in the parameter list.

The FNAMES and/or FILES parameters of one or more OUTFIL statements specify
the ddnames of the OUTFIL data sets for a sort, copy, or merge application. The
parameters specified for each OUTFIL statement define the OUTFIL processing to
be performed for the OUTFIL data sets associated with that statement. Each
ddname specified must have a corresponding DD statement.

Although the ddname SORTOUT can actually be used for an OUTFIL data set, the
term SORTOUT will be used to denote the single non-OUTFIL output data set.

Data Set Considerations contains general information about output data sets. For
specific information about the SORTOUT data set, see SORTOUT and OUTFIL DD
Statements on page 72. For specific information about the OUTFIL data sets, see
SORTOUT and OUTFIL DD Statements on page 72 and OUTFIL Control
Statements on page 194.

Data Set Considerations


You must define any data sets you provide for DFSORT according to the
conventions your operating system requires. You can use the label checking
facilities of the operating system during DFSORT processing. See Application
Development Guide for details.

Unless you use DFSORT Panels to create and submit your jobs, you must describe
all data sets (except those allocated with the DYNALLOC parameter) in DD
statements. You must place the DD statements in the operating system input
stream with the job step that allocates DFSORT processing.

DFSORT Panels operates in two modes: foreground and background. Foreground


mode uses CLIST processing instead of JCL, so if you choose this technique you
do not need JCL at all. Background mode creates DFSORT jobs containing the job
control language (including DD statements) already coded in the DFSORT Panels
user profile. This JCL is the same as that which you code yourself. See DFSORT
Panels Guide for more information.

Sorting or Copying Records


Input to a sort or copy application can be a blocked or unblocked QSAM or VSAM
data set containing fixed- or variable-length records. QSAM input data sets can be
concatenated even if they are on dissimilar devices. See SORTIN DD Statement
on page 67 for the restrictions that apply.

Output from a sort or copy application can be blocked or unblocked QSAM or


VSAM data sets, regardless of whether the input is QSAM or VSAM. Unless

Chapter 1. Introducing DFSORT 11


Data Set Considerations

OUTFIL is used to convert variable input to fixed output, or fixed input to variable
output, an output data set must be the same type (fixed or variable) as the input
data set.

Hierarchical File System (HFS) files are supported as input and output for sort and
copy applications.

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.

Hierarchical File System (HFS) files are supported as input and output for merge
applications.

Data Set Notes and Limitations


There are some considerations and limitations that you need to be aware of. These
are described in the following sections.

For more information about specific DFSORT data sets, see Using DD Statements
on page 60.

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, ISCII/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, 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.

The maximum record length DFSORT can handle is subject to the following
limitations:
v Record length can never exceed the maximum record length you specify.
v Variable-length records are limited to 32756 bytes.
v VSAM variable-length records are limited to 32752 bytes.
v Fixed-length records are limited to 32760 bytes.

12 z/OS V1R5.0 DFSORT Application Programming Guide


Data Set Considerations

v Variable block-spanned records are limited to 32767 bytes.


v For a tape work data set sort, the maximum record length is limited to 32752
bytes with NOEQUALS in effect and to 32748 bytes with EQUALS in effect.

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.

Padding and Truncation


You can control the action that DFSORT takes when the SORTOUT LRECL is
smaller than the SORTIN/SORTINnn LRECL with the TRUNC option as described
in OPTION Control Statement on page 142.

DFSORT truncates fixed-length records on the right when the SORTOUT LRECL is
smaller than the SORTIN/SORTINnn LRECL provided that:
v The application is not a conventional merge or tape work data set sort.
v TRUNC=RC16 is not in effect.

You can control the action that DFSORT takes when a variable-length output record
is longer than the LRECL of the SORTOUT or OUTFIL data set to which it is to be
written by using the VLLONG or NOVLLONG option as described in OPTION
Control Statement on page 142.

You can control the action that DFSORT takes when the SORTOUT LRECL is
larger than the SORTIN/SORTINnn LRECL with the PAD option as described in
OPTION Control Statement on page 142.

DFSORT pads fixed-length records with binary zeros on the right when the
SORTOUT LRECL is larger than the SORTIN LRECL provided that:
v The Blockset technique is selected.
v The application is a sort or copy.
v PAD=RC16 is not in effect.

DFSORT does not pad or truncate records returned from an E15 or E35 user exit
since it expects the exit to pad or truncate each record appropriately.

You can use INREC, OUTREC, and OUTFIL to pad, truncate, and reformat records.
See INREC Control Statement on page 117 and OUTREC Control Statement on
page 281 for details.

See Use ICEGENER Instead of IEBGENER on page 579 for information about
padding and truncating with ICEGENER.

Chapter 1. Introducing DFSORT 13


Data Set Considerations

For more information about Blockset and other DFSORT techniques, see Specify
Efficient Sort/Merge Techniques on page 565.

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 67 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 293.
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.
v If VSAMIO and RESET are in effect, a data set defined with REUSE can be used
for both input and output for a sort; that is, the data set can be sorted in-place.
v A data set used for input or output must have been previously defined.
v If VSAMEMT is in effect, an empty input data set is processed as having zero
records.
v VSAM data sets must not be concatenated (system restriction).
v VSAM and non-VSAM input data sets must not be specified together for a sort,
merge or copy application.
v If output is a VSAM key-sequenced data set (KSDS), the key must be the first
control field (or the key fields must be in the same order as the first control field).
VSAM does not allow you to store records with duplicate primary keys.

14 z/OS V1R5.0 DFSORT Application Programming Guide


Data Set Considerations

v Any VSAM exit function available for input data sets can be used except
EODAD. See the description of E18 use with VSAM in Chapter 4, Using Your
Own User Exit Routines, on page 313.
v You must build the VSAM exit list with the VSAM EXLST macro instruction giving
the addresses of your routines that handle VSAM exit functions.
v When processing variable-length records with VSAM input and non-VSAM
output, the output LRECL must be at least 4 bytes greater than the maximum
record size defined for the cluster. Non-VSAM variable-length records have a
record descriptor word (RDW) field 4 bytes long at the beginning of each record,
but VSAM records do not. The record size defined for the VSAM cluster is
therefore 4 bytes less than the non-VSAM LRECL.
v An output data set defined without REUSE is processed as MOD.
v If RESET is in effect, an output data set defined with REUSE is processed as
NEW. If NORESET is in effect, an output data set defined with REUSE is
processed as MOD.
v DFSORT cannot access VSAM data sets in RLS mode, that is, RLS=CR and
RLS=NRI are not supported for VSAM input and output data sets.

HFS File Considerations


Hierarchical File System (HFS) files can be used for input and output, but are only
supported by the Blockset technique. If Blockset is not selected for a DFSORT
application that uses HFS files, DFSORT will issue an error message and terminate.

You should be familiar with the information found in z/OS UNIX System Services
Users Guide regarding HFS files if you use them. DFSORT uses BSAM to access
HFS files and is thus subject to all of the capabilities and restrictions that entails, as
described in z/OS DFSMS: Using Data Sets.

Installation Defaults
When your system programmers installed DFSORT, they selected separate sets of
installation (ICEMAC) parameters to be used by default for the following eight
installation modules:
ICEAM1 (JCL)
is the batch direct invocation environment installation module. This set of
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 module (ICETDx) is not activated.
ICEAM2 (INV)
is the batch program invocation environment installation module. This set of
defaults is used at run time when DFSORT is invoked through batch
programs, provided that an enabled time-of-day installation module
(ICETDx) is not activated.
ICEAM3 (TSO)
is the TSO direct invocation environment installation module. This set of
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 module (ICETDx) is not activated.
ICEAM4 (TSOINV)
is the TSO program invocation environment installation module. This set of

Chapter 1. Introducing DFSORT 15


Installation Defaults

defaults is used at run time when DFSORT is invoked through programs by


foreground TSO users, provided that an enabled time-of-day installation
module (ICETDx) is not activated.
ICETD1 (TD1)
is the first time-of-day installation module. This set of defaults is used at run
time when it is activated for the time-of-day of the run, provided it is
enabled by the environment installation module (ICEAMx) in effect.
ICETD2 (TD2)
is the second time-of-day installation module. This set of defaults is used at
run time when it is activated for the time-of-day of the run, provided it is
enabled by the environment installation module (ICEAMx) in effect.
ICETD3 (TD3)
is the third time-of-day installation module. This set of defaults is used at
run time when it is activated for the time-of-day of the run, provided it is
enabled by the environment installation module (ICEAMx) in effect.
ICETD4 (TD4)
is the fourth time-of-day installation module. This set of defaults is used at
run time when it is activated for the time-of-day of the run, provided it is
enabled by the environment installation module (ICEAMx) in effect.

The selected 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 625 for full
override details). This document assumes that DFSORT was installed at your site
with the defaults that it was delivered with.

You can use an ICETOOL job similar to the following one to list the installation
defaults actually in use at your site for the eight installation modules and the
IBM-supplied defaults they override, where appropriate.
Table 3. Using ICETOOL to List Installation Defaults

//DFRUN JOB A402,PROGRAMMER


//LISTDEF EXEC PGM=ICETOOL,REGION=1024K
//TOOLMSG DD SYSOUT=A
//DFSMSG DD SYSOUT=A
//SHOWDEF DD SYSOUT=A
//TOOLIN DD *
DEFAULTS LIST(SHOWDEF)
/*

See Chapter 6, Using ICETOOL, on page 381 and DEFAULTS Operator on page
400 for more information on using ICETOOL and the DEFAULTS operator.

The functions of the available ICEMAC parameters are summarized below. z/OS
DFSORT Installation and Customization contains complete descriptions of the
available ICEMAC parameters, 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 environment installation module

16 z/OS V1R5.0 DFSORT Application Programming Guide


Installation Defaults

(ICEAMx) or time-of-day installation module


(ICETDx) for which this set of ICEMAC defaults is
to be used.
ENABLE Specifies whether ICETDx installation modules are
to be used if activated for this ICEAMx environment
module.
day Specifies the time ranges for each day of the week
when this ICETDx installation module is to be
activated.
ABCODE Specifies the ABEND code used when DFSORT
abends for a critical error.
ALTSEQ Specifies changes to the ALTSEQ translation table.
ARESALL Specifies the number of bytes reserved above
16MB virtual for system use.
ARESINV Specifies the number of bytes reserved above
16MB virtual for the invoking program when
DFSORT is program invoked.
CFW Specifies whether DFSORT can use cache fast
write when processing work data sets.
CHALT Translates format CH as well as format AQ, or
translates format AQ only.
CHECK Specifies whether record count checking is
suppressed for applications that use an E35 user
exit routine without an output data set.
CINV Specifies whether DFSORT can use control interval
access for VSAM data sets.
COBEXIT Specifies the library for COBOL E15 and E35
routines.
DIAGSIM Specifies whether a SORTDIAG DD statement is to
be simulated for DFSORT applications.
DSA Specifies the maximum amount of storage available
to DFSORT for dynamic storage adjustment of
Blockset sort applications.
DSPSIZE Specifies the maximum amount of data space to
use for dataspace sorting.
DYNALOC 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 ICEMAC option DYNAUTO and
run-time option DYNALLOC.
DYNAUTO Specifies whether work data sets are dynamically
allocated automatically.
DYNSPC Specifies the total default primary space allocation
for all of the dynamically allocated work data sets
when the file size is unknown.
EFS Specifies the name of a user-written Extended
Function Support program to be called by DFSORT.

Chapter 1. Introducing DFSORT 17


Installation Defaults

EQUALS Specifies whether the order of records that collate


identically is preserved from input to output.
ERET Specifies the action taken if DFSORT encounters a
critical error.
ESTAE Specifies whether DFSORT deletes its ESTAE
recovery routine early or uses it for the entire run.
EXITCK Specifies whether DFSORT terminates or continues
when it receives certain invalid return codes from
E15 or E35 user exit routines.
EXPMAX Specifies the maximum total amount of available
storage to be used at any one time by all
| Hipersorting and memory object sorting
applications.
EXPOLD Specifies the maximum total amount of old storage
| to be used at any one time by all Hipersorting and
| memory object sorting applications.
EXPRES Specifies the minimum amount of available storage
| to be reserved for use by non-Hipersorting and
| non-memory object sorting applications.
FSZEST Specifies whether DFSORT treats run-time options
FILSZ=n and SIZE=n as exact or estimated file
sizes.
GENER Specifies the name that ICEGENER is to use to
transfer control to the IEBGENER system utility.
(ICEGENER is DFSORTs facility for IEBGENER
jobs.)
GNPAD Specifies the action to be taken by ICEGENER for
LRECL padding.
GNTRUNC Specifies the action to be taken by ICEGENER for
LRECL truncation.
HIPRMAX Specifies the maximum amount of Hiperspace to
use for Hipersorting.
IDRCPCT 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.
IEXIT Specifies whether DFSORT passes control to your
sites ICEIEXIT routine.
IGNCKPT Specifies whether the checkpoint/restart facility is
ignored if it is requested at run-time and the
Blockset technique (which does not support the
checkpoint/restart facility) can be used.
IOMAXBF Specifies an upper limit to the amount of buffer
space to be used for SORTIN, SORTINnn and
SORTOUT data sets.
LIST Specifies whether DFSORT prints control
statements.

18 z/OS V1R5.0 DFSORT Application Programming Guide


Installation Defaults

LISTX Specifies whether DFSORT prints control


statements returned by an Extended Function
Support program.
LOCALE Specifies whether locale processing is to be used
and, if so, designates the active locale.
MAXLIM Specifies an upper limit to the amount of main
storage available to DFSORT below 16MB virtual.
MINLIM Specifies a lower limit to the amount of main
storage available to DFSORT.
| MOSIZE Specifies the maximum size of a memory object to
| use for memory object sorting
MSGCON Specifies the class of program messages DFSORT
writes to the master console.
MSGDDN Specifies an alternate name for the message data
set.
MSGPRT Specifies the class of program messages DFSORT
writes to the message data set.
NOMSGDD Specifies whether DFSORT terminates or continues
when the message data set is required but is not
available.
| NULLOFL Specifies the action to be taken by DFSORT when
| there are no data records for an OUTFIL data set.
| NULLOUT Specifies the action to be taken by DFSORT when
| there are no records for the SORTOUT data set.
ODMAXBF Specifies an upper limit to the amount of buffer
space to be used for each OUTFIL data set.
OUTREL Specifies whether unused temporary output data
set space is released.
OUTSEC Specifies whether DFSORT uses automatic
secondary allocation for output data sets that are
temporary or new.
OVERRGN Specifies the amount of main storage above the
REGION value available to Blockset.
OVFLO Specifies the action to be taken by DFSORT when
BI, FI, PD or ZD summary fields overflow.
PAD Specifies the action to be taken by DFSORT for
LRECL padding.
PARMDDN Specifies an alternate ddname for the DFSORT
DFSPARM data set.
RESALL Reserves storage for system and application use
when SIZE/MAINSIZE=MAX is in effect.
RESET Specifies whether DFSORT processes a VSAM
output data set defined with REUSE as a NEW or
MOD data set.
RESINV Reserves storage for programs invoking DFSORT
when SIZE/MAINSIZE=MAX is in effect.

Chapter 1. Introducing DFSORT 19


Installation Defaults

SDB Specifies whether DFSORT should use the


system-determined optimum block size for output
data sets when the block size is zero.
SDBMSG 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.
SIZE Specifies the maximum amount of main storage
available to DFSORT.
SMF Specifies whether DFSORT produces SMF type-16
records.
SOLRF Specifies whether DFSORT uses the reformatted
record length for the SORTOUT LRECL.
SORTLIB Specifies whether DFSORT searches a system or
private library for the modules used with a tape
work data set sort or Conventional merge.
SPANINC Specifies the action to be taken by DFSORT when
incomplete spanned records are detected.
STIMER Specifies whether DFSORT uses the STIMER
macro. If DFSORT does not use the STIMER
macro, processor timing data does not appear in
SMF records or in the ICETEXIT statistics.
| SVC Specifies a user SVC number for DFSORT.
SZERO Specifies whether DFSORT treats numeric 0 and
+0 values as signed (that is, different) or unsigned
(that is, the same).
TEXIT Specifies whether DFSORT passes control to your
sites ICETEXIT routine.
TMAXLIM 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.
TRUNC Specifies the action to be taken by DFSORT for
LRECL truncation.
VERIFY Specifies whether the sequence of output records is
verified.
VIO Specifies whether virtual allocation of work data
sets is accepted.
VLLONG Specifies whether DFSORT truncates long
variable-length output records.
VLSCMP Specifies whether DFSORT pads short
variable-length compare fields.
VLSHRT Specifies whether DFSORT continues processing if
a short variable-length control field, compare field or
summary field is found.
VSAMBSP Specifies the number of VSAM buffers DFSORT
can use.

20 z/OS V1R5.0 DFSORT Application Programming Guide


Installation Defaults

VSAMEMT Specifies whether DFSORT accepts an empty


VSAM input data set.
VSAMIO Specifies whether DFSORT allows a VSAM data
set defined with REUSE to be sorted in-place.
WRKREL Specifies whether unused temporary work data set
space is released.
WRKSEC Specifies whether DFSORT uses automatic
secondary allocation for temporary work data sets.
Y2PAST Specifies the sliding or fixed century window.
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 625.

Migrating to DFSORT from Other Sort Products


If you are migrating to DFSORT, you should review the IBM-supplied ICEMAC
defaults and change them as appropriate to correspond to equivalent settings for
your previous sort product. In particular, the options shown in the table that follows
can make DFSORT operate more like other sort products, thus making migration
easier. The ICEMAC options, described in z/OS DFSORT Installation and
Customization, can be used to change the way DFSORT works globally by default.
The run-time options, described in Chapter 2, Invoking DFSORT with Job Control
Language, on page 25 and Chapter 3, Using DFSORT Program Control
Statements, on page 79, can be used to override the ICEMAC options for specific
jobs.
Table 4. Options That Can Ease Migration
ICEMAC Run-Time
ABCODE=MSG/n
DYNALOC=(d,n) DYNALLOC=(d,n)
DYNAUTO=YES/IGNWKDD/NO DYNALLOC=(d,n)
DYNSPC=n DYNSPC=n
EQUALS=YES/NO/VBLKSET EQUALS/NOEQUALS
EXITCK=STRONG/WEAK EXITCK=STRONG/WEAK
FSZEST=YES/NO FILSZ=n/En/Un
NOMSGDD=QUIT/ALL/CRITICAL/NONE
PARMDDN=ddname
RESET=YES/NO RESET/NORESET
SORTLIB=SYSTEM/PRIVATE
SZERO=YES/NO SZERO/NOSZERO
VLLONG=YES/NO VLLONG/NOVLLONG
VLSCMP=YES/NO VLSCMP/NOVLSCMP
VSAMEMT=YES/NO VSAMEMT/NVSAMEMT
VSAMIO=YES/NO VSAMIO/NOVSAMIO

Chapter 1. Introducing DFSORT 21


Installation Defaults

Table 4. Options That Can Ease Migration (continued)


ICEMAC Run-Time
ZDPRINT=YES/NO ZDPRINT/NZDPRINT

DFSORT Messages and Return Codes


You can determine, during installation or run-time, whether DFSORT writes
messages to the message data set, to the master console, or to both. You can also
direct an Extended Function Support program to write messages to the message
data set.

Messages written to the message data set can be either critical error messages,
informational error messages, or diagnostic messages, as determined during
installation or run-time.

Messages written to the master console can be either critical error messages or
informational error messages, as determined during installation.

See z/OS DFSORT Messages, Codes and Diagnosis Guide for complete
information about DFSORT messages.

For successful completion, DFSORT passes back a return code of 0 or 4 to the


operating system or the invoking program.

For unsuccessful completion due to an unsupported operating system, DFSORT


passes back a return code of 24 to the operating system or the invoking program.

For unsuccessful completion with NOABEND in effect, DFSORT passes back a


return code of 16 or 20 to the operating system or the invoking program.

For unsuccessful completion with ABEND in effect, DFSORT issues a user abend
with the appropriate code as specified by ICEMAC option ABCODE (either the error
message number or a number between 1 and 99).

The meanings of the return codes that DFSORT passes back (in register 15) are:
0 Successful completion. DFSORT completed successfully.
4 Successful completion. DFSORT completed successfully, and:
v OVFLO=RC4 was in effect and summary fields overflowed, or
v PAD=RC4 was in effect and the SORTOUT LRECL was larger than the
SORTIN/SORTINnn LRECL (LRECL padding), or
v TRUNC=RC4 was in effect and the SORTOUT LRECL was smaller than
the SORTIN/SORTINnn LRECL (LRECL truncation), or
v SPANINC=RC4 was in effect and one or more incomplete spanned
records was detected, or
| v NULLOUT=RC4 was in effect and there were no records for the
| SORTOUT data set, or
| v NULLOFL=RC4 was in effect and there were no data records for an
| OUTFIL data set.
16 Unsuccessful completion. DFSORT detected an error that prevented it
from completing successfully.

22 z/OS V1R5.0 DFSORT Application Programming Guide


DFSORT Messages and Return Codes

20 Message data set missing. ICEMAC option NOMSGDD=QUIT was in


effect and neither a message data set DD statement nor a SYSOUT DD
statement was provided.
24 Unsupported operating system. This release of DFSORT does not
support this operating system.

Use Blockset Whenever Possible


Blockset is DFSORTs most efficient technique. It supports many features not
supported by DFSORTs less efficient Peerage/Vale and Conventional techniques
(see ICE189A in z/OS DFSORT Messages, Codes and Diagnosis Guide for a list of
these features). DFSORT always selects Blockset for a copy application. DFSORT
selects Blockset for a sort or merge application unless something prevents it from
doing so (see ICE800I in z/OS DFSORT Messages, Codes and Diagnosis Guide for
a list of reasons Blockset cannot be used).

Note: Blockset cannot be used to process BDAM data sets.

Message ICE143I indicates whether Blockset or a less efficient technique was


selected for a particular run. If Blockset was not selected for a sort or merge
application, check the reason code in message ICE800I, which indicates the reason
Blockset could not be used. If you did not get message ICE800I, add the following
DD statements to your application and rerun it:
//SORTDIAG DD DUMMY
//SYSOUT DD SYSOUT=*

If possible and appropriate, remove the obstacle that is causing Blockset not to be
selected.

Chapter 1. Introducing DFSORT 23


24 z/OS V1R5.0 DFSORT Application Programming Guide
Chapter 2. Invoking DFSORT with Job Control Language
Using the JCL . . . . . . . . . . . . . . . . . . . . . . . . . 25
Using the JOB Statement . . . . . . . . . . . . . . . . . . . . . 27
Using the EXEC Statement . . . . . . . . . . . . . . . . . . . . 27
Specifying EXEC Statement Cataloged Procedures . . . . . . . . . . 28
SORT Cataloged Procedure . . . . . . . . . . . . . . . . . . 28
SORTD Cataloged Procedure . . . . . . . . . . . . . . . . . 29
Specifying EXEC/DFSPARM PARM Options . . . . . . . . . . . . . 29
Aliases for PARM Options . . . . . . . . . . . . . . . . . . . . 59
Using DD Statements . . . . . . . . . . . . . . . . . . . . . . 60
Duplicate Ddnames . . . . . . . . . . . . . . . . . . . . . . 62
Shared Tape Units . . . . . . . . . . . . . . . . . . . . . . 62
System DD Statements . . . . . . . . . . . . . . . . . . . . . 63
Program DD Statements . . . . . . . . . . . . . . . . . . . . 65
SORTLIB DD Statement . . . . . . . . . . . . . . . . . . . 66
SYMNAMES DD and SYMNOUT DD Statements . . . . . . . . . . 67
SORTIN DD Statement . . . . . . . . . . . . . . . . . . . . 67
SORTINnn DD Statement . . . . . . . . . . . . . . . . . . . 68
SORTWKdd DD Statement . . . . . . . . . . . . . . . . . . 70
SORTOUT and OUTFIL DD Statements. . . . . . . . . . . . . . 72
SORTCKPT DD Statement . . . . . . . . . . . . . . . . . . 74
SORTCNTL DD Statement . . . . . . . . . . . . . . . . . . 74
DFSPARM DD Statement . . . . . . . . . . . . . . . . . . . 75
SORTDKdd DD Statement . . . . . . . . . . . . . . . . . . 77
SORTDIAG DD Statement . . . . . . . . . . . . . . . . . . 77
SORTSNAP DD Statement . . . . . . . . . . . . . . . . . . 78

Using the JCL


Your operating system uses the job control language (JCL) you supply with your
DFSORT program control statements to:
v Identify you as an authorized user
v Allocate the necessary resources to run your job
v Run your job
v Return information to you about the results
v Terminate your job.

Unless you create your jobs with the interactive DFSORT Panels facility (see
DFSORT Panels Guide), you must supply JCL statements with every DFSORT job
you submit.

Required JCL includes a JOB statement, an EXEC statement, and several DD


statements. The statements you need and their exact form depend upon whether
you:
v Use an EXEC statement in the input job stream or a system macro instruction
within another program to invoke DFSORT
v Use EXEC statement cataloged procedures to invoke DFSORT
v Specify various DFSORT control statements or PARM options
v Want to use program exits to activate routines of your own
v Use dynamic link-editing
v Want to see diagnostic messages.

Copyright IBM Corp. 1973, 2004 25


Using the JCL

DFSORT Panels offers an alternative to coding JCL directly. When you use panels
to prepare a job to be run or saved in a data set, much of the required JCL can be
supplied automatically from the contents of the DFSORT User Profile. DFSORT
jobs you prepare for submission in foreground under TSO use CLIST processing
rather than JCL. See DFSORT Panels Guide for details on using DFSORT Panels.

The JCL statements and their functions are listed below. Details on coding the
individual statements are presented in subsequent sections.
JCL Statement Description
//JOBLIB DD Defines your program link library if it is not already
known to the system
//STEPLIB DD Same as //JOBLIB DD
//SORTLIB DD Defines the data set that contains special load
modules if it is not already known to the system
//SYSOUT DD1 Defines the message data set
//SYMNAMES DD Defines the SYMNAMES data set containing
statements to be used for symbol processing
//SYMNOUT DD Defines the data set in which SYMNAMES
statements and the symbol table are to be listed
//SORTIN DD1 Defines the input data set for a sort or copy
//SORTINnn DD1 Defines the input data sets for a merge
1
//SORTOUT DD Defines the SORTOUT output data set for a sort,
merge, or copy
//outfil DD Defines an OUTFIL output data set for a sort,
merge, or copy
//SORTWKdd DD1 Defines intermediate storage data sets for a sort
//DFSPARM DD1 Contains DFSORT PARM options and program
control statements
//SYSIN DD Contains DFSORT program control statements
//SORTCNTL DD1 Same as //SYSIN DD
//SORTDIAG DD Specifies that all messages and program control
statements be printed
//SORTCKPT DD Defines the data set for checkpoint records
//SYSUDUMP DD Defines the data set for output from a system
ABEND dump routine
//SYSMDUMP DD Same as //SYSUDUMP DD
//SYSABEND DD Same as //SYSUDUMP DD
//SORTSNAP DD Defines the snap dump data set dynamically
allocated by DFSORT
//ddname Defines the data set containing exit routines (as
specified in the MODS program control statement).

The following DD statements are only necessary for dynamic link-editing of exit
routines

26 z/OS V1R5.0 DFSORT Application Programming Guide


Using the JCL

//SYSPRINT DD
Defines the message data set for the linkage editor
//SYSUT1 DD
Defines the intermediate storage data set for the linkage editor
//SYSLIN DD
Defines the data set for control information for the linkage editor
//SYSLMOD DD
Defines the data set for output from the linkage editor
//SORTMODS DD
Defines the temporary partitioned data set for user exit routines from
SYSIN.
1
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 625.

Using the JOB Statement


The JOB statement is the first JCL statement of your job. It must contain a valid job
name in the name field and the word JOB in the operation field. All parameters in
the operand field are optional, although your site may have made information such
as account number and the name of the programmer mandatory:
//jobname JOB accounting information, programmers name, etc.

Using the EXEC Statement


The EXEC statement is the first JCL statement of each job step or of each
procedure step in a cataloged procedure. It identifies DFSORT to the operating
system. You can also specify DFSORT options on the EXEC statement.

The format of the EXEC statement is:

//stepname EXEC PGM= SORT


ICEMAN ,
PROC= SORT
SORTD , PARM = options
SORT
SORTD

, 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.

Chapter 2. Invoking DFSORT with Job Control Language 27


Using The EXEC Statement

Specifying EXEC Statement Cataloged Procedures


A cataloged procedure is a set of JCL statements, including DD statements, that
has been assigned a name and placed in a partitioned data set called the
procedure library. Two cataloged procedures are supplied with the program: SORT
and SORTD. Specify them in the first parameter of the EXEC statement by
PROC=SORT, PROC=SORTD, or simply SORT or SORTD.

SORT Cataloged Procedure


You can use the supplied SORT cataloged procedure when you include user
routines that require link-editing. Using this procedure without using link-edited user
routines is inefficient because the SORT cataloged procedure allocates linkage
editor data sets whether or not you include user routines.

When you specify EXEC PROC=SORT or EXEC SORT, the following JCL
statements are generated:

//SORT EXEC PGM=ICEMAN 00


//STEPLIB DD DSNAME=yyy,DISP=SHR 10
//SORTLIB DD DSNAME=xxx,DISP=SHR 20
//SYSOUT DD SYSOUT=A 30
//SYSPRINT DD DUMMY 40
//SYSLMOD DD DSNAME=&GOSET,UNIT=SYSDA,SPACE=(3600,(20,20,1)) 50
//SYSLIN DD DSNAME=&LOADSET,UNIT=SYSDA,SPACE=(80,(10,10)) 60
//SYSUT1 DD DSNAME=&SYSUT1,SPACE=(1024,(60,20)), 70
// UNIT=(SYSDA,SEP=(SORTLIB,SYSLMOD,SYSLIN)) 80

Line Explanation
00 The stepname of the procedure is SORT. This EXEC statement initiates the
program, which is named ICEMAN.
10 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.
20 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 ICEMAC
SORTLIB=SYSTEM is used, the SORTLIB DD statement is unnecessary
and is ignored unless dynamic link of user exits is used.
30 Defines an output data set for system use (messages). It is directed to
system output class A.
40 Defines SYSPRINT as a dummy data set because linkage editor diagnostic
output is not required.
50 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

28 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

exhausted. The last value is space for a directory, which is required


because SYSLMOD is a new partitioned data set.
60 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.
70/80 The SYSUT1 DD statement defines a work data set for the linkage editor.

SORTD Cataloged Procedure


You can use the supplied SORTD cataloged procedure when you do not include
user routines or when you include user routines that do not require link-editing.

When you specify EXEC PROC=SORTD or EXEC SORTD, the following JCL
statements are generated:

//SORT EXEC PGM=ICEMAN 00


//STEPLIB DD DSNAME=yyy,DISP=SHR 10
//SORTLIB DD DSNAME=xxx,DISP=SHR 20
//SYSOUT DD SYSOUT=A 30

Line Explanation
00 The stepname of the SORTD procedure is SORT
10 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.
20 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 ICEMAC
SORTLIB=SYSTEM is used, then the SORTLIB DD statement is
unnecessary and is ignored unless dynamic link edit of user exits is used.
30 Directs messages to system output class A

Specifying EXEC/DFSPARM PARM Options


When you invoke DFSORT with JCL, you can specify some DFSORT options on
the PARM parameter of the EXEC statement as illustrated on the following page.
These options include EFS, LIST, NOLIST, LISTX, NOLISTX, MSGPRT, and
MSGDDN, which are ignored if specified in an OPTION statement in SYSIN. Full
override and applicability details are listed in Appendix B, Specification/Override of
DFSORT Options, on page 625.

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 75.

Chapter 2. Invoking DFSORT with Job Control Language 29


Using The EXEC Statement

Details of aliases for PARM options are given under the description of individual
options. Aliases for PARM Options on page 59 summarizes the available aliases.

DFSORT accepts but does not process the following EXEC/DFSPARM PARM
options: BALANCE, BALN, BIAS=value, BMSG, CASCADE, CMP=value, CPU,
CRCX, DEBUG, DIAG, ELAP, EXCPVR=value, IO, INCOR=value, INCORE=value,
LRGSORT, L6=value, L7=value, NOCOMMAREA, NOINC, NOIOERR, OPT=value,
OSCL, PEER, POLY, and PRINT121.

Note: If DEBUG is specified as the first value in a DFSPARM statement, it will be


interpreted as a DEBUG control statement rather than as a DFSPARM
PARM option.

30 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

| ,

 ,PARM= E ABEND 
NOABEND
ARESALL= n
nK
nM
AVGRLEN=n
BSAM
CINV
NOCINV
COBEXIT= COB1
COB2
DSPSIZE= MAX
n
DYNALLOC
= d
(d)
(,n)
(d,n)
OFF
(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
OVFLO= RC0
RC4
RC16

Figure 3. Syntax Diagram for EXEC PARM


Chapter(Part
1 of 3)DFSORT with Job Control Language
2. Invoking 31
Using The EXEC Statement

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
STIMER
NOSTIMER
STOPAFT=n
SZERO
NOSZERO
TRUNC= RC0
RC4
RC16
VERIFY
NOVERIFY
VLLONG
NOVLLONG
VLSCMP
NOVLSCMP
VLSHRT
NOVLSHRT
VSAMEMT
NOVSAMENT
VSAMIO
NOVSAMIO

Figure 3. Syntax Diagram for EXEC PARM (Part 2 of 3)

32 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

WRKREL
NOWRKREL
WRKSEC
NOWRKSEC
Y2PAST= s
f
ZDPRINT
NZDPRINT

Figure 3. Syntax Diagram for EXEC PARM (Part 3 of 3)

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 the ICEMAC 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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options
ARESALL

 ARESALL= n 
nK
nM

Temporarily overrides the ARESALL installation option, which specifies the


number of bytes to be reserved above 16MB virtual for system use. For more
information, see the discussion of the ARESALL option in OPTION Control
Statement on page 142.
n specifies that n bytes of storage are to be reserved.
Limit: 8 digits.

Chapter 2. Invoking DFSORT with Job Control Language 33


Using The EXEC Statement

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.

Note: RESERVEX=value can be used instead of ARESALL=value.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
AVGRLEN

 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 142.
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 625 for full override
details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.

| Attention: This option can degrade performance.

Default: None; optional. See Appendix B, Specification/Override of DFSORT


Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

34 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

CINV or NOCINV

 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 142.
CINV
directs DFSORT to use control interval access when possible for VSAM
data sets.
NOCINV
directs DFSORT not to use control interval access.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.

| Note: The DFSORT documents only discuss the Language Environment


| run-time library, and assume that COBEXIT=COB2 is in effect. Although
| it is possible to run with older run-time libraries, and with
| COBEXIT=COB1, these are not recommended or discussed, and are not
| supported by IBM service.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

Chapter 2. Invoking DFSORT with Job Control Language 35


Using The EXEC Statement

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 142.
MAX
specifies that DFSORT dynamically determines the maximum amount of
data space that will 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.
n 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.
If n is zero, dataspace sorting is not used.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
DYNALLOC

 DYNALLOC 
= d
(d)
(,n)
(d,n)

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 142 and Appendix A, Using Work Space, on page
615
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 3390-9 device (such as a
RAMAC) or another high-speed IBM disk device, and avoid specifying a
tape, virtual (VIO) or real 3390-9 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

36 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
DYNALLOC=OFF

 DYNALLOC 
= (OFF)
OFF

Directs DFSORT not to allocate intermediate workspace dynamically. It


overrides the ICEMAC installation option DYNAUTO=YES or the DYNALLOC
parameter (without OFF) specified at run-time. For more information, see the
discussion of the DYNALLOC option in OPTION Control Statement on page
142.
OFF
directs DFSORT not to allocate intermediate workspace dynamically.

Default: None; optional. See Appendix B, Specification/Override of DFSORT


Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
DYNSPC

 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 142.
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 625 for full override details.

Chapter 2. Invoking DFSORT with Job Control Language 37


Using The EXEC Statement

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 531 for more information on EFS.
name
specifies the name of the EFS program that will be called to interface with
DFSORT.
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
may eliminate the need for an EFS program. See OPTION Control
Statement on page 142 for information related to locale processing.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
EQUALS or NOEQUALS

 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 142.
EQUALS
specifies that the original sequence must be preserved.
NOEQUALS
specifies that the original sequence need not be preserved.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
E15=COB

 E15=COB 

38 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.

Default: None; optional. See Appendix B, Specification/Override of DFSORT


Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
FILSZ

 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 566 and Allocation of Work Data Sets on
page 617 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

Chapter 2. Invoking DFSORT with Job Control Language 39


Using The EXEC Statement

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 the FSZEST=NO installation option 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
the FSZEST=YES installation option 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.
FILSZ=0 causes Hipersorting, dataspace sorting, and dynamic allocation of
work space not to be used, and results in termination with the message
ICE047A unless the number of records sorted or merged is 0.
Limit: 28 digits (15 significant digits)
Ex
specifies an estimated number of records to be sorted. This value is not
used for the record check. It is used for file size calculations, but only if
DFSORT could not automatically compute the file size. In all other cases,
this value is ignored by DFSORT. See Dynamic Allocation of Work Data
Sets on page 618 for details on exactly when FILSZ=Ex is used or ignored
by DFSORT.
The specified value (x) should take into account the number of records in
the input data sets, records to be inserted or deleted by exit E15, and
records to be deleted by the INCLUDE/OMIT statement, SKIPREC, and
STOPAFT. x should be changed whenever the number of records to be
sorted changes significantly.
FILSZ=E0 will always be ignored.
Limit: 28 digits (15 significant digits)
Ux
specifies the number of records to be sorted. This value is not used for the
record check, but is always used for file size calculations. FILSZ=Ux can be
used to force DFSORT to perform file size calculations based on x, while
avoiding termination if x is not exact.
The FSZEST installation option has no effect on FILSZ=Ux processing.
The specified value (x) should take into account the number of records in
the input data sets, records to be inserted or deleted by exit E15, and
records to be deleted by the INCLUDE/OMIT statement, SKIPREC, and
STOPAFT. x should be changed whenever the number of records to be
sorted changes significantly.
FILSZ=U0 causes Hipersorting, dataspace sorting, and dynamic allocation
of work space not to be used, and can cause degraded performance or
termination with the message ICE046A, if the actual number of records to
be sorted is significantly larger than 0.
Limit: 28 digits (15 significant digits)

40 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

Table 5 summarizes the differences for the three FILSZ variations:


Table 5. FILSZ Variations Summary.

FILSZ=n is equivalent to FILSZ=En if installation option FSZEST=YES is specified.


FILSZ=n FILSZ=Un FILSZ=En
Number of records Exact Estimate Estimate
Applications Sort, merge Sort Sort
Terminate if wrong? Yes No No
Use for file size calculation? Yes Yes When DFSORT
cannot compute
file size
n includes records:
In input data set(s) Yes Yes Yes
Inserted/deleted by E15 Yes Yes Yes
Inserted by E32 Yes No No
Deleted by INCLUDE/OMIT Yes Yes Yes
statement
Deleted by SKIPREC Yes Yes Yes
Deleted by STOPAFT Yes Yes Yes

Update n when number of records In any way Significantly Significantly


changes:
Effects of n=0 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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 142.

Chapter 2. Invoking DFSORT with Job Control Language 41


Using The EXEC Statement

OPTIMAL
specifies that DFSORT determines dynamically the maximum amount of
Hiperspace to be used for Hipersorting.
n 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.
p%
specifies that DFSORT determines dynamically the maximum amount of
hiperspace to be used for Hipersorting, subject to a limit of p percent of the
configured expanded storage. In 64-bit real mode, HIPRMAX=p% specifies
a percentage of an appropriate portion of central storage. p must be a value
between 0 and 100. If p is 0, Hipersorting is not used. The value calculated
for p% is limited to 32767MB, and is rounded down to the nearest MB.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
LIST or NOLIST

 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
specifies that all DFSORT control statements are printed on the message
data set.
NOLIST
specifies that DFSORT control statements are not printed.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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
specifies that control statements returned by an EFS program are printed to
the message data set.

42 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

NOLISTX
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.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
LOCALE

 LOCALE= name 
CURRENT
NONE

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 142.
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.
NONE 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.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

Chapter 2. Invoking DFSORT with Job Control Language 43


Using The EXEC Statement

| MOSIZE

|  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. For
| more information, see the discussion of the MOSIZE option in OPTION Control
| Statement on page 142.
| MAX
| specifies that DFSORT determines dynamically the maximum size of a
| memory object to be used for memory object sorting.
| n specifies that DFSORT determines dynamically the maximum size of a
| memory object to be used for memory object sorting, subject to a limit of
| nMB. n must be a value between 0 and 2147483646. If n is 0, memory
| object sorting is not used.
| p%
| specifies that DFSORT determines dynamically the maximum size of a
| memory object to be used for memory object sorting, subject to a limit of p
| percent of the available central storage. p must be a value between 0 and
| 100. If p is 0, memory object sorting is not used. The value calculated for
| p% is limited to 2147483646MB, and is rounded down to the nearest MB.

| Default: Usually the installation default. See Appendix B, Specification/Override


| of DFSORT Options, on page 625 for full override details.

| Applicable Functions: See Appendix B, Specification/Override of DFSORT


| Options, on page 625.
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
142.

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

44 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

MSGPRT

 MSGPRT= ALL 
CRITICAL
NONE

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 MSGPRT MSGCON


NO NONE NONE
NOF NONE NONE
AB ALL ALL
AP ALL CRITICAL
AC NONE ALL
CB CRITICAL CRITICAL
CC NONE CRITICAL
CP CRITICAL CRITICAL
PC ALL ALL
SC ALL CRITICAL
SP CRITICAL ALL
NOFLAG NONE CRITICAL
FLAG(I) ALL CRITICAL
FLAG(U) CRITICAL CRITICAL

Figure 4. Aliases for MSGPRT/MSGCON Options

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

Chapter 2. Invoking DFSORT with Job Control Language 45


Using The EXEC Statement

| NULLOUT

|  NULLOUT= RC0 
RC4
RC16
|
|
| 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 142.
| 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.

| Default: Usually the installation default. See Appendix B, Specification/Override


| of DFSORT Options, on page 625 for full override details.

| Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 142.
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.

46 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

Limit: 2 digits

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
OUTREL or NOOUTREL

 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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
OVFLO

 OVFLO= RC0 
RC4
RC16

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 142.
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.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

Chapter 2. Invoking DFSORT with Job Control Language 47


Using The EXEC Statement

PAD

 PAD= RC0 
RC4
RC16

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 142.
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 142.
n specifies that n bytes of storage are to be reserved. If you specify less than
4096, 4096 is used.
Limit: 8 digits.
nK
specifies that n times 1024 bytes of storage are to be reserved. If you
specify less than 4K, 4K is used.
Limit: 5 digits.
nM
specifies that n times 1048576 bytes of storage are to be reserved. If you
specify 0M, 4K is used.
Limit: 2 digits.

48 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

Note: RESERVE=value can be used instead of RESALL=value.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
RESET or NORESET

 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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
SDB

 SDB= LARGE 
YES
INPUT
NO

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. For more
information, see the discussion of the SDB option in OPTION Control
Statement on page 142.
LARGE
specifies that DFSORT is to use the system-determined optimum block size
for an output data set when its block size is zero. SDB=LARGE allows
DFSORT to select a block size greater than 32760 bytes for a tape output
data set, when appropriate.
YES
specifies that DFSORT is to use the system-determined optimum block size
for an output data set when its block size is zero, but is to limit the selected
block size to a maximum of 32760 bytes.

Chapter 2. Invoking DFSORT with Job Control Language 49


Using The EXEC Statement

INPUT
specifies that DFSORT is to use the system-determined optimum block size
for an output data set when its block size is zero, but is to limit the selected
block size to a maximum of 32760 bytes if the input block size is less than
or equal to 32760 bytes.
NO
specifies that DFSORT is not to use the system-determined optimum block
size.

Note: SDB, SDB=ON, and SDB=SMALL can be used instead of SDB=YES.


NOSDB and SDB=OFF can be used instead of SDB=NO.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
SIZE

 SIZE= n 
nK
nM
MAX
MAX-m
MAX-mK
MAX-mM

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 142.
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.
Limit: 7 digits.
nM
specifies that n times 1048576 bytes of storage are to be allocated. If you
specify more than 2000M, 2000M is used.
Limit: 4 digits.
MAX
instructs DFSORT to calculate the amount of main storage available and
allocates this maximum amount, up to the TMAXLIM or MAXLIM installation
value, as appropriate for the application.
If you specify less than 4K, 4K is used.
MAX-m
specifies the RESALL value (m) in bytes. MAX-m instructs DFSORT to

50 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

calculate the amount of storage available and allocate this amount up to the
MAX value minus the amount of storage reserved for system and
application use (RESALL).
If you specify less than 4096 for m, 4096 is used.
Limit for m: 8 digits.
MAX-mK
specifies the RESALL value (m times 1024) in KBs. MAX-mK instructs
DFSORT to calculate the amount of storage available and allocate this
amount up to the MAX value minus the amount of storage reserved for
system and application use (RESALL).
If you specify less than 4K for m, 4K is used.
Limit for m: 5 digits.
MAX-mM
specifies the RESALL value (m times 1048576) in s. MAX-mM instructs the
program to calculate the amount of storage available and allocate this
amount up to the MAX value minus the amount of storage reserved for
system and application use (RESALL).
If you specify 0M for m, 4K is used.
Limit for m: 2 digits.

Note: The forms SIZE(value), CORE=value, and CORE(value) can be used


instead of SIZE=value.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
SKIPREC

 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 not
processed from the previous DFSORT job. For more information, see the
discussion of the SKIPREC option in OPTION Control Statement on page 142.
z specifies the number of records to be skipped.
Limit: 28 digits (15 significant digits).

Default: None; optional. See Appendix B, Specification/Override of DFSORT


Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
SOLRF or NOSOLRF

 SOLRF 
NOSOLRF

Chapter 2. Invoking DFSORT with Job Control Language 51


Using The EXEC Statement

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 142.
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
SPANINC

 SPANINC= RC0 
RC4
RC16

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 142.
RC0
specifies that DFSORT should issue message ICE197I (once), set a return
code of 0 and eliminate all incomplete spanned records it detects.
RC4
specifies that DFSORT should issue message ICE197I (once), set a return
code of 4 and eliminate all incomplete spanned records it detects.
RC16
specifies that DFSORT should issue message ICE204A, terminate and give
a return code of 16 when an incomplete spanned record is detected.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625
STIMER or NOSTIMER

 STIMER 
NOSTIMER

Temporarily overrides the STIMER installation option, which specifies whether


DFSORT can use the STIMER macro.

52 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

STIMER
specifies that STIMER can be used. Processor-time data appears in SMF
records and ICETEXIT statistics.
NOSTIMER
specifies that STIMER cannot be used. Processor-time data does not
appear in SMF records or ICETEXIT statistics.

Note: If a user exit takes checkpoints, then STIMER must not be issued.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
STOPAFT

 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
142.
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 FSZEST=YES was specified at
installation time.

Default: None; optional. See Appendix B, Specification/Override of DFSORT


Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 142.
SZERO
specifies that DFSORT should treat numeric zero values as signed.
NOSZERO
specifies that DFSORT should treat numeric zero values as unsigned.

Chapter 2. Invoking DFSORT with Job Control Language 53


Using The EXEC Statement

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
TRUNC

 TRUNC= RC0 
RC4
RC16

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 142.
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 625.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.
NOVERIFY
specifies that sequence checking is not performed.
Notes:
1. Using VERIFY can degrade performance.
2. SEQ=YES can be used instead of VERIFY. SEQ=NO can be used instead
of NOVERIFY.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

54 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
VLLONG or NOVLLONG

 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 142.
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 142.
VLSCMP
specifies that short variable-length compare fields are padded with binary
zeros.
NOVLSCMP
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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. For

Chapter 2. Invoking DFSORT with Job Control Language 55


Using The EXEC Statement

more information, see the discussion of the VLSHRT and NOVLSHRT options
in OPTION Control Statement on page 142.
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625
VSAMIO or NOVSAMIO

 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.

56 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

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 625.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.
Notes:
1. If you have dedicated certain volumes for SORTWKdd data sets, and you
do not want unused temporary space to be released, you should specify
NOWRKREL.
2. If WRKREL is in effect, DFSORT releases space for the SORTWKdd data
sets just prior to termination. Space is released only for those SORTWKdd
data sets that were used for the sort application.
3. RELEASE=OFF and RLS=0 can be used instead of NOWRKREL.
RELEASE=ON and RLS=n (n greater than 0) can be used instead of
WRKREL.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
WRKSEC or NOWRKSEC

 WRKSEC 
NOWRKSEC

Temporarily overrides the WRKSEC installation option, which specifies whether


DFSORT uses automatic secondary allocation for temporary JCL SORTWKdd
data sets.

Chapter 2. Invoking DFSORT with Job Control Language 57


Using The EXEC Statement

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
Y2PAST

 Y2PAST= s 
f

Temporarily overrides the Y2PAST installation option, which specifies the sliding
(s) or fixed (f) century window. The century window is used with DFSORTs Y2
formats to correctly interpret two-digit year data values as four-digit year data
values.
s specifies the number of years DFSORT is to subtract from the current year
to set the beginning of the sliding century window. Since the Y2PAST value
is subtracted from the current year, the century window slides as the current
year changes. For example, Y2PAST=81 would set a century window of
1915-2014 in 1996 and 1916-2015 in 1997. s must be a value between 0
and 100.
f specifies the beginning of the fixed century window. For example,
Y2PAST=1962 would set a century window of 1962-2061. f must be a value
between 1000 and 3000.

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 142.

58 z/OS V1R5.0 DFSORT Application Programming Guide


Using The EXEC Statement

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

Aliases for PARM Options


For compatibility reasons, the following EXEC/DFSPARM PARM options can be
specified by using the aliases listed below. See the indicated PARM options for
complete details.
Table 6. Aliases for PARM Options
Alias PARM Option
CENTWIN=value Y2PAST=value
CORE=value SIZE=value
FLAG(I) MSGPRT=ALL
FLAG(U) MSGPRT=CRITICAL
L5=value AVGRLEN=value
MSG=value MSGPRT=value
MSGDD=value MSGDDN=value
NOFLAG MSGPRT=NONE
NORC16 NOABEND
NORLSOUT NOOUTREL
NOSDB SDB=NO
RC16=ABE ABEND
RELEASE=ON WRKREL
RELEASE=OFF NOWRKREL
RESERVE=value RESALL=value
RESERVEX=value ARESALL=value
RLS=n WRKREL
RLS=0 NOWRKREL
RLSOUT OUTREL
SDB SDB=YES
SDB=ON SDB=YES
SDB=OFF SDB=NO
SDB=SMALL SDB=YES
SEC=n WRKSEC
SEC=0 NOWRKSEC

Chapter 2. Invoking DFSORT with Job Control Language 59


Aliases for PARM Options

Table 6. Aliases for PARM Options (continued)


Alias PARM Option
SECOND=ON WRKSEC
SECOND=OFF NOWRKSEC
SEQ=YES VERIFY
SEQ=NO NOVERIFY
VSAMEMT=YES VSAMEMT
VSAMEMT=NO NVSAMEMT
ZDPRINT=YES ZDPRINT
ZDPRINT=NO NZDPRINT

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
63)
v Program DD statements (discussed in detail in Program DD Statements on
page 65).
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 7. The subparameters of the DCB
parameter (a DD statement parameter) are described similarly in Table 8 on page
61.
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 12.
2. When using DFSORT applications, FREE=CLOSE cannot be used on any DD
statements except DFSPARM.
Table 7. DD Statement Parameters Used by DFSORT
Parameter When Required Parameter Values Default Value
{AMP| BUFSP} When password-protected Minimum buffer pool value None.
VSAM data sets are used given when creating the
and the password is data set.
supplied through E18, E38,
or E39.
DCB Required when 7-track tape Specifies information used (See separate
is used; for input on tape to fill the data control block subparameters in Table 8
without standard labels; and (DCB) associated with the on page 61.)
when the default values are data set.
not applicable.
DISP When the default value is Indicates the status and The system assumes
not applicable. disposition of the data set. (NEW, DELETE).

60 z/OS V1R5.0 DFSORT Application Programming Guide


Using DD Statements

Table 7. DD Statement Parameters Used by DFSORT (continued)


Parameter When Required Parameter Values Default Value
DSNAME or DSN When the DD statement Specifies the fully qualified The system assigns a
defines a labeled input data or temporary name of the unique name.
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.
LABEL When the default value is Specifies information about The system assumes
not applicable. labeling and retention for standard labeling.
the data set.
SPACE When the DD statement Specifies the amount of None.
defines a new data set on space needed to contain
disk. the data set.
UNIT When the input data set is Specifies (symbolically or None.
neither cataloged nor actually) the type and
passed or when the data quantity of I/O units
set is being created. required by the data set.
VOLUME or VOL When the input data set is Specifies information used None.
neither cataloged nor to identify the volume or
passed, for multireel input volumes occupied by the
or when the output data set data set.
is on disk and is to be kept
or cataloged.

Table 8. DCB Subparameters Used by DFSORT


Subparameter Condition When Required Subparameter Values Default Value
BUFOFF When processing data in Specifies the length of the
ISCII/ASCII format. buffer offset or specifies
that the buffer offset is the
block length indicator.
DEN When the data set is Specifies the density at 800 bpi
located on a 7-track tape which the tape was
unit. recorded.
OPTCD When processing data in Specifies that the tape
ISCII/ASCII format. processed is in ISCII/ASCII
format.
TRTCH When the data set is Specifies whether data set System default option.
located on a tape device is compacted.
with IDRC and system
IDRC is not used.

Chapter 2. Invoking DFSORT with Job Control Language 61


Using DD Statements

Table 8. DCB Subparameters Used by DFSORT (continued)


Subparameter Condition When Required Subparameter Values Default Value
BLKSIZE 1, 2
When the DCB parameter Specifies the maximum v For old data sets, the
is required and the default length (in bytes) of the value in the data set
value is not suitable except physical records in the data label.
on SORTWKdd statements. set. v For new output data sets,
appropriate values based
on the input data set or
RECORD statement
values.

LRECL 2, 3 Specifies the maximum Unless SDB=NO is in


length (in bytes) of the effect, Blockset uses the
logical records in the data system-determined
set. optimum block size when
the output data set block
size is zero.
Applications which
require a specific output
data set block size
RECFM Specifies the format of the should be changed to
records in the data set. specify that block size
EXPLICITY.
v No default if input on
unlabeled tape or BLP or
NSL specified.

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 262.

Shared Tape Units


The following pairs of DFSORT data sets can be assigned to a single tape unit:
v The SORTIN data set and the SORTWK01 data set (tape work data set sorts
only)
v The SORTIN data set and the SORTOUT data set or one OUTFIL data set (sort
applications only).

1. See SORTIN DD Statement on page 67 and SORTINnn DD Statement on page 68.


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 12.

62 z/OS V1R5.0 DFSORT Application Programming Guide


Using DD Statements

If you want to associate the SORTIN data set with SORTWK01, you can include the
parameter UNIT=AFF=SORTIN in the DD statement for SORTWK01. The AFF
subparameter causes the system to place the data set on the same unit as the
dataset with the ddname following the subparameter (SORTIN, in this case).

In the same way, you can associate the SORTIN data set with the SORTOUT data
set or an OUTFIL data set by including UNIT=AFF=SORTIN in the SORTOUT or
OUTFIL DD statement.

SORTINnn tape data sets must all be on different tape units because they are read
concurrently. SORTOUT and OUTFIL tape data sets must all be on different tape
units because they are written concurrently.

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
Defines your program link library if it is not already known to the system.
//STEPLIB DD
Same as //JOBLIB DD.
//SYSIN 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.
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.

Chapter 2. Invoking DFSORT with Job Control Language 63


Using DD Statements

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 75.

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. 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
Defines the data set for output from a system ABEND dump routine.
//SYSMDUMP DD
Same as //SYSUDUMP DD.
//SYSABEND 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
Contains messages from the linkage editor.
//SYSUT1 DD
Defines the intermediate storage data set for the linkage editor.

64 z/OS V1R5.0 DFSORT Application Programming Guide


Using DD Statements

//SYSLIN DD
Defines a data set for control information for the linkage editor.
//SYSLMOD DD
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
Defines the data set that contains special load modules for DFSORT. Can
usually be omitted.
//SYMNAMES DD
Defines the SYMNAMES data set containing statements to be used for
symbol processing. Required only if symbol processing is to be performed.
//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.
//SORTIN DD
Defines the input data set for a sorting or copying application. Will not be
used for a merging application.
//SORTINnn DD
Defines the input data sets for a merging application. Will not be used for a
sorting or copying application.
//SORTWKdd DD
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.
//SORTOUT DD
Defines the SORTOUT output data set for a sorting, merging, or copying
application.
//outfil DD
Defines an OUTFIL output data set for a sorting, merging, or copying
application.
//SORTCKPT DD
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.
//SORTCNTL DD
Defines the data set from which additional or changed DFSORT control
statements can be read when DFSORT is program-invoked.
//DFSPARM DD
Defines the data set from which both additional or changed DFSORT

Chapter 2. Invoking DFSORT with Job Control Language 65


Using DD Statements

program control statements and EXEC statement PARM options can be


read when DFSORT is directly invoked or program invoked.
//SORTDKdd DD
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.
//SORTDIAG DD
Specifies that all messages and control statements are printed. Used
primarily for diagnostics and debugging.
//SORTSNAP DD
Defines the snap dump data set dynamically allocated by DFSORT.
SORTSNAP must never be specified in the job stream.
//SORTMODS DD
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.
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 ICEMAC 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 ICEMAC SORTLIB 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.
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.

66 z/OS V1R5.0 DFSORT Application Programming Guide


Using DD Statements

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 7 on page 60. The subparameters of the DCB
parameter are described in the same detail in Table 8 on page 61. For more
detailed information, see z/OS MVS JCL Reference and z/OS MVS JCL Users
Guide

SYMNAMES DD and SYMNOUT DD Statements


See Chapter 7, Using Symbols for Fields and Constants, on page 507 for details.

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 DCB
parameters). 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.

See Data Set Considerations on page 11 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, but the first data set must have the
largest LRECL.
v If the data sets are on unlike devices, you cannot use the EXLST parameter at
user exit E18.

Chapter 2. Invoking DFSORT with Job Control Language 67


Using DD Statements

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:


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.

Example 3 Volume Parameter on SORTIN DD:

//SORTIN DD DSN=SORTIN,DISP=(OLD,KEEP),UNIT=3490,
// VOL=SER=(75836,79661,72945)

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.

68 z/OS V1R5.0 DFSORT Application Programming Guide


Using DD Statements

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 DCB parameters). 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.

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.

See Data Set Notes and Limitations on page 12 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.

Chapter 2. Invoking DFSORT with Job Control Language 69


Using DD Statements

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)

Example 5 SORTIN01-02 DD Statements (Merge):

//SORTIN01 DD DSNAME=INPUT1,VOLUME=SER=000101, *
// UNIT=3390,DISP=OLD *DCB PARAMETERS
//SORTIN02 DD DSNAME=INPUT2,VOLUME=SER=000201, *SUPPLIED FROM
// UNIT=3390,DISP=OLD *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 Hipersorting, dataspace sorting, or memory object sorting is used.

For information on using work data sets, see Appendix A, Using Work Space, on
page 615.

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.

70 z/OS V1R5.0 DFSORT Application Programming Guide


Using DD Statements

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.
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, pipe, and HFS data sets, and HFS files, must not be specified as
work data sets.
v Parameters relating to ISCII/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. If more work data sets
are defined, they are used with only the primary allocation. (Secondary allocation
is limited to 12 work data sets in the Peerage and Vale sorting techniques only.)
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 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.

The following is an example of a SORTWKdd DD statement using a disk work data


set:

Chapter 2. Invoking DFSORT with Job Control Language 71


Using DD Statements

Example 6 SORTWK01 DD Statement, Disk Work Data Set:

//SORTWK01 DD SPACE=(CYL,(15,5)),UNIT=3390

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 DD UNIT=3480,LABEL=(,NL)
//SORTWK02 DD UNIT=3480,LABEL=(,NL)
//SORTWK03 DD 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.

SORTOUT and OUTFIL DD Statements


The SORTOUT and OUTFIL DD statements describe the characteristics of the data
sets in which the processed records are to be placed and indicate their location.

The SORTOUT DD statement specifies the single non-OUTFIL output data set for a
sort, copy, or merge application. OUTFIL processing does not apply to SORTOUT.

The FNAMES and/or FILES parameters of one or more OUTFIL statements specify
the ddnames of the OUTFIL data sets for a sort, copy, or merge application. The
parameters specified for each OUTFIL statement define the OUTFIL processing to
be performed for the OUTFIL data sets associated with that statement. For specific
information about OUTFIL processing, see OUTFIL Control Statements on page
194.

Although the ddname SORTOUT can actually be used for an OUTFIL data set, the
term SORTOUT will be used to denote the single non-OUTFIL output data set.

When Required: Each ddname specified in an OUTFIL statement requires a


corresponding DD statement for that OUTFIL data set.

If you do not specify OUTFIL statements, a SORTOUT DD statement is required


unless you provide an E35 user exit that disposes of all output. A SORTOUT DD
statement is ignored if your program invokes DFSORT and passes the address of
an E35 user exit in the parameter list.

72 z/OS V1R5.0 DFSORT Application Programming Guide


SORTOUT and OUTFIL DD Statements

If you specify OUTFIL statements, you do not have to specify a SORTOUT DD


statement or an E35 user exit, although you can use either or both.

Data Set Characteristics: See Data Set Considerations on page 11 for


additional considerations.

Block size: Unless SDB=NO is in effect, Blockset uses the system-determined


optimum block size in most cases when the output data set block size is zero. See
the discussion of the SDB option in OPTION Control Statement on page 142 for
complete details about DFSORTs use of system-determined block size.

For some jobs, the selection of a larger output data set block size can require an
increase in the amount of storage needed for successful DFSORT processing.

Applications which require a specific output data set block size should be changed
to specify that block size explicitly.

If SDB=NO is in effect, DFSORT selects an appropriate (though not necessarily


optimum) block size for the output data set based on the available attributes from
the output data set, the input data set, and the RECORD statement. The output
data set block size will not necessarily be the same as the input block size.

Reblockable Indicator: DFSORT sets the reblockable indicator in the output data
set label when:

Blockset is selected and


v DFSORT sets the system-determined optimum block size for the output data set
(see Block size) or
v Allocation sets the system-determined optimum block size for the output data set
before DFSORT gets control.

General Coding Notes:


v For a copy application, neither the SORTOUT data set nor any OUTFIL data set
should be the same as the SORTIN data set because this can cause lost or
incorrect data or unpredictable results.
v For a merge application, neither the SORTOUT data set nor any OUTFIL data
set should be the same as any SORTINnn data set because this can cause lost
or incorrect data or unpredictable results.
v For a sort application, the SORTOUT data set or an OUTFIL data set can be the
same as the SORTIN data set, but this situation can lead to the loss of the data
set if the sort application does not end successfully.
v An OUTFIL data set should not be the same as the SORTOUT data set or any
other OUTFIL data set because this can cause lost or incorrect data or
unpredictable results.
v Do not specify OPTCD=W for a full function IBM 3480 tape unit; it is overridden.
For a 3480 operating in 3420 compatibility mode (specified as 3400-9), the
OPTCD=W request is not overridden, but performance might be degraded.
v If no secondary allocation is requested for a temporary or new output data set,
automatic secondary allocation will be used unless NOOUTSEC is in effect.
v The RECFM, LRECL, and BLKSIZE in a tape label are used only for a tape
output data set with DISP=MOD, a DD volser present, and an AL, SL, or NSL
label, when appropriate.
v FREE=CLOSE cannot be specified.

Chapter 2. Invoking DFSORT with Job Control Language 73


SORTOUT and OUTFIL DD Statements

v See the discussion of the SOLRF and NOSOLRF options in OPTION Control
Statement on page 142 for information related to the SORTOUT LRECL.

Example 8 SORTOUT DD Statement:

//SORTOUT DD DSN=C905460.OUTPT,UNIT=3390,SPACE=(CYL,5),
// DISP=(NEW,CATLG)

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 673.

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.

74 z/OS V1R5.0 DFSORT Application Programming Guide


SORTCNTL DD 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
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
142.
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 625.

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 364.

Full override and applicability details are listed below and in Appendix B,
Specification/Override of DFSORT Options, on page 625.
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

Chapter 2. Invoking DFSORT with Job Control Language 75


DFSPARM DD Statement

statements. When your system programmers installed DFSORT, they might


have changed this name to one more appropriate for your site with the
PARMDDN option of the ICEMAC installation macro. However, DFSORT will
always use a DFSPARM data set of present, unless a DD statement with the
PARMDDN name is also present.

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.

76 z/OS V1R5.0 DFSORT Application Programming Guide


DFSPARM DD Statement

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.

| 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 79.

SORTDKdd DD Statement
SORTWKdd data sets can be assigned to VIO. If the ICEMAC parameter VIO 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 ICEMAC option NOMSGDD=QUIT is

Chapter 2. Invoking DFSORT with Job Control Language 77


SORTDIAG DD Statement

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
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.

78 z/OS V1R5.0 DFSORT Application Programming Guide


Chapter 3. Using DFSORT Program Control Statements
Using Program Control Statements . . . . . . . . . . . . . . . . . 81
Control Statement Summary . . . . . . . . . . . . . . . . . . . . 82
Describing the Primary Task . . . . . . . . . . . . . . . . . . . 82
Including or Omitting Records . . . . . . . . . . . . . . . . . . 82
Reformatting and Editing Records . . . . . . . . . . . . . . . . . 83
Producing Multiple Output and Reports and Converting Records . . . . . 83
Invoking Additional Functions and Options . . . . . . . . . . . . . . 83
Using Symbols . . . . . . . . . . . . . . . . . . . . . . . . 83
General Coding Rules . . . . . . . . . . . . . . . . . . . . . . 84
Continuation Lines . . . . . . . . . . . . . . . . . . . . . . 85
Inserting Comment Statements . . . . . . . . . . . . . . . . . . 87
Coding Restrictions . . . . . . . . . . . . . . . . . . . . . . 87
EFS Restrictions When an EFS Program Is in Effect . . . . . . . . . 87
Using Control Statements from Other IBM Programs . . . . . . . . . 87
ALTSEQ Control Statement . . . . . . . . . . . . . . . . . . . . 88
Altering EBCDIC Collating SequenceExamples . . . . . . . . . . . 89
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 89
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 89
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 89
Example 4 . . . . . . . . . . . . . . . . . . . . . . . . 89
Example 5 . . . . . . . . . . . . . . . . . . . . . . . . 90
DEBUG Control Statement . . . . . . . . . . . . . . . . . . . . 90
Specifying Diagnostic OptionsExamples . . . . . . . . . . . . . . 94
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 94
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 95
END Control Statement . . . . . . . . . . . . . . . . . . . . . . 95
Discontinue Reading Control StatementsExamples . . . . . . . . . . 95
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 95
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 95
INCLUDE Control Statement . . . . . . . . . . . . . . . . . . . . 96
Relational Condition . . . . . . . . . . . . . . . . . . . . . . 98
Comparisons . . . . . . . . . . . . . . . . . . . . . . . . 99
Relational Condition Format . . . . . . . . . . . . . . . . . . 99
Padding and Truncation . . . . . . . . . . . . . . . . . . . 104
Cultural Environment Considerations . . . . . . . . . . . . . . 105
Including Records in the Output Data SetComparison Examples . . . . 105
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 105
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 105
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 106
Example 4 . . . . . . . . . . . . . . . . . . . . . . . . 106
Example 5 . . . . . . . . . . . . . . . . . . . . . . . . 107
Substring Comparison Tests . . . . . . . . . . . . . . . . . . 107
Relational Condition Format. . . . . . . . . . . . . . . . . . 107
Including Records in the Output Data SetSubstring Comparison Example 108
Example . . . . . . . . . . . . . . . . . . . . . . . . . 108
Bit Logic Tests . . . . . . . . . . . . . . . . . . . . . . . 108
Method 1: Bit Operator Tests . . . . . . . . . . . . . . . . . . 109
Relational Condition Format. . . . . . . . . . . . . . . . . . 109
Fields . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Mask . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Padding and Truncation . . . . . . . . . . . . . . . . . . . . 110
Including Records in the Output Data SetBit Operator Test Examples 110
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 110
Copyright IBM Corp. 1973, 2004 79
Using DFSORT Program Control Statements

Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 111
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 111
Method 2: Bit Comparison Tests . . . . . . . . . . . . . . . . . 111
Relational Condition Format . . . . . . . . . . . . . . . . . . 111
Fields . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Bit Constant . . . . . . . . . . . . . . . . . . . . . . . 112
Padding and Truncation . . . . . . . . . . . . . . . . . . . 112
Including Records in the Output Data SetBit Comparison Test Examples 113
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 113
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 113
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 113
Date Comparisons . . . . . . . . . . . . . . . . . . . . . . 114
Relational Condition Format . . . . . . . . . . . . . . . . . . 114
Including Records in the Output Data SetDate Comparisons . . . . . . 116
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 116
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 116
INCLUDE/OMIT Statement Notes . . . . . . . . . . . . . . . . 116
INREC Control Statement . . . . . . . . . . . . . . . . . . . . 117
INREC Statement Notes . . . . . . . . . . . . . . . . . . . . 127
Reformatting Records Before Processing Examples . . . . . . . . . 129
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 129
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 129
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 130
Example 4 . . . . . . . . . . . . . . . . . . . . . . . . 131
Example 5 . . . . . . . . . . . . . . . . . . . . . . . . 131
MERGE Control Statement . . . . . . . . . . . . . . . . . . . . 132
Specifying a MERGE or COPYExamples . . . . . . . . . . . . . 135
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 135
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 135
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 135
Example 4 . . . . . . . . . . . . . . . . . . . . . . . . 135
MODS Control Statement . . . . . . . . . . . . . . . . . . . . 135
Identifying User Exit RoutinesExamples . . . . . . . . . . . . . 138
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 138
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 138
OMIT Control Statement . . . . . . . . . . . . . . . . . . . . . 139
Omitting Records from the Output Data SetExample . . . . . . . . . 141
Example . . . . . . . . . . . . . . . . . . . . . . . . . 141
OPTION Control Statement . . . . . . . . . . . . . . . . . . . . 142
Aliases for OPTION Statement Options . . . . . . . . . . . . . . 189
Specifying DFSORT Options or COPYExamples . . . . . . . . . . 189
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 189
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 190
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 190
Example 4 . . . . . . . . . . . . . . . . . . . . . . . . 191
Example 5 . . . . . . . . . . . . . . . . . . . . . . . . 191
Example 6 . . . . . . . . . . . . . . . . . . . . . . . . 191
Example 7 . . . . . . . . . . . . . . . . . . . . . . . . 192
Example 8 . . . . . . . . . . . . . . . . . . . . . . . . 192
Example 9 . . . . . . . . . . . . . . . . . . . . . . . . 193
OUTFIL Control Statements . . . . . . . . . . . . . . . . . . . . 194
OUTFIL Statements Notes . . . . . . . . . . . . . . . . . . . 262
OUTFIL FeaturesExamples . . . . . . . . . . . . . . . . . . 265
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 265
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 266
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 267

80 z/OS V1R5.0 DFSORT Application Programming Guide


Using DFSORT Program Control Statements

Example 4 . . . . . . . . . . . . . . . . . . . . . . . . 269
Example 5 . . . . . . . . . . . . . . . . . . . . . . . . 272
Example 6 . . . . . . . . . . . . . . . . . . . . . . . . 273
Example 7 . . . . . . . . . . . . . . . . . . . . . . . . 273
Example 8 . . . . . . . . . . . . . . . . . . . . . . . . 274
Example 9 . . . . . . . . . . . . . . . . . . . . . . . . 274
Example 10 . . . . . . . . . . . . . . . . . . . . . . . 275
Example 11 . . . . . . . . . . . . . . . . . . . . . . . . 276
Example 12 . . . . . . . . . . . . . . . . . . . . . . . 276
Example 13 . . . . . . . . . . . . . . . . . . . . . . . 277
Example 14 . . . . . . . . . . . . . . . . . . . . . . . 277
Example 15 . . . . . . . . . . . . . . . . . . . . . . . 278
Example 16 . . . . . . . . . . . . . . . . . . . . . . . 278
Example 17 . . . . . . . . . . . . . . . . . . . . . . . 279
Example 18 . . . . . . . . . . . . . . . . . . . . . . . 280
Example 19 . . . . . . . . . . . . . . . . . . . . . . . 280
OUTREC Control Statement . . . . . . . . . . . . . . . . . . . 281
OUTREC Statement Notes . . . . . . . . . . . . . . . . . . . 289
Reformatting the Output RecordExamples . . . . . . . . . . . . 290
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 290
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 290
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 290
Example 4 . . . . . . . . . . . . . . . . . . . . . . . . 291
Example 5 . . . . . . . . . . . . . . . . . . . . . . . . 291
Example 6 . . . . . . . . . . . . . . . . . . . . . . . . 292
Example 7 . . . . . . . . . . . . . . . . . . . . . . . . 292
Example 8 . . . . . . . . . . . . . . . . . . . . . . . . 292
RECORD Control Statement . . . . . . . . . . . . . . . . . . . 293
Describing the Record Format and LengthExamples . . . . . . . . . 297
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 297
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 297
SORT Control Statement . . . . . . . . . . . . . . . . . . . . . 298
SORT/MERGE Statement Notes . . . . . . . . . . . . . . . . . 305
Specifying a SORT or COPYExamples . . . . . . . . . . . . . . 305
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 305
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 306
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 306
Example 4 . . . . . . . . . . . . . . . . . . . . . . . . 306
Example 5 . . . . . . . . . . . . . . . . . . . . . . . . 307
Example 6 . . . . . . . . . . . . . . . . . . . . . . . . 307
SUM Control Statement . . . . . . . . . . . . . . . . . . . . . 307
SUM Statement Notes . . . . . . . . . . . . . . . . . . . . . 309
Adding Summary FieldsExamples . . . . . . . . . . . . . . . . 311
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . 311
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . 311
Example 3 . . . . . . . . . . . . . . . . . . . . . . . . 311
Example 4 . . . . . . . . . . . . . . . . . . . . . . . . 311

Using Program Control Statements


Program control statements direct DFSORT in processing your records. Some
program control statements are required while others are optional. You use the
control statements to:
v Indicate whether a sort, merge, or copy is performed.
v Describe the control fields to be used.

Chapter 3. Using DFSORT Program Control Statements 81


Using Program Control Statements

v Indicate program exits for transferring control to your own routines.


v Describe DFSORT functions you want to have invoked.
v Describe input and output files.
v Indicate various options you want to use during processing.

You can supply program control statements to DFSORT from:


v A SYSIN data set
v A SORTCNTL data set
v A DFSPARM data set
v A 24-Bit parameter list
v An extended parameter list

See Appendix B, Specification/Override of DFSORT Options, on page 625 for an


explanation of when to use each source.

DFSORT Panels offers you an alternative to coding program control statements


directly. When you use panels to prepare a job to be run or saved in a data set, you
can create the necessary statements in correct syntax by entering information and
commands online. See DFSORT Panels Guide for details.

This chapter begins with a summary of DFSORT program control statements and
coding rules. A detailed description of each statement follows.

Control Statement Summary

Describing the Primary Task


The only required program control statement in a DFSORT application is a SORT,
MERGE, or OPTION statement that specifies whether you want to sort, merge, or
copy records. (Copying can be specified on any of the three statements.)
SORT Describes control fields if you are coding a sort application, or specifies a
copy application. Indicates whether you want ascending or descending
order for the sort.
MERGE
Describes control fields if you are coding a merge application, or specifies a
copy application. Indicates whether you want ascending or descending
order for the merge.
OPTION
Overrides installation defaults (such as EQUALS, CHALT, and CHECK) and
supplies optional information (such as DYNALLOC and SKIPREC). Can
specify a copy application.

Including or Omitting Records


You can specify whether certain records are included in the output data sets or
omitted from them.
INCLUDE
Specifies that only records whose fields meet certain criteria are included.
OMIT Specifies that any records whose fields meet certain criteria are deleted.
OUTFIL
Specifies the records to be included or omitted in multiple output data sets.

82 z/OS V1R5.0 DFSORT Application Programming Guide


Control Statement Summary

Reformatting and Editing Records


You can modify individual records by deleting and reordering fields and inserting
blanks, zeros, or constants.
INREC
Specifies how records are reformatted before they are sorted, copied, or
merged.
OUTREC
Specifies how records are reformatted after they are sorted, copied, or
merged.
OUTFIL
Specifies how records are reformatted in multiple output data sets.

Producing Multiple Output and Reports and Converting Records


You can produce multiple output data sets and reports, convert variable-length
records to fixed-length records, and convert fixed-length records to variable-length
records.
OUTFIL
Specifies the output data sets and which records are to appear in each.
Specifies how records are to be converted from variable-length to
fixed-length or from fixed-length to variable-length.

Invoking Additional Functions and Options


You can use the remaining control statements to perform a variety of tasks.
ALTSEQ
Specifies changes to the ALTSEQ translation table to be used for SORT,
MERGE, INCLUDE or OMIT fields with format AQ, and for INREC,
OUTREC, and OUTFIL OUTREC fields with TRAN=ALTSEQ.
DEBUG
Specifies various diagnostic options.
END Causes DFSORT to discontinue reading SYSIN, SORTCNTL, or
DFSPARM.
MODS Specifies use of one or more user exit routines in a DFSORT application.
See Chapter 4, Using Your Own User Exit Routines, on page 313 for
information about user exit routines.
RECORD
Can be used to supply length and type information.
SUM Specifies that numeric summary fields in records with equal control fields
are summed in one record and that the other records are deleted.

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. This makes it easy to create and reuse collections of symbols (that is,
mappings) representing information associated with various record layouts. See
Chapter 7, Using Symbols for Fields and Constants, on page 507 for complete
details.

Chapter 3. Using DFSORT Program Control Statements 83


General Coding Rules

General Coding Rules


See Inserting Comment Statements on page 87 for an explanation of how to use
comment statements, blank statements, and remarks. DFSORT program control
statements and EXEC PARM options can also be specified together in a
user-defined DD data set. See DFSPARM DD Statement on page 75 for special
coding conventions that apply to this DD source.

All other DFSORT control statements have the same general format, shown in
Figure 5. The illustrated format does not apply to control statements you supply in a
parameter list. See Chapter 5, Invoking DFSORT from a Program, on page 363 for
information on the special rules that apply.

Column 1 must be blank


unless a label is present

72 73 80

(Label) Operation Operand (Remarks) (Sequence or


Identification)

(Continuation column)

Figure 5. Control Statement Format

The control statements are free-form; that is, the operation definer, operand(s), 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.
v Label Field
If present, the label must begin in column 1, and must conform to the operating
system requirements for statement labels.
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 values can be associated with a parameter. The three
possible operand formats are:
parameter
parameter=value
parameter=(value1,value2...,valuen).

The following example illustrates each of these formats.

SORT EQUALS,FORMAT=CH,FIELDS=(10,30,A)

84 z/OS V1R5.0 DFSORT Application Programming Guide


General Coding Rules

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 6.

Column 1 must
be blank 16

72 73 80

Optional use
Continued operand or remarks

(Continuation column)

Figure 6. 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,
| CABCD)
| 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

| The above statements will be treated as if they were specified as:


| INCLUDE COND=(5,4,CH,EQ,CABCD)
| SORT FIELDS=(9,3,ZD,A)
| OUTREC FIELDS=(1,27,2X,51,2,BI,M11,60:9,3,ZD,PD)

Chapter 3. Using DFSORT Program Control Statements 85


General Coding Rules

| 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,CABCD)
| SORT FIELDS=(9,3,*
| ZD,A)
| OUTREC FIELDS=(1,80,CBLANK WITHIN A*
| LITERAL)

| The above statements will be treated as if they were specified as:


| INCLUDE COND=(5,4,CH,EQ,CABCD)
| SORT FIELDS=(9,3,ZD,A)
| OUTREC FIELDS=(1,80,CBLANK WITHIN A LITERAL)

| Attention: You should only start with a blank in column 16 of line 2 if you need a
| blank as the first character of the continued operand, as shown in the OUTREC
| statement above. A blank in column 16 of line 2 will be included in the operand
| and will result in invalid syntax if incorrectly placed. For example:
| * 1 2 3 4 5 6 7
| *23456789012345678901234567890123456789012345678901234567890123456789012
| SORT FIELDS=(5,4,Z*
| D,A)
| SUM FIELDS=(5,4,Z*
| D)

| The above statements will be treated as if they were specified as:


| SORT FIELDS=(5,4,ZD,A)
| SUM FIELDS=(5,4,Z D)

| 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,CAB*
| CD)
| SORT FIELDS=(9,3,*
| ZD,A)
| OUTREC FIELDS=(5,4,2X*
| ,9,3,ZD,M26,80:X)

| The above statements will be treated as if they were specified as:


| INCLUDE COND=(5,4,CH,EQ,CABCD)
| 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

86 z/OS V1R5.0 DFSORT Application Programming Guide


General Coding Rules

| 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

Inserting Comment Statements


v Specify comment statements by coding an asterisk (*) in column 1. A comment
statement is printed along with other DFSORT program control statements but is
not otherwise processed.
v A statement with blanks in columns 1 through 71 is treated as a comment
statement.
v Comment statements are allowed only in the DFSPARM, SYSIN, and
SORTCNTL data sets.

Coding Restrictions
The following rules apply to control statement preparation:
v Labels, 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 Labels must begin in column 1 and conform to operating system requirements for
statement labels.
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 In general, values can contain no more than eight alphanumeric characters.
Values that specify record counts (such as those for SKIPREC, STOPAFT, and
FILSZ) can contain up to 28 digits, the last 15 of which are allowed to be
significant (non-zero) digits. Values specified for LOCALE can contain up to 32
alphanumeric characters.
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).

EFS Restrictions When an EFS Program Is in Effect


In addition to the items above, the following restrictions apply to control statement
preparation for an EFS program.
v Non-DFSORT operation definers can be up to 8 bytes long.
v An operation definer with no operands is allowed only if:
It is supplied through SYSIN, SORTCNTL, or DFSPARM.
It is the only operation definer on a line; column 72 must contain a blank.

Using Control Statements from Other IBM Programs


The INPFIL control statement, which is used by other IBM sort programs, is
accepted but not processed. However, control statement errors can result from
continuation of an INPFIL statement. The information contained in the INPFIL
statement for other IBM sort programs is supplied to DFSORT with DD statements.

Chapter 3. Using DFSORT Program Control Statements 87


General Coding Rules

Because DFSORT uses the OPTION control statement, OPTION control statements
in any job streams from other IBM sort programs cause DFSORT to terminate
unless the parameters from the other program conform to the DFSORT OPTION
control statement parameters.

ALTSEQ Control Statement

 ALTSEQ CODE=( E fftt ) 

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).

The ALTSEQ table can be used in two ways as follows:


v To apply an alternate collating sequence for SORT, MERGE, INCLUDE or OMIT
fields with format AQ (or format CH with CHALT in effect). In this case, the
ALTSEQ table is used to change only the order in which data is collated, not the
data itself. If you specify AQ (or CH with CHALT) without specifying an ALTSEQ
control statement, DFSORT uses the installation default ALTSEQ table.
For example, if you want to specify that the character $ (X5B) is to collate at
position XEA, after uppercase Z (XE9), you should specify:
ALTSEQ CODE=(5BEA)
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=( E fftt ) 

Specifies the original and modified EBCDIC collating positions.


ff specifies, in hexadecimal, the character whose position is to be
changed in the ALTSEQ table.
tt 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.

88 z/OS V1R5.0 DFSORT Application Programming Guide


ALTSEQ Control Statement

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

Altering EBCDIC Collating SequenceExamples


Example 1
SORT FIELDS=(18,20,AQ,A)
ALTSEQ CODE=(5BEA)

The character $ (X'5B') is to collate at position X'EA', that is, after uppercase Z
(X'E9').

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.

Chapter 3. Using DFSORT Program Control Statements 89


ALTSEQ Control Statement

Example 5
OPTION COPY
ALTSEQ CODE=(0040)
OUTREC FIELDS=(1,80,TRAN=ALTSEQ)

Each binary zero (X00) is changed to a space (X40).

DEBUG Control Statement

 DEBUG E ABEND 
NOABEND
ABSTP
BSAM
CFW
NOCFW
CTRx=n
,

EFSDPAFT=( E n )
,

EFSDPBFR=( E n )
EQUCOUNT
ESTAE
NOESTAE
NOASSIST

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 the ICEMAC 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.

90 z/OS V1R5.0 DFSORT Application Programming Guide


DEBUG Control Statement

NOABEND
Specifies that an unsuccessful sort, copy, or merge terminates with a return
code of 16.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
ABSTP
Prevents loss of needed information in a dump when Blockset terminates. This
option overrides ERET, ABEND, and NOABEND. If the DFSORT application is
unsuccessful, an abend is forced with a completion code equal to the
appropriate message number, or with the user ABEND code set during
installation with the ICEMAC option ABCODE=MSG or ABCODE=n. The
message is not written if NOESTAE is in effect.
Default: None; optional. See Appendix B, Specification/Override of DFSORT
Options, on page 625 for full override details.
Applicable Functions: See Appendix B, Specification/Override of DFSORT
Options, on page 625.
BSAM

 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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.

Chapter 3. Using DFSORT Program Control Statements 91


DEBUG Control Statement

NOCFW
Specifies that DFSORT cannot use cache fast write.

| Attention: The NOCFW option can degrade performance.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
CTRx

 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 Counts the input records being moved from the input buffer (not used
for a copy).
3 Counts the output records being moved to the output buffer (not used
for a copy or merge).
4 Counts the input records inserted by E15 (not used for Blockset).
5 Counts the output records deleted by E35 (not used for Blockset).

Default: None; optional. See Appendix B, Specification/Override of DFSORT


Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
EFSDPAFT

 EFSDPAFT=( E 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 Takes the SNAP dump after Major Call 2 to the EFS program.
3 Takes the SNAP dump after Major Call 3 to the EFS program.
4 Takes the SNAP dump after Major Call 4 to the EFS program.
5 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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

92 z/OS V1R5.0 DFSORT Application Programming Guide


DEBUG Control Statement

EFSDPBFR

 EFSDPBFR=( E n ) 

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 Takes the SNAP dump before Major Call 2 to the EFS program.
3 Takes the SNAP dump before Major Call 3 to the EFS program.
4 Takes the SNAP dump before Major Call 4 to the EFS program.
5 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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
ESTAE or NOESTAE

 ESTAE 
NOESTAE

Temporarily overrides the ESTAE installation option, which determines whether


DFSORT should delete its ESTAE recovery routine early or use it for the entire
run.

Chapter 3. Using DFSORT Program Control Statements 93


DEBUG Control Statement

DFSORT normally establishes an ESTAE recovery routine at the beginning of a


run. If an abend occurs and the ESTAE option is in effect, the system passes
control to the recovery routine. The routine terminates the run after attempting
to:
v Print additional abend information
v Continue a sort, merge, or copy application after successful SORTOUT
output
v Call the EFS program at Major Calls 4 and 5 for cleanup and housekeeping
v Write an SMF record
v Call the ICETEXIT termination exit.

If an abend occurs and the ESTAE option is not in effect, these functions might
not be performed.
ESTAE
specifies that DFSORT can use its ESTAE recovery routine for the entire
run.
NOESTAE
specifies that DFSORT is to delete its ESTAE recovery routine at a point
early in its processing. If DFSORT terminates or abends before this point is
reached, it will not delete its ESTAE recovery routine; that is, NOESTAE will
not be in effect.

Note: See Appendix E, DFSORT Abend Processing, on page 673 for more
information on the DFSORT ESTAE recovery routine.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options.
NOASSIST

 NOASSIST 

DFSORT uses System/370-XA 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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

Specifying Diagnostic OptionsExamples


Example 1
SORT FIELDS=(1,4,CH,A)
DEBUG EQUCOUNT

94 z/OS V1R5.0 DFSORT Application Programming Guide


DEBUG Control Statement

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 Control Statement

 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.

Discontinue Reading Control StatementsExamples


Example 1
//SYSIN DD *
SORT FIELDS=(1,6,A,28,5,D),FORMAT=CH
RECORD TYPE=V,LENGTH=(200,,,,80)
END
OPTION DYNALLOC

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

The END statement precedes the E15 user exit routine object deck in SYSIN.

Chapter 3. Using DFSORT Program Control Statements 95


INCLUDE Control Statement

INCLUDE Control Statement

 INCLUDE COND= (logical expression) 


FORMAT=f
ALL
(ALL)
NONE
(NONE)

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 142.

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:

 relational condition1 
.

E , AND ,relational condition2


OR

If the logical expression is true for a given record, the record is included in the
output data set.

Four 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 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 field with todays date, and include only those records for future
events.
See Comparisons on page 99 for information about comparisons.
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 C'OK', and include only those records for which C'OK' is found
somewhere in the field. Or you can search the character constant
C'J69,L92,J82' for the value in a 3-byte field, and include only those records for
which C'J69', C'L92', or C'J82' appears in the field.
See Substring Comparison Tests on page 107 for information about substring
comparison tests.

96 z/OS V1R5.0 DFSORT Application Programming Guide


INCLUDE Control Statement

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 include only those records which have bits 0 and 2 on in
a 1-byte field. Or you can include only those records which have bits 3 and 12
on and bits 6 and 8 off in a 2-byte field.
See Bit Logic Tests on page 108 for information about bit logic tests.
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 include only those records for which a Z'yymm' date field
is between January 1996 and March 2005. Or you can include only those
records for which a P'dddyy' field is less than another P'dddyy' field.
See Date Comparisons on page 114 for information about date comparisons.

By nesting relational conditions within parentheses, you can create logical


expressions of higher complexity.

Although comparisons, substring comparison tests, bit logic tests, and date
comparisons are explained separately below for clarity, they can be combined to
form logical expressions.

The INCLUDE control statement differs from the INCLUDE parameter of the
OUTFIL statement in the following ways:
v The INCLUDE statement applies to all input records; the INCLUDE parameter
applies only to the OUTFIL input records for its OUTFIL group.
| v FORMAT=f can be specified with the INCLUDE statement but not with the
| INCLUDE parameter. Thus, you can use FORMAT=f and p,m or p,m,f fields with
| the INCLUDE statement, but you must only use p,m,f fields with the INCLUDE
| parameter. For example:
| INCLUDE FORMAT=BI,
| COND=(5,4,LT,11,4,OR,21,4,EQ,31,4,OR,
| 61,20,SS,EQ,CFLY)
|
| OUTFIL INCLUDE=(5,4,BI,LT,11,4,BI,OR,21,4,BI,EQ,31,4,BI,OR,
| 61,20,SS,EQ,CFLY)
v D2 format can be specified with the INCLUDE statement but not with the
INCLUDE parameter.

See OUTFIL Control Statements on page 194 for more details on the OUTFIL
INCLUDE parameter.
COND

 COND= (logical expression) 


ALL
(ALL)
NONE
(NONE)

logical expression
specifies one or more relational conditions logically combined, based on

Chapter 3. Using DFSORT Program Control Statements 97


INCLUDE Control Statement

fields in the input record. If the logical expression is true for a given
record, the record is included in the output data sets.
ALL or (ALL)
specifies that all of the input records are to be included in the output
data sets.
NONE or (NONE)
specifies that none of the input records are to be included in the output
data sets.

Default: ALL. See Appendix B, Specification/Override of DFSORT Options, on


page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 9 on page 99.
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.

| Default: None. FORMAT=f must be specified if any field is specified as p,m


| rather than p,m,f. See Appendix B, Specification/Override of DFSORT Options,
| on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

| Note: DFSORT issues an informational message and ignores FORMAT=f if all of


| the fields are specified as p,m,f.

Relational Condition
The relational condition specifies that a comparison or bit logic test 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.

98 z/OS V1R5.0 DFSORT Application Programming Guide


INCLUDE Control Statement

Comparisons
Relational Condition Format
Two formats for the relational condition can be used:

 (p1,m1,f1, EQ , p2,m2,f2 ) 
NE constant
GT
GE
LT
LE

Or, if the FORMAT=f operand is used:

|  (p1,m1, EQ , p2,m2 ) 
f1, NE ,f2
GT constant
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,f1: These variables specify a field in the input record to be compared either
to another field in the input record or to a constant.
v p1 specifies the first byte of the compare field relative to the beginning of the
input record.4 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
compare fields must start on a byte boundary, and no compare field can extend
beyond byte 32752.
v m1 specifies the length of the compare field. Acceptable lengths for different
formats are in Table 9.
v f1 specifies the format of the data in the compare field. Permissible formats are
given in Table 9.
| You can use p1,m1 rather than p1,m1,f1 if you use FORMAT=f to supply the
| format for the field.
Table 9. Compare Field Formats and Lengths
Format Code Length Description
5
CH 1 to 256 bytes Character
AQ 1 to 256 bytes Character with alternate
collating sequence

4. 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 99


INCLUDE Control Statement

Table 9. Compare Field Formats and Lengths (continued)


Format Code Length Description
ZD 1 to 256 bytes Signed zoned decimal
PD 1 to 255 bytes Signed packed decimal
| PD0 2 to 8 bytes Packed decimal with sign and
| first digit ignored
FI 1 to 256 bytes Signed fixed-point
BI 1 to 256 bytes Unsigned binary
AC 1 to 256 bytes ISCII/ASCII character
CSF or FS 1 to 16 bytes Signed numeric with optional
leading floating sign
CSL or LS 2 to 256 bytes Signed numeric with leading
separate sign
CST or TS 2 to 256 bytes Signed numeric with trailing
separate sign
CLO or OL 1 to 256 bytes Signed numeric with leading
overpunch sign
CTO or OT 1 to 256 bytes Signed numeric with trailing
overpunch sign
ASL 2 to 256 bytes Signed ISCII/ASCII numeric
with leading separate sign
AST 2 to 256 bytes Signed ISCII/ASCII numeric
with trailing separate sign
D2 1 to 256 bytes User-defined data type
(requires an EFS program)
Note: See Appendix C, Data Format Descriptions, on page 657 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 10 on page 101.

AC, ASL, and AST formats sequence EBCDIC data using the ISCII/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.

5. If CHALT is in effect, CH is treated as AQ.

100 z/OS V1R5.0 DFSORT Application Programming Guide


INCLUDE Control Statement

Table 10. Permissible Field-to-Field Comparisons for INCLUDE/OMIT


| Field BI CH ZD PD PD0 FI AC ASL AST CSF CSL CST CLO CTO AQ D2
Format or FS or LS or TS or OL or
OT
BI X X
CH X X
ZD X X
PD X X
| PD0 X
FI X
AC X
ASL X X
AST X X
CSF or X X X
FS
CSL or X X X
LS
CST or X X X
TS
CLO or X X
OL
CTO or X X
OT
AQ X
D2 X
Note: D2 field formats are user-defined.

Constants: A constant can be a decimal number (n, +n, n), character string
(C'xx...x'), or hexadecimal string (X'yy...yy'). The current date can also be used as a
decimal number (DATE1P, DATE2P, DATE3P) or character string (DATE1,
| DATE1(c), DATE2, DATE2(c), DATE3, DATE3(c), DATE4). The different constants
are explained in detail below. Permissible comparisons between compare fields and
constants are shown in Table 11.
Table 11. Permissible Field-to-Constant Comparisons for INCLUDE/OMIT.
Field Format Self-Defining Term
Decimal Number Character String Hexadecimal String
BI X X X
CH X X
ZD X
PD X
| PD0 X
FI X
AC X X
ASL X

Chapter 3. Using DFSORT Program Control Statements 101


INCLUDE Control Statement

Table 11. Permissible Field-to-Constant Comparisons for INCLUDE/OMIT. (continued)


Field Format Self-Defining Term
Decimal Number Character String Hexadecimal String
AST X
CSF or FS X
CSL or LS X
CST or TS X
CLO or OL X
CTO or OT X
AQ X X
D2 X X X
Note: D2 field formats are user-defined.

Decimal Number Format: The format for coding a decimal constant is:

[]n

When an FI field is compared with a decimal constant, n or + n cannot be larger


than +2147483647 and n cannot be smaller than 2147483648.

When a BI field is compared with a decimal constant, n or + n cannot be larger than


+4294967295 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 Invalid Explanation


15 ++15 Too many sign characters
+15 15+ Sign in wrong place
15 1.5 Contains invalid character
18000000 1,500 Contains invalid character

Figure 7. Valid and Invalid Decimal Constants

Current Date as Decimal Number: DATE1P, DATE2P, or DATE3P can be used to


generate a decimal number for the date of the run. Table 12 shows the decimal
number generated for each current date operand along with an example. yyyy
represents the year, mm represents the month (0112), dd represents the date
(0131) and ddd represents the day of the year (001366).
Table 12. Current Date Operand Decimal Numbers
Operand Constant April 19, 2001
DATE1P +yyyymmdd +20010419
DATE2P +yyyymm +200104
DATE3P +yyyyddd +2001109

Character String Format: The format for coding a character string constant is:

102 z/OS V1R5.0 DFSORT Application Programming Guide


INCLUDE Control Statement

C'xx...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:

Valid Invalid Explanation


C'JDCO' C''''' Apostrophes not paired
C'$@#' 'ABCDEF' C identifier missing
C'+0.193' C'ABCDEF Apostrophe missing
C'Frank''s' C'Frank's' Two single apostrophes needed for one

Figure 8. Valid and Invalid Character String Constants

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

Valid Invalid Explanation


C'Q<D1D2>T' C'Q<R>S' Single-byte data within SO/SI
C'<D1D2D3>' C'D1D2D3' Missing SO/SI; treated as single-byte
data
C'Q<D1>R<D2>' C'Q<D1<D2>>' Nested SO/SI

Figure 9. Valid and Invalid Strings with Double-Byte Data

| Current Date as Character String: DATE1, DATE1(c), DATE2, DATE2(c), DATE3,


| DATE3(c), and DATE4 can be used to generate a character string for the date of
| the run. Table 13 on page 104 shows the character string generated for each
| current date operand along with an example using (/) for (c) where relevant. yyyy
| represents the year, mm (for date) represents the month (0112), dd represents the
| day (0131), ddd represents the day of the year (001366), 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.

Chapter 3. Using DFSORT Program Control Statements 103


INCLUDE Control Statement

Table 13. Current Date Operand Character Strings


| Operand Constant April 19, 2001, 04:52:45 PM
DATE1 C'yyyymmdd' C'20010419'
DATE1(c) C'yyyycmmcdd' C'2001/04/19'
DATE2 C'yyyymm' C'200104'
DATE2(c) C'yyyycmm' C'2001/04'
DATE3 C'yyyyddd' C'2001109'
DATE3(c) C'yyyycddd' C'2001/109'
| DATE4 C'yyyy-mm-dd-hh.mm.ss' C'2001-04-19-16.52.45'

| 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
C'yyyy-mm-dd-hh'.

Hexadecimal String Format: The format for coding a hexadecimal string constant
is:

X'yy...yy'

The value yy represents any pair of hexadecimal digits. You can specify up to 256
pairs of hexadecimal digits.

| Since 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 Invalid Explanation


X'ABCD' X'ABGD' Invalid hexadecimal digit
X'BF3C' X'BF3' Incomplete pair of digits
X'AF050505' 'AF050505' Missing X identifier
X'BF3C' 'BF3C'X X identifier in wrong place

Figure 10. Valid and Invalid Hexadecimal Constants

Padding and Truncation


In a field-to-field comparison, the shorter compare field is padded appropriately. In a
field-to-constant comparison, the constant is padded or truncated to the length of
the compare field.

Character and hexadecimal strings are truncated and padded on the right.

The padding characters are:

104 z/OS V1R5.0 DFSORT Application Programming Guide


INCLUDE Control Statement

v X'40' For a character string


v X'00' For a hexadecimal string.

Decimal constants are padded and truncated on the left. Padding is done with zeros
in the proper format.

Cultural Environment Considerations


DFSORTs collating behavior can be modified according to your cultural
environment. The cultural environment is established by selecting the active locale.
The active locales collating rules affect INCLUDE and OMIT processing as follows:
v DFSORT includes or omits records for output according to the collating rules
defined in the active locale. This provides inclusion or omission for single- or
multi-byte character data, based on defined collating rules which retain the
cultural and local characteristics of a language.

If locale processing is to be used, the active locale will only be used to process
character (CH) compare fields and character and hexadecimal constants compared
to character (CH) compare fields.

For more information on locale processing, see Cultural Environment


Considerations on page 6 or LOCALE in OPTION Control Statement on page
142.

Including Records in the Output Data SetComparison Examples


Example 1
INCLUDE COND=(5,8,GT,13,8,|,105,4,LE,1000),FORMAT=CSF

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,CSTOCKHOLM,
AND,21,8,ZD,GT,+50000,
OR,31,4,CH,NE,CHERR)

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 141 illustrates how parentheses can be used to
change the order of evaluation.) Also note that ending a line with a comma or

Chapter 3. Using DFSORT Program Control Statements 105


INCLUDE Control Statement

semicolon followed by a blank indicates that the parameters continue on the next
line, starting in any position from columns 2 through 71.

Example 3
| INCLUDE FORMAT=CH,
| COND=((5,1,EQ,8,1),&,
| ((20,1,EQ,CA,&,30,1,FI,GT,10),|,
| (20,1,EQ,CB,&,30,1,FI,LT,100),|,
| (20,1,NE,CA,&,20,1,NE,CB)))

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,CT1,OR,
(1,2,BI,GE,X001A,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 107:


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.

106 z/OS V1R5.0 DFSORT Application Programming Guide


INCLUDE Control Statement

compare compare
RDW field A field B

T1
7 10
compare compare
RDW field C field D

T2
7 20 25

Figure 11. Sample Records

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 Z'yyyymmdd' in bytes 21-28 is greater than todays date. DATE1P
generates a decimal number for the current date in the form +yyyymmdd.

Substring Comparison Tests


Two types of substring comparison tests are offered, as follows:
1. Find a constant within a field value. For example, you can search the value in a
6-byte field for the character constant C'OK'. If the field value is, for example,
C'**OK**' or C'****OK', the relational condition is true; if the field value is
C'**ERR*', the relational condition is false.
2. Find a field value within a constant. For example, you can search the character
constant C'J69,L92,J82' for the value in a 3-byte field. If the field value is C'J69',
C'L92', or C'J82', the relational condition is true; if the field value is C'X24', the
relational condition is false. Note that the comma is used within the constant to
separate the valid 3-character values; any character that will not appear in the
field value can be used as a separator in the constant.

Relational Condition Format


Two formats for the relational condition can be used:

 (p1,m1,SS, EQ , constant ) 
NE

Or, if the FORMAT=SS operand is used:

|  (p1,m1, EQ , constant ) 
SS, NE

| Restriction: FORMAT=SS can precede COND but cannot follow it.

Substring comparison operators are as follows:


EQ Equal to

Chapter 3. Using DFSORT Program Control Statements 107


INCLUDE Control Statement

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 102 and Hexadecimal String Format on page
104 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.

Including Records in the Output Data SetSubstring Comparison


Example
Example
| INCLUDE FORMAT=SS,COND=(11,6000,EQ,COK,OR,5,3,EQ,CJ69,L92,J82)

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.

Bit Logic Tests


Two methods for bit logic testing are offered as follows:
v Bit operator with hexadecimal or bit mask
v Bit comparison tests

While any bit logic test can be specified using either of the two methods, each of
them offers unique advantages not found with the other.

6. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.

108 z/OS V1R5.0 DFSORT Application Programming Guide


INCLUDE Control Statement

The ability to specify selected bits in a field, by either of the two methods, can
greatly reduce the number of INCLUDE conditions that must be specified to achieve
a given result, because the need to account for unspecified bits is eliminated.

Method 1: Bit Operator Tests


This method of bit logic testing allows you to test whether selected bits in a binary
field are all on, all off, in a mixed on-off state, or in selected combinations of these
states. While this method allows you to test many different possible bit
combinations with a single operation, similar to the Test Under Mask (TM) machine
instruction, it is less suited to determine if a field contains exactly one particular
combination of on and off bits than Method 2 described below.

Relational Condition Format


Two formats for the relational condition can be used:

 (p1,m1,BI, ALL , mask ) 


SOME
NONE
NOTALL
NOTSOME
NOTNONE
BO
BM
BZ
BNO
BNM
BNZ

Or, if the FORMAT=BI operand is used:

|  (p1,m1, ALL , mask ) 


BI, SOME
NONE
NOTALL
NOTSOME
NOTNONE
BO
BM
BZ
BNO
BNM
BNZ

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

Chapter 3. Using DFSORT Program Control Statements 109


INCLUDE Control Statement

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:

X'yy...yy'

The value yy represents any pair of hexadecimal digits that constitute a byte (8
bits). Each bit must be 1 (test bit) or 0 (ignore bit). You can specify up to 256 pairs
of hexadecimal digits.

Bit String Format: The format for coding a bit string mask is:

B'bbbbbbbb...bbbbbbbb'

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.

Padding and Truncation


The hexadecimal or bit mask is truncated or padded on the right to the byte length
of the binary field. The padding character is X00 (all bits off and thus not tested).

Including Records in the Output Data SetBit Operator Test Examples


Example 1
INCLUDE COND=(27,1,CH,EQ,CD,AND,18,1,BI,ALL,B10000000)

This example illustrates how to only include records in which:


v Byte 27 contains D

7. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.

110 z/OS V1R5.0 DFSORT Application Programming Guide


INCLUDE Control Statement

AND
v Byte 18 has bit 0 on.

Example 2
INCLUDE COND=(11,1,BI,BM,X85)

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 14. Bit Comparison Example 2: Results for Selected Field Values
11,1,BI Value 11,1,BI Result Action
X85 False Omit Record
XC1 True Include Record
X84 True Include Record
X00 False Omit Record

Example 3
INCLUDE COND=(11,2,ALL,B0001001000110100,
OR,21,1,NONE,B01001100),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.

Results for selected field values are shown below:


Table 15. Bit Comparison Example 3: Results for Selected Field Values
11,2,BI Value 11,2,BI Result 21,1,BI Value 21,1,BI Result Action
X1234 True X4C False Include Record
X02C4 False X81 True Include Record
X0204 False X40 False Omit Record
XF334 True X00 True Include Record
X1238 False X4F False Omit Record

Method 2: Bit Comparison Tests


This method of bit logic testing allows you to test whether selected bits in a binary
field are either in an exact pattern of on and off bits, or not in that exact pattern.
Unlike Method 1 described above, only equal and unequal comparisons are
allowed; however, this method has the advantage of being able to test for a precise
combination of on and off bits.

Relational Condition Format


Two formats for the relational condition can be used:

Chapter 3. Using DFSORT Program Control Statements 111


INCLUDE Control Statement

 (p1,m1,BI, EQ , constant ) 
NE

Or, if the FORMAT=BI operand is used:

|  (p1,m1, EQ , constant ) 
BI, NE

Bit comparison operators are as follows:


EQ Equal to
NE Not equal to

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.

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:

B'bbbbbbbb...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).

Padding and Truncation


The bit constant is truncated or padded on the right to the byte length of the binary
field. The padding character is B00000000 (all bits equal to 0). Note that the
padded bytes are compared to the excess bytes in the binary field.

| Recommendation: To ensure that comparison of the padded bytes to the excess


| bytes in the binary field does not cause unwanted results, shorten the field length to
| eliminate the padding characters, or increase the length of the bit constant to
| specify the exact test pattern you want.

8. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.

112 z/OS V1R5.0 DFSORT Application Programming Guide


INCLUDE Control Statement

Including Records in the Output Data SetBit Comparison Test


Examples
Example 1
INCLUDE COND=(27,1,CH,EQ,CD,AND,18,1,BI,EQ,B1.......)

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,B10...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 16. Bit Comparison Example 2: Results for Selected Field Values
11,1,BI Value 11,1,BI Result Action
X85 False Omit Record
XC1 True Include Record
X84 True Include Record
X97 False Omit Record

Example 3
INCLUDE COND=(11,2,EQ,B..01....0......1,
OR,21,1,EQ,B01......),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 17. Bit Comparison Example 3: Results for Selected Field Values
11,2,BI Value 11,2,BI Result 21,1,BI Value 21,1,BI Result Action
X1221 True XC0 False Include Record
X02C4 False X41 True Include Record
X1234 False X00 False Omit Record
X5F7F True X7F True Include Record
XFFFF False X2F False Omit Record

Chapter 3. Using DFSORT Program Control Statements 113


INCLUDE Control Statement

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 (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 Z'yymm' date field is
between January 1996 and March 2005. Or you can include only those records for
which a P'dddyy' field is less than another P'dddyy' field.

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 298 for details).

Relational Condition Format


Two formats for the relational condition can be used:

 (p1,m1,Y2x, EQ , p2,m2,Y2x ) 
NE constant
GT
GE
LT
LE

Or, if the FORMAT=Y2x operand is used:

|  (p1,m1, EQ , p2,m2 ) 
Y2x, NE ,Y2x
GT constant
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.

9. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.

114 z/OS V1R5.0 DFSORT Application Programming Guide


INCLUDE Control Statement

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 657 describes the length and format for each type of date field.
v Y2x specifies the Y2 format. Appendix C, Data Format Descriptions, on page
657 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.

| You can use p2,m2 rather than p2,m2,Y2x if you use FORMAT=Y2x to supply the
| format for the date field.

Constant: A two-digit year date constant in the form Y'string' with which the
p1,m1,Y2x field will be compared.

Comparisons: A date field can be compared to a date constant or another date


field with the same number of non-year (x) digits. Table 18 shows the type of
field-to-field and field-to-constant comparisons you can use. The fields shown for
any type of date (for example, yyx and xyy) can be compared to any other fields
shown for that type of date or to the Y constant shown for that type of date.
Table 18. Permissible Comparisons for Dates
Type of Date Fields (m,f) Y Constant
yyx and xyy 3,Y2T 2,Y2U Y'yyx'
3,Y2W 2,Y2X
yyxx and xxyy 4,Y2T 3,Y2V Y'yyxx'
4,Y2W 3,Y2Y Y'DATE2'
yyxxx and xxxyy 5,Y2T 3,Y2U Y'yyxxx'
5,Y2W 3,Y2X Y'DATE3'
yyxxxx and xxxxyy 6,Y2T 4,Y2V Y'yyxxxx'
6,Y2W 4,Y2Y Y'DATE1'
yy 2,Y2C 2,Y2Z Y'yy'
2,Y2S 2,Y2P
1,Y2D 1,Y2B

Y'DATE1' generates a Y constant for the current date in the form Y'yymmdd'.
Y'DATE2' generates a Y constant for the current date in the form Y'yymm'.
Y'DATE3' generates a Y constant for the current date in the form Y'yyddd'.

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 Y'yymm', use Y'0001' for January
2000 and Y'0101' for January 2001).

You can also use Y constants for special indicators as follows:


v Y'0...0' (CH/ZD/PD zeros) and Y'9...9' (CH/ZD/PD nines) can be used with Y2T,
Y2U, Y2V, Y2W, Y2X and Y2Y dates. You must use the same number of digits
as the type of date (for example, Y'000' for yyq or qyy, Y'0000' for yymm or
mmyy, and so forth).

Chapter 3. Using DFSORT Program Control Statements 115


INCLUDE Control Statement

v Y'LOW' (BI zeros), Y'BLANKS' (blanks) and Y'HIGH' (BI ones) can be used with
Y2T, Y2W and Y2S dates.

Including Records in the Output Data SetDate Comparisons


Example 1
INCLUDE FORMAT=Y2T,
COND=(3,4,GE,Y9901,AND,
3,4,LE,Y0312,OR,
3,4,LE,Y0000)

This example illustrates how to only include records in which:


v A C'yymm' date field in bytes 3 through 6 is between January 1999 and
December 2003
OR
v Bytes 3 through 6 contain CH zeros (C'0000'), ZD zeros (Z'0000') or BI zeros
(X'00000000').

Note that the century window in effect will be used to interpret the Y'9901' and
Y'0312' date constants, as well as real dates in the C'yymm' date field. However,
the century window will not be used to interpret the Y'0000' special indicator
constant or special indicators in the C'yymm' date field.

Example 2
INCLUDE COND=(2,3,Y2X,LT,36,5,Y2T)

This example illustrates how to only include records in which a P'dddyy' date field in
bytes 2 through 4 is less than a Z'yyddd' date field in bytes 36 through 40.

Note that the century window in effect will be used to interpret real dates in the
P'dddyy' and Z'yyddd' date fields. However, the century window will not be used to
interpret special indicators in the P'dddyy' and Z'yyddd' date fields.

INCLUDE/OMIT Statement Notes


v Floating point compare fields cannot be referenced in INCLUDE or OMIT
statements.
v Any selection can be performed with either an INCLUDE or an OMIT statement.
INCLUDE and OMIT are mutually exclusive.
v If several relational conditions are joined with a combination of AND and OR
logical operators, the AND statement is evaluated first. The order of evaluation
can be changed by using parentheses inside the COND expression.
v If any changes are made to record formats by user exits E15 or E32, the
INCLUDE or OMIT statement must apply to the newest formats.
v DFSORT issues a message and terminates if an INCLUDE or OMIT statement is
specified for a tape work data set sort or conventional merge application.
v If SZERO is in effect, 0 compares as less than +0 when numeric fields and
constants are used. If NOSZERO is in effect, 0 compares as equal to +0 when
numeric fields and constants are used.

116 z/OS V1R5.0 DFSORT Application Programming Guide


INCLUDE Control Statement

Table 19 on page 117 shows how DFSORT reacts to the result of a relational
condition comparison, depending on whether the statement is INCLUDE or OMIT
and whether the relational condition is followed by an AND or an OR logical
operator.

When writing complex statements, the table in Table 19 helps you get the result that
you want.
Table 19. Logic Table for INCLUDE/OMIT.
Relational Condition Program action if next logical operator is:
Statement Compare AND OR
OMIT True Check next compare, OMIT record
or if last compare
OMIT record.
OMIT False INCLUDE record Check next compare,
or if last compare,
INCLUDE record.
INCLUDE True Check next compare, INCLUDE record
or if last compare,
INCLUDE record.
INCLUDE False OMIT record Check compare, or if
last compare, OMIT
record.

INREC Control Statement

| ,

 INREC FIELDS= ( E s ) 
c: p,m
,a
p
p,m,HEX
p,HEX
p,m,TRAN=LTOU
p,TRAN=LTOU
p,m,TRAN=UTOL
p,TRAN=UTOL
p,m,TRAN=ALTSEQ
p,TRAN=ALTSEQ
p,m,Y2x
p,m,Y2x(c)
p,m,Y2xP
p,m,f ,edit
(p,m,f) ,to
deccon ,edit
(deccon) ,to
arexp ,edit
(arexp) ,to
p,m,Y2x ,edit
,to
p,m,lookup
seqnum

Chapter 3. Using DFSORT Program Control Statements 117


INREC Control Statement

The INREC control statement allows you to reformat the input records before they
are processed; that is, to define which parts of the input record are to be included in
the reformatted input record, in what order they are to appear, and how they are to
be aligned.

You do this by defining one or more fields from the input record. The reformatted
input record consists of only those fields, in the order in which you have specified
them, and aligned on the boundaries or in the columns you have indicated.

The INREC control statement also provides for:


| v Insertion of blanks, zeros, strings, current 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 hexadecimal display, conversion of
EBCDIC letters from lowercase to uppercase or uppercase to lowercase,
conversion of characters using the ALTSEQ translation table, and conversion of
numeric values from one format to another.
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 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 or hexadecimal string from a lookup table, based on a
character, hexadecimal, or bit string as input (that is, lookup and change).

For information concerning the interaction of INREC and OUTREC, see INREC
Statement Notes on page 127.
FIELDS

118 z/OS V1R5.0 DFSORT Application Programming Guide


INREC Control Statement

| ,

 FIELDS= ( E s ) 
c: p,m
,a
p
p,m,HEX
p,HEX
p,m,TRAN=LTOU
p,TRAN=LTOU
p,m,TRAN=UTOL
p,TRAN=UTOL
p,m,TRAN=ALTSEQ
p,TRAN=ALTSEQ
p,m,Y2x
p,m,Y2x(c)
p,m,Y2xP
p,m,f ,edit
(p,m,f) ,to
deccon ,edit
(deccon) ,to
arexp ,edit
(arexp) ,to
p,m,Y2x ,edit
,to
p,m,lookup
seqnum

| Specifies the order and alignment of the separation fields (blanks, zeros,
| strings, current date and current time), unedited and edited input fields, edited
| decimal constants, edited results of arithmetic expressions, and sequence
| numbers in the reformatted input records.
| 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 20.


Table 20. Examples of Valid and Invalid Column Alignment
Validity Specified Result
Valid 33:C'State ' Columns 1-32 blank
Columns 33-38 'State '

Chapter 3. Using DFSORT Program Control Statements 119


INREC Control Statement

Table 20. Examples of Valid and Invalid Column Alignment (continued)


Validity Specified Result
Valid 20:5,4,30:10,8 Columns 1-19 blank
Columns 20-23 input field (5,4)
Columns 24-29 blank
Columns 30-37 input field (10,8)
Invalid 0:5,4 Column value cannot be zero.
Invalid :25Z Column value must be specified.
Invalid 32753:21,8 Invalid column value must be less
than 32753.
Invalid 5:10:2,5 Column values cannot be adjacent.
Invalid 20,10,6:C'AB' Column value overlaps previous field.

s Specifies that a separation field (blanks, zeros, character string,


hexadecimal string, current 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, nC'xx...x', nX'yy...yy', DATE1, DATE1(c), DATE1P,
| DATE2, DATE2(c), DATE2P, DATE3, DATE3(c), DATE3P, DATE4, TIME1,
TIME1(c), TIME1P, TIME2, TIME2(c), TIME2P, TIME3 and TIME3P.
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 21.
Table 21. Examples of Valid and Invalid Blank Separation
Validity Specified Result
Valid X or 1X 1 blank
Valid 4095X 4095 blanks
Invalid 5000X Too many repetitions. Use two adjacent separation
fields instead (2500X,2500X, for example)
Invalid 0X 0 is not allowed.

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 22.
Table 22. Examples of Valid and Invalid Binary Zero Separation
Validity Specified Result
Valid Z or 1Z 1 binary zero
Valid 4095Z 4095 binary zeros
Invalid 4450Z Too many repetitions. Use two adjacent separation
fields instead (4000Z,450Z for example).
Invalid 0Z 0 is not allowed.

120 z/OS V1R5.0 DFSORT Application Programming Guide


INREC Control Statement

nC'xx...x'
Character string separation. n repetitions of the character string
constant (C'xx...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 23.
Table 23. Examples of Valid and Invalid Character String Separation
Validity Specified Result Length
Valid C'John Doe' John Doe 8
Valid C'JOHN DOE' JOHN DOE 8
Valid C'$@#' $@# 3
Valid C'+0.193' +0.193 6
Valid 4000C' ' 8000 blanks 8000
Valid 20C'**FILLER**' **FILLER** repeated 20 times 200
Valid C'Frank''s' Franks 7
Invalid C''''' Apostrophes not paired n/a
Invalid 'ABCDEF' C identifier missing n/a
Invalid C'ABCDE Apostrophe missing n/a
Invalid 4450C'1' Too many repetitions. Use two n/a
adjacent separation fields instead
(4000C'1',450C'1', for example).
Invalid 0C'ABC' 0 is not allowed n/a
Invalid C'' No characters specified n/a
Invalid C'Frank's' Two single apostrophes needed for n/a
one

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 24.
Table 24. Examples of Valid and Invalid Hexadecimal String Separation
Validity Specified Result Length
Valid X'FF' FF 1
Valid X'BF3C' BF3C 2
Valid 3X'00000F' 00000F00000F00000F 9
Valid 4000X'FFFF' FF repeated 8000 times 8000

Chapter 3. Using DFSORT Program Control Statements 121


INREC Control Statement

Table 24. Examples of Valid and Invalid Hexadecimal String Separation (continued)
Validity Specified Result Length
Invalid X'ABGD' G is not a hexadecimal digit n/a
Invalid X'F1F' Incomplete pair of digits n/a
Invalid 'BF3C' X identifier missing n/a
Invalid 'F2F1'X X in wrong place n/a
Invalid 8000X'01' Too many repetitions. Use two n/a
adjacent separation fields instead
(4000X'01',4000X'01', for example).
Invalid 0X'23AB' 0 is not allowed n/a
Invalid X'' No hexadecimal digits specified n/a

DATEn, DATEN(c), DATEnP


Constant for current date. The date of the run is to appear in the
reformatted input records. Table 25 shows the constant generated for each
separation field you can specify along with its length and an example 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.
Table 25. Current date constants
Separation Length
| Field Constant (bytes) April 19, 2001, 04:52:45 PM
DATE1 C'yyyymmdd' 8 C'20010419'
DATE1(c) C'yyyycmmcdd' 10 C'2001/04/19'
DATE1P P'yyyymmdd' 5 P'20010419'
DATE2 C'yyyymm' 6 C'200104'
DATE2(c) C'yyyycmm' 7 C'2001/04'
DATE2P P'yyyymm' 4 P'200104'
DATE3 C'yyyyddd' 7 C'2001109'
DATE3(c) C'yyyycddd' 8 C'2001/109'
DATE3P P'yyyyddd' 4 P'2001109'
| DATE4 C'yyyy-mm-dd-hh.mm.ss' 19 C'2001-04-19-16.52.45'

TIMEn, TIMEn(c), TIMEnP


Constant for current time. The time of the run is to appear in the
reformatted input records. Table 26 shows the constant generated for each
separation field you can specify along with its length and an example using
(:) for (c) where relevant. hh represents the hour (00-23), mm represents
the minutes (00-59), ss represents the seconds (00-59), and c can be any
character except a blank.
Table 26. Current time constants
Separation Length
Field Constant (bytes) 01:55:43 PM
TIME1 C'hhmmss' 6 C'135543'
TIME1(c) C'hhcmmcss' 8 C'13:55:43'

122 z/OS V1R5.0 DFSORT Application Programming Guide


INREC Control Statement

Table 26. Current time constants (continued)


Separation Length
Field Constant (bytes) 01:55:43 PM
TIME1P P'hhmmss' 4 P'135543'
TIME2 C'hhmm' 4 C'1355'
TIME2(c) C'hhcmm' 5 C'13:55'
TIME2P P'hhmm' 3 P'1355'
TIME3 C'hh' 2 C'13'
TIME3P P'hh' 2 P'13'

p,m,a
Specifies that an unedited input field is to appear in the reformatted input
record.
p Specifies the first byte of the input field relative to the beginning of the
input record.10 The first data byte of a fixed-length record has relative
position 1. The first data byte of a variable-length record has relative
position 5 (because the first 4 bytes contain the RDW). All fields must
start on a byte boundary, and no field can extend beyond byte 32752.
For special rules concerning variable-length records, see INREC
Statement Notes on page 127.
m Specifies the length of the input field. It must include the sign if the data
is signed, and must be an integer number of bytes. See INREC
Statement Notes on page 127 for more information.
a Specifies the alignment (displacement) of the input field in the
reformatted input record relative to the start of the reformatted input
record.
Permissible values of a are:
H Halfword aligned. The displacement (p-1) of the field from the
beginning of the reformatted input record, in bytes, is a multiple
of two (that is, position 1, 3, 5, and so forth).
F Fullword aligned. The displacement is a multiple of four (that is,
position 1, 5, 9, and so forth).
D Doubleword aligned. The displacement is a multiple of eight
(that is, position 1, 9, 17, and so forth).

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.
p specifies that the unedited part of the input record (that part beyond the
minimum record length), is to appear in the reformatted input record, as the last
field.
| Attention: If the reformatted input record includes only the RDW and the
| variable part of the input record, null records containing only an RDW may
| result.

10. If your E15 user exit reformats the record, p must refer to the record as reformatted by the exit.

Chapter 3. Using DFSORT Program Control Statements 123


INREC Control Statement

A value must be specified for p that is less than or equal to the minimum record
length (RECORD statement L4 value) plus 1 byte.
p,m,HEX
specifies that the hexadecimal representation of an input field is to appear in
the reformatted input record.
See p,m,HEX under OUTFIL OUTREC for details.
p,HEX
specifies that the hexadecimal representation of the 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.
See p,HEX under OUTFIL OUTREC for details.
p,m,TRAN=LTOU
specifies that lowercase EBCDIC letters (that is, a-z) in an input field are to
appear as uppercase EBCDIC letters (that is, A-Z) in the reformatted input
record.
See p,m,TRAN=LTOU under OUTFIL OUTREC for details.
p,TRAN=LTOU
specifies that lowercase EBCDIC letters (that is, a-z) in the variable part of the
input record (that part beyond the minimum record length), are to appear as
uppercase EBCDIC letters (that is, A-Z) in the reformatted input record, as the
last field.
See p,TRAN=LTOU under OUTFIL OUTREC for details.
p,m,TRAN=UTOL
specifies that uppercase EBCDIC letters (that is, A-Z) in an input field are to
appear as lowercase EBCDIC letters (that is, a-z) in the reformatted input
record.
See p,m,TRAN=UTOL under OUTFIL OUTREC for details.
p,TRAN=UTOL
specifies that uppercase EBCDIC letters (that is, A-Z) in the variable part of the
input record (that part beyond the minimum record length), are to appear as
lowercase EBCDIC letters (that is, a-z) in the reformatted input record, as the
last field.
See p,TRAN=UTOL under OUTFIL OUTREC for details.
p,m,TRAN=ALTSEQ
specifies that the characters in an input field are to be changed according to the
ALTSEQ translation table in effect in the reformatted input record.
See p,m,TRAN=ALTSEQ under OUTFIL OUTREC for details.
p,TRAN=ALTSEQ
specifies that the characters in the variable part of the input record (that part
beyond the minimum record length), are to be changed according to the
ALTSEQ translation table in effect in the reformatted input record, as the last
field.
See p,TRAN=ALTSEQ under OUTFIL OUTREC for details.

124 z/OS V1R5.0 DFSORT Application Programming Guide


INREC Control Statement

Sample Syntax:
Fixed input records
INREC FIELDS=(1:5,10,15:8C0,25:20,15,TRAN=LTOU,80:X)
Variable input records
INREC FIELDS=(1,4,C RDW=,1,4,HEX,C FIXED=,
5,20,HEX,C VARIABLE=,21,HEX)

p,m,Y2x
specifies that the four-digit 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)
p,m,Y2x(c)
specifies that the four-digit 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.
Sample Syntax:
INREC FIELDS=(25,6,Y2T(-),X,14,2,Y2U(/))
p,m,Y2xP
specifies that the four-digit 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)
| 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, CSF/FS, DT1, DT2, DT3, 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=(,,+,-))
| p,m,f,to or (p,m,f),to
specifies that a converted numeric input field is to appear in the reformatted

Chapter 3. Using DFSORT Program Control Statements 125


INREC Control Statement

input record. You can convert BI, FI, PD, PD0, ZD, CSF/FS, DT1, DT2, DT3,
TM1, TM2, TM3 or TM4 fields to BI, FI, PD, ZD 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)
| deccon,edit or (deccon),edit
| specifies that an edited 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 15
| decimal digits. The sign (+ or ) must be specified. A decimal constant
| produces a signed, 15-digit zoned decimal (ZD) result to be edited as specified.
| See deccon,edit under OUTFIL OUTREC for details.
| Sample Syntax:
| INREC FIELDS=(5:+5000,EDIT=(T,TTT),X,
| (-25500),M18,LENGTH=8)
| 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 15
| decimal digits. The sign (+ or ) must be specified. A decimal constant
| produces a signed, 15-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, 15-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, 15-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.

126 z/OS V1R5.0 DFSORT Application Programming Guide


INREC Control Statement

p,m,Y2x,to
specifies that a converted four-digit year date representation of a two-digit year
input date field is to appear in the reformatted input record.
See p,m,Y2x,to under OUTFIL OUTREC for details.
p,m,lookup
specifies that a character or hexadecimal string from a lookup table is to appear
in the reformatted input record. You can use p,m,lookup to select a specified
character or hexadecimal string based on matching an input value against
character, hexadecimal, or bit constants.
See p,m,lookup under OUTFIL OUTREC for details.
Sample Syntax:
INREC FIELDS=(11,1,
CHANGE=(6,
CR,CREAD,
CU,CUPDATE,
XFF,CEMPTY,
CA,CALTER),
NOMATCH=(11,6),
4X,
21,1,
CHANGE=(10,
B.1......,CVSAM,
B.0......,CNON-VSAM))
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 or CSF/FS
sequence numbers and control their lengths, starting values and increment
values.
See seqnum under OUTFIL OUTREC for details.
Sample Syntax:
INREC FIELDS=(SEQNUM,6,ZD,START=1000,INCR=50,1,60)

Default: None; must be specified. See Appendix B, Specification/Override of


DFSORT Options, on page 625.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

INREC Statement Notes


v When INREC is specified, DFSORT reformats the input records after user exit
E15 or INCLUDE/OMIT statement processing is finished. Thus, references to
fields by your E15 user exit and INCLUDE/OMIT statements are not affected,
whereas your SORT, OUTREC, and SUM statements must refer to fields in the
reformatted input records. Your E35 user exit must refer to fields in the
reformatted output record.
v In general, OUTREC should be used rather than INREC so your SORT and SUM
statements can refer to fields in the original input records.
v If you use locale processing for SORT, MERGE, INCLUDE, or OMIT fields, you
must not use INREC. Use the OUTREC statement or the OUTREC operand of
the OUTFIL statement instead of INREC.
v When you specify INREC, you must be aware of the change in record size and
layout of the resulting reformatted input records.

Chapter 3. Using DFSORT Program Control Statements 127


INREC Control Statement

v Performance can be improved if you can significantly reduce the length of your
records with INREC. INREC and OUTREC should not be used unless they are
actually needed to reformat your records.
v For variable-length records, the first entry in the FIELDS parameter must specify
| or include the unedited 4-byte record descriptor word (RDW), that is, the first field
| must be 1,4 or 1,m with m greater than 4. DFSORT sets the length of the
reformatted record in the RDW.
| If the first field in the data portion of the input record is to appear unedited in the
reformatted input record immediately following the RDW, the entry in the FIELDS
| parameter can specify both RDW and data field in one (1,m,...). Otherwise, the
| RDW must be specifically included in the reformatted input record (for example,
| 1,4,1,4,HEX).
v If the SORTOUT LRECL is specified or available, DFSORT will use it even if it
does not match the reformatted INREC record length; this can cause padding or
truncation of the reformatted INREC records, or termination. If the SORTOUT
LRECL is not specified or available, DFSORT can automatically use the
reformatted INREC record length as the SORTOUT LRECL, when appropriate.
See the discussion of the SOLRF and NOSOLRF options in OPTION Control
Statement on page 142.
For VSAM data sets, the maximum record size defined in the cluster is
equivalent to the LRECL when processing fixed-length records, and is four bytes
less than the LRECL when processing variable-length records. See VSAM
Considerations on page 14 for more information.
v The variable part of the input record (that part beyond the minimum record
length) can be included in the reformatted input record, and if included, must be
the last part. In this case, a value must be specified for pn that is less than or
equal to the minimum record length (see L4 of the RECORD control statement)
plus 1 byte; mn and an must be omitted.
If both INREC and OUTREC are specified, either both must specify position-only
for the last part, or neither must specify position-only for the last part.
If the reformatted input 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.
v If overflow might occur during summation, INREC can be used to create a larger
SUM field in the reformatted input record (perhaps resulting in a larger record for
sorting or merging) so that overflow does not occur.
v DFSORT issues a message and terminates if an INREC statement is specified
for a tape work data set sort or conventional merge application.
| v If SZERO is in effect, 0 is treated as negative and +0 is treated as positive for
| edited or converted input fields, decimal constants, and the results of arithmetic
| expressions. If NOSZERO is in effect, 0 and +0 are treated as positive for
| edited or converted input fields, decimal constants, and the results of arithmetic
| expressions.

128 z/OS V1R5.0 DFSORT Application Programming Guide


INREC Control Statement

Reformatting Records Before Processing Examples


Example 1
INREC Method:

INCLUDE COND=(5,1,GE,CM),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,CM),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)

The above examples illustrate how a fixed-length input data set is sorted and
reformatted for output. Unnecessary fields are eliminated from the output records
using INREC or OUTREC. The SORTIN LRECL is 80.

Records are also included or excluded by means of the INCLUDE statement, and
summed by means of the SUM statement.

The reformatted input records are fixed length with a record size of 23 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
23. The reformatted records look as follows after INREC or OUTREC processing:
Position Contents
1-3 Input positions 10 through 12
4-11 Input positions 20 through 27
12-22 Input positions 33 through 43
23 Input position 5

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).
Chapter 3. Using DFSORT Program Control Statements 129
INREC Control Statement

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 Contents
1-35 Input positions 1 through 35
36-37 Binary zeros (to prevent overflow)
38-82 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.

Note: This method of preventing overflow cannot be used for negative FI summary
fields because padding with zeros rather than ones would change the sign.

Example 3
INREC FIELDS=(20,4,12,3)
SORT FIELDS=(1,4,D,5,3,D),FORMAT=CH
OUTREC FIELDS=(5X,1,4,H,19:1,2,5,3,DATE1(),80XFF)

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 Contents
1-4 Input positions 20 through 23
5-7 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 Contents
1-5 EBCDIC blanks
6 Binary zero (for H alignment)
7-10 Input positions 20 through 23
11-18 EBCDIC blanks
19-20 Input positions 20 through 21

130 z/OS V1R5.0 DFSORT Application Programming Guide


INREC Control Statement

21-23 Input positions 12 through 14


24-33 The current date in the form C'yyyy-mm-dd'
34-113 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
INREC FIELDS=(8100,10,1,8099,8110,891)
SUM FIELDS=(1,10,ZD)
SORT FIELDS=(5011,6,CH,A)
OUTREC FIELDS=(11,8099,1,10,8110,891)

This example illustrates how you can sum on a field beyond DFSORTs normal limit
of byte 4092 by using INREC and OUTREC.

The sort field is at input positions 5001 through 5006. The sum field is at
positions 8100 through 8109. The INREC statement is used to reformat the input
records so that the sum field is within the first 4092 bytes. The reformatted input
records look as follows:
Position Contents
1-10 Input positions 8100 through 8109. The sum field now starts in
position 1 rather than in position 8100.
118109 Input positions 1 through 8099, that is, the part of the record before
the sum field. The sort field now starts in position 5011 rather than
in position 5001.
81109000 Input positions 8110 through 9000, that is, the part of the record
after the sum field.

The INREC statement allows the SUM statement to refer to the sum field in the
reformatted record at position 1. The SORT statement must refer to the sort field in
the reformatted record at position 5011. The OUTREC statement is used to restore
the records to their original format, but with the updated sum field from positions 1
through 10.

Example 5
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,CL92,X01,CM72,X02,CJ42,X03),
NOMATCH=(XFF))

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
1-4 A binary sequence number that starts at 1 and increments by 1.
57 A PD field containing the converted ZD field from input positions 8
through 12.

Chapter 3. Using DFSORT Program Control Statements 131


INREC Control Statement

89 An FI field containing the converted PD field from input positions 31


through 32.
1014 A Pyyyymmdd date field containing the Cyymmdd date field from
input positions 15-20 transformed according to the specified century
window of 1985-2084.
15 A BI field containing X01, X02, X03 or XFF as determined by
using a lookup table for the input field in positions 25-27.

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.

MERGE Control Statement

| ,

 MERGE FIELDS= ( E p,m,f,s ) 


,

( E p,m, s ) , FORMAT=f
f,
COPY
(COPY)

 
,

, E EQUALS
NOEQUALS
FILES=n
FILSZ=x
SIZE=y
SKIPREC=z
STOPAFT=n
Y2PAST= s
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
record. For details about merging short records, see the discussion of the VLSHRT
and NOVLSHRT options in OPTION Control Statement on page 142.

132 z/OS V1R5.0 DFSORT Application Programming Guide


MERGE Control Statement

The options available on the MERGE statement can be specified in other sources
as well. A table showing all possible sources for these options and the order of
override are given in Appendix B, Specification/Override of DFSORT Options, on
page 625. When an option can be specified on either the MERGE or OPTION
statement, it is preferable to specify it on the OPTION statement.

DFSORT accepts but does not process the following MERGE operands:
WORK=value and ORDER=value.

DFSORTs collating behavior can be modified according to your cultural


environment. The cultural environment is established by selecting the active locale.
The active locales collating rules affect MERGE processing as follows:
v DFSORT produces merged records for output according to the collating rules
defined in the active locale. This provides merging for single- or multi-byte
character data, based on defined collating rules that retain the cultural and local
characteristics of a language.

If locale processing is to be used, the active locale will only be used to process
character (CH) control fields.

For more information on locale processing, see Cultural Environment


Considerations on page 6 or LOCALE in OPTION Control Statement on page
142.

Note: For a merge application, records deleted during an E35 exit routine are not
sequence checked. If you use an E35 exit routine without an output data set,
sequence checking is not performed at the time the records are passed to
the E35 user exit; therefore, you must ensure that input records are in
correct sequence.
FIELDS

 FIELDS= ( E 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 298.
FIELDS=COPY or FIELDS=(COPY)

 FIELDS= COPY 
(COPY)

See the discussion of the COPY option on the OPTION statement, in OPTION
Control Statement on page 142.
FORMAT=f

 FORMAT=f 

See the discussion of the FORMAT option in SORT Control Statement on


page 298. Used the same way for a merge as for a sort.

Chapter 3. Using DFSORT Program Control Statements 133


MERGE Control Statement

EQUALS or NOEQUALS

 EQUALS 
NOEQUALS

See the discussion of these options on the OPTION statement, in OPTION


Control Statement on page 142.
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 625.
FILSZ or SIZE

 FILSZ=x 
SIZE=y

See the discussion of these options on the OPTION statement, in OPTION


Control Statement on page 142.
SKIPREC

 SKIPREC=z 

See the discussion of this option on the OPTION statement, in OPTION


Control Statement on page 142.
STOPAFT

 STOPAFT=n 

See the discussion of this option on the OPTION statement, in OPTION


Control Statement on page 142.
Y2PAST

 Y2PAST= s 
f

See the discussion of this option on the OPTION statement, in OPTION


Control Statement on page 142.

Note: CENTURY=value and CENTWIN=value can be used instead of


Y2PAST=value.

134 z/OS V1R5.0 DFSORT Application Programming Guide


MERGE Control Statement

Specifying a MERGE or COPYExamples


Example 1
MERGE FIELDS=(2,5,CH,A),FILSZ=29483

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

FIELDS
The major control field begins on byte 25 of each record, is 4 bytes long, and
contains zoned decimal data that has been placed in ascending sequence.
The second control field begins on byte 48, is 8 bytes long, is also in zoned
| decimal format, and is also in ascending sequence. The FORMAT parameter is
| used to indicate that both fields have ZD format.

Example 4
MERGE FIELDS=COPY

FIELDS
The input data set is copied to output. No merge takes place.

MODS Control Statement

 MODS E exit= ( n,m ) 


, HILEVEL=YES
s ,e

Chapter 3. Using DFSORT Program Control Statements 135


MODS Control Statement

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 313.

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.
s specifies either the name of the DD statement in your DFSORT job step that
defines the library in which your routine is located or SYSIN if your routine is in
the input stream. SYSIN is not valid for copy processing.
If a value is not specified for s, DFSORT uses the following search order to find
the library in which your routine is located:
1. The libraries identified by the STEPLIB DD statement
2. The libraries identified by the JOBLIB DD statement (if there is no STEPLIB
DD statement)
3. The link library.
e specifies the linkage editor requirements of your routine or indicates that your
routine is written in COBOL. The following values are allowed:
N specifies that your routine has already been link-edited and can be used in
the DFSORT run without further link-editing. This is the default for e. N
(specified or defaulted) can be overridden by the EXEC PARM parameters
'E15=COB' and 'E35=COB' or by the HILEVEL=YES parameter.
C specifies that your E15 or E35 routine is written in COBOL. If you code C
for any other exit, it is ignored, and N is assumed. Your COBOL-written
routine must already have been link-edited. The COBEXIT option of the
OPTION statement specifies the library for the COBOL exits.
T specifies that your routine must be link-edited together with other routines to
be used in the same phase (for example, E1n routines) of DFSORT. See
Dynamically Link-Editing User Exit Routines on page 323 for additional
information. This value is not valid for copy processing.
S specifies that your routine requires link-editing but that it must be link-edited
separately from the other routines (for example, E3n routines) to be used in
a particular phase of DFSORT. E11 and E31 exit routines are the only

136 z/OS V1R5.0 DFSORT Application Programming Guide


MODS Control Statement

routines eligible for separate link-editing. See Dynamically Link-Editing


User Exit Routines on page 323 for additional information. This value is not
valid for copy processing.

If you do not specify a value for e, N is assumed.


HILEVEL=YES

 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.


Notes:
1. The s parameter must be the same or omitted for each routine with N or C for
the e parameter (library concatenation is allowed). These routines cannot be
placed in SYSIN. Each such routine must be a load module.
2. Each routine for which T or S is specified for the e parameter can be placed in
any library or in SYSIN; they do not all have to be in the same library or
SYSIN (but can be). Some routines can even be in different libraries (or the
same library) and the rest can be in SYSIN. Each such routine, if in a library,
can be either an object deck or a load module; if in SYSIN, it must be an
object deck.
3. If the same routine is used in both input (that is, E1n routines) and output (that
is, E3n routines) DFSORT program phases, a separate copy of the routine
must be provided for each exit.
4. HILEVEL=YES can be used instead of C as the fourth parameter, to indicate
that an E15 or E35 routine is written in COBOL. In this case, if T is specified
as the fourth parameter for E15 or E35, DFSORT terminates. 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.
5. EXEC PARM parameter E15=COB can be used instead of C as the fourth
parameter, to indicate that an E15 is written in COBOL. In this case, if T is
specified as the fourth parameter for E15, DFSORT terminates.
6. EXEC PARM parameter E35=COB can be used instead of C as the fourth
parameter, to indicate that an E35 is written in COBOL. In this case, if T is
specified as the fourth parameter for E35, DFSORT terminates.
7. If HILEVEL=YES, E15=COB, or E35=COB is used instead of C as the fourth
parameter, to indicate that an exit is written in COBOL, the fourth parameter
for that exit must be specified as N or not specified.
8. If a COBOL E15 or E35 is specified for a conventional merge or tape work
data set sort, DFSORT terminates.
9. exit=(n,m) can be used to omit both the s and e parameters.
10. exit=(n,m,,e) can be used to omit the s parameter, but not the parameter.

Chapter 3. Using DFSORT Program Control Statements 137


MODS Control Statement

11. The s parameter must be specified for a conventional merge or tape work data
set sort, or when S or T is specified for the e parameter.

Default: None; must be specified if you use exit routines. N is the default for the
fourth parameter.

Applicable Functions: See Appendix B, Specification/Override of DFSORT Options,


on page 625.

For information on user exit routines in SYSIN, see System DD Statements on


page 63.

For details on how to design your routines, refer to Summary of Rules for User Exit
Routines on page 321.

When you are preparing your MODS statement,remember that DFSORT must know
the amount of main storage your routine needs so that it can allocate main storage
properly for its own use. If you do not know the exact number of bytes your
program requires (including requirements for system services), make a slightly high
estimate. The value of m in the MODS statement is written the same way whether it
is an exact figure or an estimate: you do not precede the value by E for an
estimate.

Identifying User Exit RoutinesExamples


Example 1
MODS E15=(ADDREC,552,MODLIB),E35=(ALTREC,11032,MODLIB)

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.

138 z/OS V1R5.0 DFSORT Application Programming Guide


OMIT Control Statement

OMIT Control Statement

 OMIT COND= (logical expression) 


FORMAT=f
ALL
(ALL)
NONE
(NONE)

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 142.

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:

 relational condition1 
.

E , AND ,relational condition2


OR

If the logical expression is true for a given record, the record is omitted from the
output data set.

Four 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 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 field with todays date, and omit those records for past events.
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 C'OK', and omit those records for which C'OK' is found somewhere in
the field. Or you can search the character constant C'J69,L92,J82' for the value
in a 3-byte field, and omit those records for which C'J69', C'L92', or C'J82'
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.

Chapter 3. Using DFSORT Program Control Statements 139


OMIT Control Statement

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 Z'yymm' date field is
between January 1996 and March 2005. Or you can omit only those records for
which a P'dddyy' field is less than another P'dddyy' field.

For complete details on the parameters of the OMIT control statement, see
INCLUDE Control Statement on page 96.

The OMIT control statement differs from the OMIT parameter of the OUTFIL
statement in the following ways:
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:
| OMIT FORMAT=BI,
| COND=(5,4,LT,11,4,OR,21,4,EQ,31,4,OR,
| 61,20,SS,EQ,CFLY)
|
| OUTFIL OMIT=(5,4,BI,LT,11,4,BI,OR,21,4,BI,EQ,31,4,BI,OR,
| 61,20,SS,EQ,CFLY)
v D2 format can be specified with the OMIT statement but not with the OMIT
parameter.

See OUTFIL Control Statements on page 194 for more details on the OUTFIL
OMIT parameter.
COND

 COND= (logical expression) 


ALL
(ALL)
NONE
(NONE)

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.
ALL or (ALL)
specifies that all of the input records are to be omitted from the output
data sets.
NONE or (NONE)
specifies that none of the input records are to be omitted from the
output data sets.

140 z/OS V1R5.0 DFSORT Application Programming Guide


OMIT Control Statement

Default: NONE. See Appendix B, Specification/Override of DFSORT Options,


on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
FORMAT

 FORMAT=f 

| For details on this parameter, see INCLUDE Control Statement on page 96.

Omitting Records from the Output Data SetExample


Example
OMIT COND=(27,1,CH,EQ,CD,&,
(22,2,BI,SOME,XC008,|,
28,1,BI,EQ,B.1....01))

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 96.

Chapter 3. Using DFSORT Program Control Statements 141


OPTION Control Statement

OPTION Control Statement

| ,

 OPTION E ARESALL= n 
nK
nM
ARESINV= n
nK
nM
AVGRLEN=n
CHALT
NOCHALT
CHECK
NOCHECK
CINV
NOCINV
CKPT
COBEXIT= COB1
COB2
COPY
DSPSIZE= MAX
n
DYNALLOC
= d
(d)
(,n)
(d,n)
OFF
(OFF)
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)

142 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

MAINSIZE= n
nK
nM
MAX
MOSIZE= MAX
n
p%
MSGDDN=ddname
MSGPRT= ALL
NONE
CRITICAL
NOBLKSET
NOOUTREL
NOOUTSEC
NOSTIMER
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
STOPAFT=n
SZERO
NOSZERO
TRUNC RC0
RC4
RC16
USEWKDD

Figure 12. Syntax Diagram for the Option Control Statement (Part 2 of 3)

Chapter 3. Using DFSORT Program Control Statements 143


OPTION Control Statement

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 625.

Details of aliases for OPTION statement options are given under the description of
individual options. Table 30 on page 189 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,
MAXPFIX=value, NEW, NEWFILE, NODIAG, NOERASE, NOINC, NOSWAP,
OPT=value, REP, REPLACE, WRKADR=value, WRKDEV=value, and
WRKSIZ=value.
ARESALL

144 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

 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 625 for full override details.

Applicable Functions: SeeAppendix B, Specification/Override of DFSORT


Options, on page 625.
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.
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 625 for full override details.

Chapter 3. Using DFSORT Program Control Statements 145


OPTION Control Statement

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
AVGRLEN

 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, since 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 566 and Allocation of Work Data Sets on page 617 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 625 for full override
details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 with formats CH
and AQ using the alternate collating sequence.
NOCHALT
specifies that format CH fields are not translated.

Note: 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.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

146 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

CHECK or NOCHECK

 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 625 for full override details.

Applicable Functions: SeeAppendix B, Specification/Override of DFSORT


Options, on page 625.
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
CKPT

 CKPT 

Activates the Checkpoint/Restart facility for sorts that use the Peerage or Vale
techniques.

Since 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.

Chapter 3. Using DFSORT Program Control Statements 147


OPTION Control Statement

A SORTCKPT DD statement must be coded when you use the


Checkpoint/Restart facility (see SORTCKPT DD Statement on page 74).
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.

| Note: The DFSORT documents only discuss the Language Environment


| run-time library, and assume that COBEXIT=COB2 is in effect. Although
| it is possible to run with older run-time libraries, and with
| COBEXIT=COB1, these are not recommended or discussed, and are not
| supported by IBM service.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
COPY

 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,

148 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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, expanded,
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.

The amount of data space used by DFSORT is limited to the installation or


user-specified DSPSIZE value and by the IEFUSI exit of your system.
DSPSIZE=MAX (IBM-supplied default) means that DFSORT selects the
maximum amount of data space to use based on the size of the input file and
the paging activity of the system. You can further limit the amount of data space
that DFSORT uses by specifying a maximum value in MB.

If the amount of data space DFSORT decides to use is sufficient, DFSORT


sorts your data in main storage and does not require additional temporary work
space. If the amount of data space is not sufficient, DFSORT uses disk as
temporary work space. Installation option DYNAUTO=NO is changed to
DYNAUTO=YES whenever dataspace sorting is possible. Hiperspace is not
used when dataspace sorting is used.
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.
n specifies the maximum amount, in MB, 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 than n
depending on the size of the file being sorted and the paging activity of the
system.
If n is zero, dataspace sorting is not used.

Chapter 3. Using DFSORT Program Control Statements 149


OPTION Control Statement

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
DYNALLOC

 DYNALLOC d 
(d)
(,n)
(d,n)

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 615 for guidelines on the
use of DYNALLOC.
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 3390-9 device (such as
RAMAC) or another high-speed IBM disk device, and avoid specifying a
tape, virtual (VIO), or real 3390-9 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.

| 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


ICEMAC 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 625 for full override details.

150 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

v DYNALLOC can automatically be activated by using the ICEMAC DYNAUTO


option.
v If DYNALLOC is specified without d, the default for d is that specified (or
defaulted) by the ICEMAC DYNALOC option during installation.
v If DYNALLOC is specified without n, the default for n is that specified (or
defaulted) by the ICEMAC DYNALOC option during installation.

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 625.
DYNALLOC=OFF

 DYNALLOC= (OFF) 
OFF

Directs DFSORT not to allocate work space dynamically, overriding that function
of ICEMAC 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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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

Chapter 3. Using DFSORT Program Control Statements 151


OPTION Control Statement

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 27 shows the approximate primary space in cylinders that is
allocated on a 3390 when Blockset sorts an unknown number of 6000-byte
records.
Table 27. Example of DYNSPC Primary Space
DYNSPC value (megabytes) Primary space (cylinders)
32 48
64 93
128 183
256 366
512 732

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 27,
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 531 for more
information.

152 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

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.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
EQUALS or NOEQUALS

 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.

Chapter 3. Using DFSORT Program Control Statements 153


OPTION Control Statement

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.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options.
EXITCK

 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 360.
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options.
FILSZ or SIZE

154 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

 FILSZ= x 
Ex
Ux
SIZE= 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
expected. FILSZ=x or SIZE=y 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 runs, 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 run, DFSORT attempts to automatically compute the file size to be
used for the optimizations and allocations.

The type of FILSZ or SIZE value specified (x/y, Ux/Uy, Ex/Ey, 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 Chapter 9, Improving
Efficiency, on page 563 and File Size and Dynamic Allocation on page 619
for more information on file size considerations.
x or y
specifies the exact number of records to be sorted or merged (x) or the
exact number of records in the input data sets (y). This value is always
used for both the record check and the file size calculations. FILSZ=x or
SIZE=y can be used to force DFSORT to perform file size calculations
based on x or y, and to cause DFSORT to terminate the sort or merge
application if x or y is not exact.
If the FSZEST=NO installation option is in effect and either FILSZ=x or
SIZE=y is specified, DFSORT terminates if the actual number of records is
different from the specified exact value (x or y). In this case, the actual
number of records is placed in the IN field of message ICE047A (or
message ICE054I in some cases) before termination. However, if the
FSZEST=YES installation option is in effect, DFSORT treats FILSZ=x or
SIZE=y like FILSZ=Ex or SIZE=Ey, respectively; it does not terminate when
the actual number of records does not equal x or y.
FILSZ=0 causes Hipersorting, dataspace sorting, and dynamic allocation of
work space not to be used, and results in termination with message
ICE047A unless the number of records sorted or merged is 0. If no E15
user exit is present, SIZE=0 has the same effect in terms of Hipersorting
and dynamic allocation of work space, and results in termination with
message ICE047A unless the number of records in the input data sets is 0.
x specifies the exact number of records to be sorted or merged; it must
take into account the number of records in the input data sets, records

Chapter 3. Using DFSORT Program Control Statements 155


OPTION Control Statement

to be inserted or deleted by 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.
y specifies the exact number of records in the input data sets; it must
take into account the number of records to be deleted by STOPAFT. y
must be changed whenever the number of records in the input data
sets changes in any way.
Limit: 28 digits (15 significant digits)
Ex or Ey
specifies an estimate of the number of records to be sorted (x) or an
estimate of the number of records in the input data sets (y). This value is
not used for the record check. It is used for the file size calculations, but
only if DFSORT could not reasonably estimate the input file size itself. In all
other cases, this value is ignored by DFSORT. See Dynamic Allocation of
Work Data Sets on page 618 for details on exactly when an estimated
record count is used and when it is ignored by DFSORT.
FILSZ=E0 or SIZE=E0 is always ignored.
x specifies an estimate of the number of records to be sorted; it should
take into account the number of records in the input data sets, records
to be inserted or deleted by E15, and records to be deleted by the
INCLUDE/OMIT statement, SKIPREC, and STOPAFT. x should be
changed whenever the number of records to be sorted changes
significantly.
y specifies an estimate of the number of records in the input data sets; it
should take into account the number of records to be deleted by
STOPAFT. y should be changed whenever the number of records in the
input data sets changes significantly.
Limit: 28 digits (15 significant digits)
Ux or Uy
specifies the number of records to be sorted (x) or the number of records in
the input data sets (y). This value is not used for the record check, but is
always used for the file size calculations. FILSZ=Ux or SIZE=Uy can be
used to force DFSORT to perform file size calculations based on x or y,
while avoiding termination if x or y is not exact.
The FSZEST installation option has no effect on FILSZ=Ux or SIZE=Uy
processing.
FILSZ=U0 causes Hipersorting, dataspace sorting, and dynamic allocation
of work space not to be used, and may cause degraded performance or
termination with message ICE046A, if the actual number of records to be
sorted is significantly larger than 0. If no E15 user exit is present, SIZE=U0
has the same effect in terms of Hipersorting, dataspace sorting,and
dynamic allocation of work space, and may cause degraded performance or
termination with message ICE046A, if the actual number of records in the
input data sets is significantly larger than 0.
x specifies the number of records to be sorted; it should take into account
the number of records in the input data sets, records to be inserted or
deleted by E15, and records to be deleted by the INCLUDE/OMIT
statement, SKIPREC, and STOPAFT. x should be changed whenever
the number of records to be sorted changes significantly.

156 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

y specifies the number of records in the input data sets; it should take
into account the number of records to be deleted by STOPAFT. y
should be changed whenever the number of records in the input data
sets changes significantly.
Limit: 28 digits (15 significant digits)

Table 28 summarizes the differences for the three FILSZ variations:


Table 28. FILSZ Variations Summary. FILSZ=n is equivalent to FILSZ=En if installation option FSZEST=YES is
specified.
Conditions FILSZ=n FILSZ=Un FILSZ=En
Number of records Exact Estimate Estimate
Applications Sort, merge Sort Sort
Terminate if n wrong? Yes No No
Use for file size calculation? Yes Yes When DFSORT cannot
compute file size
n includes records:
In input data set(s) Yes Yes Yes
Inserted/deleted by E15 Yes Yes Yes
Inserted by E32 Yes No No
Deleted by Yes Yes Yes
INCLUDE/OMIT
Deleted by SKIPREC Yes Yes Yes
Deleted by STOPAFT Yes Yes Yes
Update n when number of In any way Significantly Significantly
records changes:
Effects of n=0 Hipersorting and Hipersorting and None
DYNALLOC not used DYNALLOC not used

Table 29 summarizes the differences for the three SIZE variations:


Table 29. SIZE Variations Summary. SIZE=n is equivalent to SIZE=En if installation option FSZEST=YES is specified.
Conditions SIZE=n SIZE=Un SIZE=En
Number of records Exact Estimate Estimate
Applications Sort, merge Sort Sort
Terminate if n wrong? Yes No No
Use for file size calculation? Yes Yes When DFSORT cannot
compute file size
n includes records:
In input data set(s) Yes Yes Yes
Inserted/deleted by E15 No No No
Inserted by E32 No No No
Deleted by No No No
INCLUDE/OMIT
Deleted by SKIPREC No No No
Deleted by STOPAFT Yes Yes Yes

Chapter 3. Using DFSORT Program Control Statements 157


OPTION Control Statement

Table 29. SIZE Variations Summary (continued). SIZE=n is equivalent to SIZE=En if installation option FSZEST=YES
is specified.
Conditions SIZE=n SIZE=Un SIZE=En
Update n when number of In any way Significantly Significantly
records changes:
Effects of n=0 Hipersorting and Hipersorting and None
DYNALLOC not used 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.

Default: None; optional. See Appendix B, Specification/Override of DFSORT


Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
HIPRMAX

 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 expanded storage, or in central
storage for 64-bit real mode, 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 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 migrates
it 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 and memory sorting applications further limit
the amount of available storage. A Hipersorting application knows the storage

158 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

needs of every other Hipersorting application on the system. A Hipersorting


application does not try to back its Hiperspace data with storage needed by
| another Hipersorting or memory object sorting application. This prevents
overcommitment of storage resources if multiple large concurrent
| Hipersorting and memory sorting 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 and memory objects. EXPOLD limits
the total amount of old storage that can be used at any one time to back
| DFSORT Hiperspaces and memory objects. EXPRES sets aside a specified
| amount of available storage for use by non-Hipersorting and non-memory
| sorting applications.

| Some of these limits depend on system, and other Hipersorting and memory
| object sorting, activity throughout the time a Hipersorting application runs.
Consequently, the amount of Hiperspace a Hipersorting application uses can
vary from run to run.

HIPRMAX=n specifies a fixed value for HIPRMAX. HIPRMAX=p% specifies a


value for HIPRMAX that varies as a percentage of the configured expanded
storage on the system at run-time. In 64-bit real mode, HIPRMAX=p% specifies
a percentage of an appropriate portion of central storage. If the storage on a
system changes, HIPRMAX=p% will cause a corresponding change in the
HIPRMAX value selected by DFSORT, whereas HIPRMAX=n will not. When
sharing DFSORT installation options between systems, such as in a sysplex,
HIPRMAX=p% can be used to tailor the HIPRMAX value to the system selected
for the application, providing a more dynamic HIPRMAX value than
HIPRMAX=n.

If the amount of Hiperspace available for Hipersorting is insufficient for


temporary storage of the records, intermediate disk storage is used along with
Hiperspace. If the amount of Hiperspace is too small to improve performance,
Hipersorting is not used. DYNAUTO=NO is changed to DYNAUTO=YES for
Hipersorting.

Hipersorting can cause a small CPU time degradation. When CPU optimization
is a concern, you can use HIPRMAX=0 to suppress Hipersorting.

Note: HIPRLIM=OPTIMAL can be used instead of HIPRMAX=OPTIMAL.


HIPRLIM=m can be used instead of HIPRMAX=n. HIPRLIM=m specifies
a Hiperspace limit of m times 4096 bytes rounded up to the nearest
megabyte. m must be a value between 0 and 2559744. If m is 0,
Hipersorting is not used.
OPTIMAL
specifies that DFSORT determines dynamically the maximum amount of
Hiperspace to be used for Hipersorting.
n 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.
p%
specifies that DFSORT determines dynamically the maximum amount of
hiperspace to be used for Hipersorting, subject to a limit of p percent of the

Chapter 3. Using DFSORT Program Control Statements 159


OPTION Control Statement

configured expanded storage. In 64-bit real mode, HIPRMAX=p% specifies


a percentage of an appropriate portion of central storage. p must be a value
between 0 and 100. If p is 0, Hipersorting is not used. The value calculated
for p% is limited to 32767MB, and is rounded down to the nearest MB.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
LIST or NOLIST

 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 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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.

160 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

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

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
LOCALE

 LOCALE= name 
CURRENT
NONE

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.
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.

Chapter 3. Using DFSORT Program Control Statements 161


OPTION Control Statement

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.
NONE 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.
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 CHALT, INREC, an EFS program, or an E61 user exit must not be used.
4. Locale processing for DFSORTs SORT, MERGE, INCLUDE, and OMIT
functions can improve performance relative to applications which perform
pre- and/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.
5. 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 625 for full override details.

Applicable Functions:; See Appendix B, Specification/Override of DFSORT


Options, on page 625.
MAINSIZE

 MAINSIZE= n 
nK
nM
MAX

Temporarily overrides the SIZE installation option, which specifies the amount of
main storage available to DFSORT. The value you specify must be greater than
the MINLIM value set at DFSORT installation time.

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

162 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

v Non-OUTFIL processing storage requirements


v Number of OUTFIL data sets and their attributes (for example, block size).

OUTFIL processing is subject to the ODMAXBF limit and your system storage
limits (for example, IEFUSI) but not to DFSORT storage limits, that is,
SIZE/MAINSIZE, MAXLIM, and TMAXLIM. DFSORT attempts to use storage
above 16MB virtual for OUTFIL processing whenever possible.

For details on main storage allocation, see Tuning Main Storage on page 572.
n specifies that n bytes of storage are to be allocated. If you specify more
that 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.
Limit: 7 digits
nM
specifies that n times 1048576 bytes of storage are to be allocated. If you
specify more than 2000M, 2000M is used.
Limit: 4 digits.
MAX
instructs DFSORT to calculate the amount of virtual storage available and
allocate an amount of storage up to the TMAXLIM or DSA installation value
when Blockset is selected, or up to the MAXLIM installation value when
Blockset is not selected.

Note: CORE=value can be used instead of MAINSIZE=value.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
| MOSIZE

|  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 on
| 64-bit real architecture. 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.

Chapter 3. Using DFSORT Program Control Statements 163


OPTION Control Statement

| Several factors can limit the size of a memory object an application uses:
| 1. The MEMLIMIT parameter on the JOB or EXEC JCL statement can limit the
| total number of usable virtual pages above the bar in a single address
| space.
| 2. The IEFUSI exit can limit the total number of usable virtual pages above the
| bar in a single address space.
| 3. MOSIZE can limit the size of a memory object available to an application,
| as detailed below.
| 4. Sufficient available central storage must be present to back DFSORTs
| memory object.
| The amount of available central storage constantly changes, depending on
| current system activity. Consequently, DFSORT checks the amount of
| available central storage throughout a memory object sorting run and
| switches from using a memory object to using disk work data sets if the
| available central storage is too low.
| 5. Other concurrent Hipersorting and memory object sorting applications
| further limit the amount of available storage. A memory object sorting
| application is aware of the storage needs of every other Hipersorting and
| memory object sorting application on the system, and does not attempt to
| back its memory object with storage needed by another Hipersorting or
| memory object sorting application. This prevents overcommitment of storage
| resources in the event of multiple large concurrent Hipersorting and memory
| object sorting applications starting at similar times on the same system.
| 6. The installation options EXPMAX, EXPOLD, and EXPRES can also be used
| to further limit the amount of storage available to memory object sorting
| applications. EXPMAX limits the total amount of available storage that can
| be used at any one time to back DFSORT Hiperspaces and memory
| objects. EXPOLD limits the total amount of old storage that can be used at
| any one time to back DFSORT hiperspaces and memory objects. EXPRES
| sets aside a specified amount of available storage for use by
| non-Hipersorting and non-memory object sorting applications.

| Some of these limits depend on system, and other Hipersorting and memory
| object sorting, activity throughout the time a memory object sorting application
| runs. Consequently, the size of a memory object a memory object sorting
| application uses can vary from run to run.

| MOSIZE=n specifies a fixed value for MOSIZE. MOSIZE=p% specifies a value


| for MOSIZE that varies as a percentage of the available central storage on the
| system at run-time. If the available central storage on a system changes,
| MOSIZE=p% will cause a corresponding change in the MOSIZE value selected
| by DFSORT, whereas MOSIZE=n will not. When sharing DFSORT installation
| options between systems, such as in a sysplex, MOSIZE=p% can be used to
| tailor the MOSIZE value to the system selected for the application, providing a
| more dynamic MOSIZE value than MOSIZE=n.

| If the size of a memory object is insufficient for temporary storage of the


| records, intermediate disk storage is used along with a memory object. If the
| size of a memory object is too small to improve performance, memory object
| sorting is not used. DYNAUTO=NO is changed to DYNAUTO=YES for memory
| object sorting. Hiperspace and dataspace are not used when memory object
| sorting is used.

164 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

| MAX
| specifies that DFSORT determines dynamically the maximum size of a
| memory object to be used for memory object sorting.
| n specifies that DFSORT determines dynamically the maximum size of a
| memory object to be used for memory object sorting, subject to a limit of
| nMB. n must be a value between 0 and 2147483646. If n is 0, memory
| object sorting is not used.
| p%
| specifies that DFSORT determines dynamically the maximum size of a
| memory object to be used for memory object sorting, subject to a limit of p
| percent of the available central storage. p must be a value between 0 and
| 100. If p is 0, memory object sorting is not used. The value calculated for
| p% is limited to 2147483646MB, and is rounded down to the nearest MB.

| Default: Usually the installation default. See Appendix B, Specification/Override


| of DFSORT Options, on page 625 for full override details.

| Applicable Functions: See Appendix B, Specification/Override of DFSORT


| Options, on page 625.
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
MSGPRT

Chapter 3. Using DFSORT Program Control Statements 165


OPTION Control Statement

 MSGPRT= ALL 
CRITICAL
NONE

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
NOOUTREL

 NOOUTREL 

Temporarily overrides the OUTREL installation option, which specifies whether


unused temporary output data set space is released. NOOUTREL means that
unused temporary output data set space is not released.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

166 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
NOOUTSEC

 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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
NOSTIMER

 NOSTIMER 

Temporarily overrides the STIMER installation option, which specifies whether


DFSORT can use the STIMER macro. NOSTIMER means that DFSORT does
not use the STIMER macro; processor time data does not appear in SMF
records or in statistics provided to the ICETEXIT termination installation exit.

If your exits take checkpoints and STIMER=YES is the installation default, you
must specify this parameter.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
| NULLOUT

|  NULLOUT= RC0 
RC4
RC16
|

| 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.

Chapter 3. Using DFSORT Program Control Statements 167


OPTION Control Statement

| 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.
| 2. NULLOUT does not apply when SORTOUT is not present, when tape work
| data sets are specified for a sort application, or when the Blockset
| technique is not selected for a merge application. DFSORT does not check
| if there are no records for the SORTOUT data set in these cases.
| 3. NULLOUT applies to the SORTOUT data set. NULLOFL on the OUTFIL
| statement applies to OUTFIL data sets.
| 4. For an ICEGENER application, NULLOUT applies to the SYSUT2 data set if
| DFSORT copy is used. Note that ICEGENER passes back return code 12
| instead of return code 16.

| Default: Usually the installation default. See Appendix B, Specification/Override


| of DFSORT Options, on page 625 for full override details.

| Applicable Functions: See Appendix B, Specification/Override of DFSORT


| Options, on page 625.
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. 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

168 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

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.
Limit: 2 digits

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
OVFLO

 OVFLO= RC0 
RC4
RC16

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
PAD

 PAD= RC0 
RC4
RC16

Chapter 3. Using DFSORT Program Control Statements 169


OPTION Control Statement

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.
RC0
specifies that DFSORT should issue message ICE171I, 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.
Notes:
1. The return code of 0 or 4 set for LRECL padding can be overridden by a
higher return code set for some other reason.
2. For an ICEGENER application, the GNPAD value is used and the PAD
value is ignored.
3. For some LRECL padding situations (for example, a tape work data set
sort), DFSORT issues ICE043A and terminates with a return code of 16.
The PAD value has no effect in these cases.
4. DFSORT does not check for LRECL padding if:
a. A SORTIN DD (sort/copy), SORTINnn DD (merge) or SORTOUT DD is
not present
b. A SORTIN DD (sort/copy), SORTINnn DD (merge) or SORTOUT DD
specifies a VSAM data set.
5. DFSORT does not check OUTFIL data sets for LRECL padding.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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. 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.

170 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

RESALL applies only to the amount of main storage below 16MB virtual. The
ARESALL option applies to the amount of main storage above 16MB virtual.
n specifies that n bytes of storage are to be reserved. If you specify less than
4096, 4096 is used.
Limit: 8 digits.
nK
specifies that n times 1024 bytes of storage are to be reserved. If you
specify less than 4K, 4K is used.
Limit: 5 digits.
nM
specifies that n times 1048576 bytes of storage are to be reserved. If you
specify 0M, 4K is used.
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
RESET or NORESET

 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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
RESINV

Chapter 3. Using DFSORT Program Control Statements 171


OPTION Control Statement

 RESINV= n 
nK
nM

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
SDB

 SDB= LARGE 
YES
INPUT
NO

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
non-SMS-managed data sets and results in the most efficient use of space for
the device on which the output data set resides.

172 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

DFSORT can select system-determined optimum block sizes greater than


32760 bytes for tape output data sets.

If you want DFSORT to use system-determined block sizes for disk and tape
output data sets, specify one of the following values:
v SDB=LARGE if you want to allow DFSORT to select tape output block sizes
greater than 32760 bytes.
v SDB=YES (or its alias SDB=SMALL) if you want DFSORT to select tape
output block sizes less than or equal to 32760 bytes.
v SDB=INPUT if you want to allow DFSORT to select tape output block sizes
greater than 32760 bytes only when tape input data sets with block sizes
greater than 32760 bytes are used.

DFSORT will not select a tape output block size greater than the BLKSZLIM in
effect. In particular, if a default BLKSZLIM of 32760 is in effect, DFSORT will
not select a tape output block size greater than 32760 bytes. Therefore, in order
to allow DFSORT to select tape output block sizes greater than 32760 bytes for
particular jobs, you may need to ensure that your JCL or data class supplies
appropriately large BLKSZLIM values (for example, 1GB) for those jobs.

If you dont want DFSORT to use system-determined block sizes, specify


SDB=NO (not recommended as an installation option).
LARGE
specifies that DFSORT is to use the system-determined optimum block size
for an output data set when its block size is zero. SDB=LARGE allows
DFSORT to select a block size greater than 32760 bytes for a tape output
data set, when appropriate. A larger tape block size can improve elapsed
time and tape utilization, but you must ensure that applications which
subsequently use the resulting tape data set can handle larger block sizes.
DFSORT selects the system-determined optimum block size as follows:
v For a disk output data set, the optimum block size for the device used is
selected based on the obtained or derived RECFM and LRECL for the
output data set. The maximum block size for disk output data sets is
32760 bytes.
v For a tape output data set, the optimum block size is selected based on
the obtained or derived RECFM and LRECL for the output data set, as
shown in Figure 13.

RECFM BLKSIZE is set to:


F or FS LRECL
FB or FBS Highest possible multiple of LRECL that is
less than or equal to the optimum block size
for the device, subject to the BLKSZLIM in
effect.
V, D, VS, or DS LRECL + 4
VB, DB, VBS, or DBS Optimum block size for the device, subject to
the BLKSZLIM in effect.

Figure 13. SDB=LARGE Block Sizes for Tape Output Data Sets

Chapter 3. Using DFSORT Program Control Statements 173


OPTION Control Statement

DFSORT uses the system-determined optimum block size for the output
data set in most cases when the block size is zero. However, the following
conditions prevent DFSORT from using the system-determined block size:
v Output data set block size is available (that is, non-zero) in the JFCB
(disk or tape) or format 1 DSCB (disk) or tape label (only for DISP=MOD
with AL, SL, or NSL label, when appropriate)
v Output is a spool, dummy, VSAM, or unmovable data set, or an HFS file.
v The output data set is on tape with a label type of AL
v DFSORTs Blockset technique is not selected.

In the above cases, DFSORT uses the specified block size, or determines
an appropriate (though not necessarily optimum) block size for the output
data set. The selected block size is limited to 32760 bytes.
YES
specifies that DFSORT is to use the system-determined optimum block size
for an output data set when its block size is zero, but is to limit the selected
block size to a maximum of 32760 bytes. See the discussion of
SDB=LARGE for more information; the only difference between
SDB=LARGE and SDB=YES is that SDB=LARGE allows block sizes
greater than 32760 bytes for tape output data sets, whereas SDB=YES
does not.
INPUT
specifies that DFSORT is to use the system-determined optimum block size
for an output data set when its block size is zero, but is to limit the selected
block size to a maximum of 32760 bytes if the input block size is less than
or equal to 32760 bytes. Thus, SDB=INPUT works like SDB=LARGE if the
input block size is greater than 32760 bytes (only possible for tape input
data sets) and works like SDB=YES if the input block size is less than or
equal to 32760 bytes. See the discussions of SDB=LARGE and SDB=YES
for more information.
NO
specifies that DFSORT is not to use the system-determined optimum block
size. When the output data set block size is zero, DFSORT selects an
appropriate (though not necessarily optimum) block size for the output data
set based on the obtained or derived output or input attributes. SDB=NO
limits the selected block sizes to a maximum of 32760 bytes.
SDB=NO works like SDB=YES if the input block size is greater than 32760
bytes (only possible for tape input data sets). See the discussion of
SDB=YES for more information.
Notes:
1. SDB=NO does not prevent the use of system-determined block size for the
output data set at allocation or in other cases where the output data set
block size is set before DFSORT gets control.
2. When DFSORT uses system-determined block size, the selected output
data set block size may be different from the block size selected previously.
Applications that require a specific output data set block size should be
changed to specify that block size explicitly.
3. SDB and SDB=SMALL can be used instead of SDB=YES. NOSDB can be
used instead of SDB=NO.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

174 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
SIZE
See FILSZ.
SKIPREC

 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 313) 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 8.)
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.
FULL
specifies that DFSORT is to produce a full SMF type-16 record for a

Chapter 3. Using DFSORT Program Control Statements 175


OPTION Control Statement

successful run. The full SMF record contains the same information as the
short record, as well as record-length distribution and data set sections, as
appropriate.
NO
specifies that DFSORT is not to produce an SMF type-16 record for this
run.
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.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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
2. The L3 length if specified in the RECORD statement
3. The OUTREC length if the OUTREC statement is specified
4. The INREC length if the INREC statement is specified
5. 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
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:
1. The SORTOUT LRECL if available from the JFCB, format 1 DSCB,
DFSMSrmm, ICETPEX, or tape label
2. The L3 length if specified in the RECORD statement providing an E35
exit, OUTREC statement or INREC statement is present
3. The L2 length if specified in the RECORD statement providing an E15
user exit is present

176 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

4. The SORTIN or SORTINnn LRECL if available from the JFCB, format 1


DSCB, DFSMSrmm, ICETPEX, or tape label
5. The L1 length in the RECORD statement
Notes:
1. With SOLRF in effect (the IBM-supplied default), DFSORT sets the
SORTOUT LRECL to the INREC or OUTREC record length when
appropriate, which is usually what you want when you use INREC or
OUTREC. If you want DFSORT to use the input length for the SORTOUT
LRECL even when INREC or OUTREC is present, you can use NOSOLRF,
but be aware that this can cause padding or truncation of the reformatted
records, or termination.
2. CAOUTREC can be used instead of SOLRF.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
SORTDD

 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.

Default: SORT. See Appendix B, Specification/Override of DFSORT Options,


on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
SORTIN

Chapter 3. Using DFSORT Program Control Statements 177


OPTION Control Statement

 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 SYSIN).
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
SORTOUT

 SORTOUT=ddname 

Specifies a ddname to be associated with the SORTOUT data set. 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 SYSIN).
Notes:
1. SORTOUT is processed only if it is passed on the OPTION control
statement in an extended parameter list or in DFSPARM.
2. If both SORTOUT=ddname and SORTDD=cccc are specified, ddname is
used for the output file. The same ddname cannot be specified for SORTIN
and SORTOUT.
3. If SORTOUT is specified for a conventional merge or for a tape work data
set sort, DFSORT terminates.

Default: SORTOUT, unless SORTDD=cccc is specified, in which case ccccOUT


is the default. See Appendix B, Specification/Override of DFSORT Options, on
page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
SPANINC

178 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

 SPANINC= RC0 
RC4
RC16

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
STOPAFT

 STOPAFT=n 

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

Chapter 3. Using DFSORT Program Control Statements 179


OPTION Control Statement

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 INCLUDE and OMIT
fields and constants, 0 compares as less than +0.
| v For editing and conversions of INREC, OUTREC and OUTFIL OUTREC
| 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:
v For collation of SORT and MERGE fields, 0 collates equally with +0.
v For comparisons of INCLUDE, OMIT and OUTFIL INCLUDE and OMIT
fields and constants, 0 compares as equal to +0.
| v For editing and conversions of INREC, OUTREC and OUTFIL OUTREC
| fields, decimal constants, and the results of arithmetic expressions, 0
| and +0 are treated as positive.
v For minimums and maximums of OUTFIL TRAILERx fields, 0 and +0
are treated as positive.

Note: OPTION SZERO or OPTION NOSZERO is ignored for OUTFIL


INCLUDE=(...) or OUTFIL OMIT=(...) if the OPTION statement is
found after the OUTFIL statement. To avoid this, specify SZERO
or NOSZERO as an EXEC/DFSPARM PARM option, or in an
OPTION statement before the OUTFIL statement in the same
source, for example:
//SYSIN DD *
OPTION NOSZERO,COPY
OUTFIL INCLUDE=(...)
/*

Default: Usually, the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

180 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
TRUNC

 TRUNC= RC0 
RC4
RC16

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.
Notes:
1. The return code of 0 or 4 set for LRECL truncation can be overridden by a
higher return code set for some other reason.
2. For an ICEGENER application, the GNTRUNC value is used and the
TRUNC value is ignored.
3. For some LRECL truncation situations (for example, a tape work data set
sort), DFSORT issues ICE043A and terminates with a return code of 16.
The TRUNC value has no effect in these cases.
4. DFSORT does not check for LRECL truncation if:
a. A SORTIN DD (sort/copy), SORTINnn DD (merge) or SORTOUT DD is
not present
b. A SORTIN DD (sort/copy), SORTINnn DD (merge) or SORTOUT DD
specifies a VSAM data set.
5. DFSORT does not check OUTFIL data sets for LRECL truncation.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
USEWKDD

 USEWKDD 

Chapter 3. Using DFSORT Program Control Statements 181


OPTION Control Statement

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 625 for full override details.

Applicable Function: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.
NOVERIFY
specifies that sequence checking is not performed.
Notes:
1. Using VERIFY can degrade performance.
2. SEQ=YES can be used instead of VERIFY, SEQ=NO can be used instead
of NOVERIFY.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
VLLONG or NOVLLONG

 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
specifies that DFSORT truncates long variable-length output records to the
LRECL of the SORTOUT or OUTFIL data set.

182 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

NOVLLONG
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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 zeros. 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. VLSCMP
and NOVLSCMP apply to the INCLUDE and OMIT statements and to the
INCLUDE and OMIT parameters of the OUTFIL statement.

The compare fields are only padded temporarily for testing; they are not actually
changed for output.

VLSCMP is not meaningful for fixed-length record processing.

The settings for VLSCMP/NOVLSCMP and VLSHRT/NOVLSHRT provide three


levels of processing for short INCLUDE/OMIT fields in the following hierarchy:
1. VLSCMP allows all of the INCLUDE/OMIT comparisons to be performed
even if some fields are short. Since short fields are padded with binary
zeros, comparisons involving short fields are false (unless a test against
binary zero is relevant, as discussed below). Comparisons involving
non-short fields can be true or false.
2. NOVLSCMP and VLSHRT treat the entire INCLUDE/OMIT logical
expression as false if any field is short. Thus comparisons involving
non-short fields are ignored if any comparison involves a short field.
3. NOVLSCMP and NOVLSHRT result in termination if any field is short.

To illustrate how this works, suppose the following INCLUDE statement is used:
INCLUDE COND=(6,1,CH,EQ,C1,OR,70,2,CH,EQ,CT1)

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

Chapter 3. Using DFSORT Program Control Statements 183


OPTION Control Statement

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,CJX,OR,
(55,2,CH,EQ,58,2,CH,AND,
70,1,BI,LT,X08))

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
bytes 55-56 equal to 58-59 true and the comparison of byte 70 less than X08
true even though all three fields are short and probably irrelevant.

In such cases where padding of short fields with binary zeros may result in
unwanted true comparisons, you can get the result you want by adding an
appropriate check of the record length to the INCLUDE/OMIT logical
expression, such as:
INCLUDE COND=(21,2,CH,EQ,CJX,OR,
(1,2,BI,GE,X0046,AND,
55,2,CH,EQ,58,2,CH,AND,
70,1,BI,LT,X08))

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
specifies that short variable-length compare fields are padded with binary
zeros.
NOVLSCMP
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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

184 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

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.
Notes:
1. VLSHRT is not used if an INREC or OUTREC statement is specified, if you
have an EFS01 or EFS02 routine, or if locale processing is used for SORT
or MERGE fields. Note that none of these situations prevents the use of
VLSCMP.
2. Unlike the OUTREC statement, the OUTREC parameter of the OUTFIL
statement does not force NOVLSHRT. Thus, you can use VLSHRT with
OUTFIL to eliminate records with the INCLUDE or OMIT parameter and
reformat the remaining records with the OUTREC parameter. If a short
OUTFIL OUTREC field is found, DFSORT terminates (even if VLSHRT is in
effect) unless the VLFILL=byte parameter of OUTFIL is specified.
3. If VLSHRT is in effect and Blockset is selected:
v DFSORT pads short SORT or MERGE control fields with binary zeros,
thus making the order predictable for records with equal control fields of
different lengths. The control fields are only padded temporarily for
collation; they are not actually changed for output. Padding may increase
the amount of work space required.
v Records with short SUM summary fields are excluded from summation;
that is, if either one of a pair of records being summed has a short SUM
field, the records are left unsummed and neither record is deleted.
4. If VLSHRT is in effect and Blockset is not selected:
v DFSORT terminates if the first byte of the first (major) SORT or MERGE
control field is not included in the record.
v DFSORT does not pad short SORT or MERGE control fields, thus
making the order unpredictable for records with equal control fields of
different lengths.

Chapter 3. Using DFSORT Program Control Statements 185


OPTION Control Statement

v In certain cases, VLSHRT is not used because of the number and


position of the SORT or MERGE control fields.
v EQUALS is not used.

| Tip: You can use a SORTDIAG DD statement to force message ICE800I,


| which gives a code indicating why Blockset could not be used.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
VSAMIO or NOVSAMIO

 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.

186 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
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.
Notes:
1. If you have dedicated certain volumes for SORTWKdd data sets, and you
do not want unused temporary space to be released, you should specify
NOWRKREL.
2. If WRKREL is in effect, DFSORT releases space for the SORTWKdd data
sets just prior to termination. Space is released only for those SORTWKdd
data sets that were used for the sort application.
3. RLS=0 can be used instead of NOWRKREL. RLS=n (n greater than 0) can
be used instead of WRKREL.

Default: Usually the installation default. See Appendix B, Specification/Override


of DFSORT Options, on page 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
WRKSEC or NOWRKSEC

 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.

Chapter 3. Using DFSORT Program Control Statements 187


OPTION Control Statement

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 625 for full override details.

Applicable Functions: See Appendix B, Specification/Override of DFSORT


Options, on page 625.
Y2PAST

 Y2PAST= s 
f

Temporarily overrides the Y2PAST installation option, which specifies the sliding
(s) or fixed (f) century window. The century window is used with DFSORTs Y2
formats to correctly interpret two-digit year data values as four-digit year data
values.
s specifies the number of years DFSORT is to subtract from the current year
to set the beginning of the sliding century window. Since the Y2PAST value
is subtracted from the current year, the century window slides as the current
year changes. For example, Y2PAST=81 would set a century window of
1915-2014 in 1996 and 1916-2015 in 1997. s must be a value between 0
and 100.
f specifies the beginning of the fixed century window. For example,
Y2PAST=1 would set a century window of 1962-2061. f must be a value
between 1000 and 3000.

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 625 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 307 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).

188 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

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 625 for full override details.

Applicable Function: See Appendix B, Specification/Override of DFSORT


Options, on page 625.

Aliases for OPTION Statement Options


For compatibility reasons, the following OPTION statement options can be specified
by using the aliases listed below. See the indicated OPTION statement options for
complete details.
Table 30. Aliases for OPTION Statement Options
Alias OPTION Statement Option
CAOUTREC SOLRF
CENTURY=value Y2PAST=value
CENTWIN=value Y2PAST=value
CHKPT CKPT
CORE=value MAINSIZE=value
HIPRLIM=value HIPRMAX=value
L5=value AVGRLEN=value
NOSDB SDB=NO
PRINT=value MSGPRT=value
RLS=n WRKREL
RLS=0 NOWRKREL
SDB SDB=YES
SDB=SMALL SDB=YES
SEC=n WRKSEC
SEC=0 NOWRKSEC
SEQ=YES VERIFY
SEQ=NO NOVERIFY
ZDPRINT=YES ZDPRINT
ZDPRINT=NO NZDPRINT

Specifying DFSORT Options or COPYExamples


Example 1
SORT FIELDS=(1,20,CH,A)
OPTION SIZE=50000,SKIPREC=5,EQUALS,DYNALLOC

Chapter 3. Using DFSORT Program Control Statements 189


OPTION Control Statement

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

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.
CKPT
DFSORT takes checkpoints during this run.

Note: CKPT is ignored if the Blockset technique is used. If checkpoints are


required, you must bypass the Blockset technique by specifying the
NOBLKSET option, or by specifying IGNCKPT=NO on the ICEMAC
installation macro. However, functions such as OUTFIL, which are
supported only by the Blockset technique, cannot be used if the
Checkpoint/Restart facility is used.
EQUALS
The sequence of records that collate identically is preserved from input to
output.
NOCHALT
Only AQ fields are translated through the ALTSEQ translate table. If
CHALT=YES was specified during installation, then NOCHALT temporarily
overrides it.
NOVERIFY
No sequence check is performed on the final output records.
CHECK
The record count is checked at the end of program processing.

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.

190 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

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

STOPAFT
DFSORT accepts 100 records before sorting or copying.

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-supplied 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.

Chapter 3. Using DFSORT Program Control Statements 191


OPTION Control Statement

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-supplied 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.
SORTOUT=MYOUTPUT
The ddname MYOUTPUT is used to reference the output data set.
NOLIST
Control statements are not printed.

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.

192 z/OS V1R5.0 DFSORT Application Programming Guide


OPTION Control Statement

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.

Chapter 3. Using DFSORT Program Control Statements 193


OUTFIL Control Statements

OUTFIL Control Statements

| ,

 OUTFIL E FNAMES= ddname 


,

( E ddname )
FILES= suffix
,

( E suffix )
STARTREC=n
ENDREC=n
SAMPLE= n
(n,m)
INCLUDE= ( logical expression )
ALL
NONE
OMIT= ( logical expression )
ALL
NONE
SAVE
,

OUTREC= ( E field )
,VTOF ,VLFILL=byte
,CONVERT
FTOV
VLTRIM=byte
REPEAT=n
SPLIT
SPLITBY=n
NULLOFL= RC0
RC4
RC16
LINES=n
,

HEADER1= ( E field )
,

TRAILER1= ( E field )
,

HEADER2= ( E field )
,

TRAILER2= ( E field )
,

SECTIONS= ( E field )
NODETAIL
REMOVECC

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

194 z/OS V1R5.0 DFSORT Application Programming Guide


OUTFIL Control Statements

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 Insertion of blanks, zeros, strings, current 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 hexadecimal display, conversion of
EBCDIC letters from lowercase to uppercase or uppercase to lowercase,
conversion of characters using the ALTSEQ translation table, and conversion of
numeric values from one format to another.
v Sophisticated editing capabilities, such as control of the way numeric fields are
prsented with respect to length, leading or suppressed zeros, thousands
separators, decimal points, leading and trailing positive and negative signs, and
so on.
v 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 date and time values to more usable forms.
v Transformation 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 or hexadecimal string for output from a lookup table,
based on a character, hexadecimal, or bit string as input (that is, lookup and
change).
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, page
number, character strings, and blank lines) or derive from the input records (for
example, character fields; edited numeric input fields; record counts; and edited
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.
| v Splitting of data records in rotation among a set of output data sets.

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

Chapter 3. Using DFSORT Program Control Statements 195


OUTFIL Control Statements

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
specified for a particular OUTFIL statement are processed in a similar way and
thus are referred to as an OUTFIL group. (That is, you group OUTFIL data sets
that use the same operands by specifying them on a single OUTFIL statement.)
For example, the first OUTFIL statement might have an INCLUDE operand that
applies to an OUTFIL group of one non-VSAM data set on disk and another on
tape; a second OUTFIL statement might have OMIT and OUTREC operands that
apply to an OUTFIL group of one non-VSAM data set on disk and two VSAM
data sets.
Records are processed for OUTFIL as they are for SORTOUT, after all other
DFSORT processing is complete. Conceptually, you can think of an OUTFIL
input record as being intercepted at the point between being passed from an
E35 exit and written to SORTOUT, although neither an E35 exit nor SORTOUT
need actually be specified with OUTFIL processing. With that in mind, see
Figure 2 on page 8 for details on the processing that occurs prior to processing
the OUTFIL input record. In particular:
Records deleted by an E15 or E35 exit, an INCLUDE, OMIT or SUM
statement, or the SKIPREC or STOPAFT parameter are not available for
OUTFIL processing
If records are reformatted by an E15 exit, an INREC or OUTREC statement,
or an E35 exit, the resulting reformatted record is the OUTFIL input record to
which OUTFIL fields must refer.
v STARTREC starts processing for an OUTFIL group at a specific OUTFIL input
record. ENDREC ends processing for an OUTFIL group at a specific OUTFIL
| input record. SAMPLE selects a sample of OUTFIL input records for an OUTFIL
group using a specific interval and number of records in that interval. Separately
or together, STARTREC, ENDREC, and SAMPLE select a range of records to
| which subsequent OUTFIL processing will apply.
v INCLUDE, OMIT, and SAVE select the records to be included in the data sets of
an OUTFIL group. INCLUDE and OMIT operate against the specified fields of
each OUTFIL input record to select the output records for their OUTFIL group (all
records are selected by default). SAVE selects the records that are not selected
for any other OUTFIL group.
Whereas the INCLUDE and OMIT statements apply to all input records, the
INCLUDE and OMIT parameters apply only to the OUTFIL input records for their
OUTFIL group. The INCLUDE and OMIT parameters have all of the logical
expression capabilities of the INCLUDE and OMIT statements.

196 z/OS V1R5.0 DFSORT Application Programming Guide


OUTFIL Control Statements

v OUTREC reformats the output records for an OUTFIL group. OUTREC enables
you to rearrange, edit, and change the fields of the OUTFIL input records and to
| insert blanks, zeros, strings, current date, current time, sequence numbers,
| decimal constants, and the results of arithmetic expressions.
OUTREC also enables you to produce multiple reformatted output records from
each input record, with or without intervening blank output records.
VTOF or CONVERT can be used with OUTREC to convert variable-length input
records to fixed-length output records.
VLFILL can be used to allow processing of variable-length input records which
are too short to contain all specified OUTREC fields
Whereas the OUTREC statement applies to all input records, the OUTREC
parameter applies only to the OUTFIL input records for its OUTFIL group. In
addition, the OUTREC parameter supports the forward slash (/) separator for
creating blank records and new records, whereas the OUTREC statement does
not.
v FTOV can be used to convert fixed-length input records to variable-length output
records. FTOV can be used with or without OUTREC.
v VLTRIM can be used to remove the trailing bytes with a specified value, such as
blanks, binary zeros or asterisks, from variable-length records. VLTRIM can be
used with or without FTOV.
| v REPEAT can be used to repeat each output record a specified number of times.
| v SPLIT or SPLITBY splits the output records in rotation among the data sets of
| an OUTFIL group.
| With SPLIT, the first output record is written to the first OUTFIL data set in the
| group, the second output record is written to the second data set, and so on.
| When each OUTFIL data set has one record, the rotation starts again with the
| first OUTFIL data set.
| SPLITBY can be used to rotate by a specified number of records rather than by
| one record, for example, records 1-10 to the first OUTFIL data set, records 11-20
| to the second OUTFIL data set, and so on.
v LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS , and
NODETAIL indicate that a report is to be produced for an OUTFIL group, and
specify the details of the report records to be produced for the report. Reports
can contain report records for a report header (first page), report trailer (last
page), page header and page trailer (at the top and bottom of each page,
respectively), and section headers and trailers (before and after each section,
respectively).
Data records for the report result from the inclusion of OUTFIL input records. All
of the capabilities of the OUTREC parameter are available to create reformatted
data records from the OUTFIL input records. Each set of sequential OUTFIL
input records, with the same binary value for a specified field, results in a
corresponding set of data records that is treated as a section in the report.
The length for the data records must be equal to or greater than the maximum
report record length. OUTFIL data sets used for reports must have or will be
given ANSI control character format ('A' as in, for example, RECFM=FBA or
RECFM=VBA), and must allow an extra byte in the LRECL for the carriage
control character that DFSORT will add to each report and data record. DFSORT
uses these carriage control characters to control page ejects and the placement
of the lines in your report according to your specifications. DFSORT uses
appropriate carriage controls (for example, C'-' for triple space) in header and
trailer records when possible, to reduce the number of report records written.
DFSORT always uses the single space carriage control (C' ') in data records.

Chapter 3. Using DFSORT Program Control Statements 197


OUTFIL Control Statements

Although these carriage control characters may not be shown when you view an
OUTFIL data set (depending upon how you view it), they will be used if you print
the report.
v REMOVECC can be used to remove the ANSI control characters from a report.
In this case, an 'A' is not added to or required for the RECFM and an extra byte
is not added to or required for the LRECL.
v Figure 14 illustrates the order in which OUTFIL records and parameters are
processed.

|
OUTFIL input records

OUTFIL STARTREC
OUTFIL SAMPLE
OUTFIL ENDREC

OUTFIL INCLUDE
OUTFIL OMIT
OUTFIL SAVE

OUTFIL OUTREC
OUTFIL FTOV
OUTFIL VTOF or
CONVERT
OUTFIL VLFILL
OUTFIL VLTRIM
OUTFIL REPEAT
OUTFIL Reports

OUTFIL SPLIT
OUTFIL SPLITBY

OUTFIL Data Sets

|
| Figure 14. OUTFIL Processing Order
|
Notes:
1. DFSORT accepts but does not process the following OUTFIL operands:
BLKSIZE=value, BUFLIM=value, BUFOFF=value, CARDS=value,
CLOSE=value, DISK, ESDS, EXIT, FREEOUT, KSDS, LRECL=value, NOTPMK,
OPEN=value, OUTPUT, PAGES=value, PRINT, PUNCH, REUSE, RRDS, SPAN,
SYSLST, TAPE, and TOL.
2. Sample syntax is shown throughout this section. Complete OUTFIL statement
examples are shown and explained under OUTFIL FeaturesExamples on
page 265.
FNAMES

198 z/OS V1R5.0 DFSORT Application Programming Guide


OUTFIL Control Statements

 FNAMES= ddname 
,

( E 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 SORTOUT, name from SORTOUT=name, or
ccccOUT from SORTDD=cccc), 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 SORTOUT or ccccOUT if SORTDD=cccc is in
effect.
FILES

 FILES= d 
dd
OUT
,

( E 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
parameters constitute the output data sets for this OUTFIL group to which all of
the other parameters for this OUTFIL statement apply.

If FILES specifies the ddname in effect for the SORTOUT data set (that is,
whichever is in effect among SORTOUT, name from SORTOUT=name, or
ccccOUT from SORTDD=cccc), DFSORT will treat the data set associated with
that ddname as an OUTFIL data set rather than as the SORTOUT data set.
d specifies the 1-character suffix to be used to form the ddname SORTOFd or
ccccOFd if SORTDD=cccc is in effect. A DD statement must be present for
this ddname.
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.

Chapter 3. Using DFSORT Program Control Statements 199


OUTFIL Control Statements

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 SORTOUT or ccccOUT if 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

Default for STARTREC: 1.


ENDREC

 ENDREC=n 

Specifies the OUTFIL input record at which OUTFIL processing is to end for this
OUTFIL group. OUTFIL input records after this ending record are not included
in the data sets for this OUTFIL group.

The ENDREC value must be equal to or greater than the STARTREC value if
both are specified on the same OUTREC statement.
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=TOP10,ENDREC=10
OUTFIL FNAMES=FRONT,ENDREC=500
OUTFIL FNAMES=MIDDLE,STARTREC=501,ENDREC=2205
OUTFIL FNAMES=BACK,STARTREC=2206

Default for ENDREC: The last OUTFIL input record.


| SAMPLE

|  SAMPLE= n 
(n,m)

200 z/OS V1R5.0 DFSORT Application Programming Guide


OUTFIL Control Statements

| 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 specifies the interval size. The value for n starts at 2 (sample every other
| record) and is limited to 28 digits (15 significant digits).
| m 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)

| Default for SAMPLE: None; must be specified.


INCLUDE

 INCLUDE= (logical expression) 


ALL
(ALL)
NONE
(NONE)

Selects the records to be included in the data sets for this OUTFIL group.

The INCLUDE parameter operates in the same way as the INCLUDE


statement, except that:
v The INCLUDE statement applies to all input records; the INCLUDE
parameter applies only to the OUTFIL input records for its OUTFIL group.
| v FORMAT=f can be specified with the INCLUDE statement, but not with the
| INCLUDE parameter. Thus, you can use FORMAT=f and p,m or p,m,f fields
| with the INCLUDE statement, but you must only use p,m,f fields with the
| INCLUDE parameter. For example:
| INCLUDE FORMAT=BI,
| COND=(5,4,LT,11,4,OR,21,4,EQ,31,4,OR,
| 61,20,SS,EQ,CFLY)
|
| OUTFIL INCLUDE=(5,4,BI,LT,11,4,BI,OR,21,4,BI,EQ,31,4,BI,OR,
| 61,20,SS,EQ,CFLY)
v D2 format can be specified with the INCLUDE statement, but not with the
INCLUDE parameter.

See INCLUDE Control Statement on page 96 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.

Chapter 3. Using DFSORT Program Control Statements 201


OUTFIL Control Statements

ALL or (ALL)
specifies that all of the OUTFIL input records are to be included in the data
sets for this OUTFIL group.
NONE or (NONE)
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,CJ69)
OUTFIL FNAMES=J82,INCLUDE=(5,3,CH,EQ,CJ82)

Default for INCLUDE: ALL.


OMIT

 OMIT= (logical expression) 


ALL
(ALL)
NONE
(NONE)

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:
| OMIT FORMAT=BI,
| COND=(5,4,LT,11,4,OR,21,4,EQ,31,4,OR,
| 61,20,SS,EQ,CFLY)
|
| OUTFIL OMIT=(5,4,BI,LT,11,4,BI,OR,21,4,BI,EQ,31,4,BI,OR,
| 61,20,SS,EQ,CFLY)
v The D2 format can be specified with the OMIT statement, but not with the
OMIT parameter.

See OMIT Control Statement on page 139 and INCLUDE Control Statement
on page 96 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 or (ALL)
specifies that all of the OUTFIL input records are to be omitted from the
data sets for this OUTFIL group.
NONE or (NONE)
specifies that none of the OUTFIL input records are to be omitted from the
data sets for this OUTFIL group.
Sample Syntax:

202 z/OS V1R5.0 DFSORT Application Programming Guide


OUTFIL Control Statements

OUTFIL FILES=01,OMIT=NONE
OUTFIL OMIT=(5,1,BI,EQ,B110.....)
OUTFIL FNAMES=(OUT1,OUT2),
OMIT=(7,2,CH,EQ,C32,OR,18,3,CH,EQ,CXYZ)

Default for OMIT: NONE.


SAVE

 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,CACCTNG),FNAMES=GP1
OUTFIL INCLUDE=(8,6,CH,EQ,CDVPMNT),FNAMES=GP2
OUTFIL SAVE,FNAMES=NOT1OR2

Default for SAVE: None; must be specified.


OUTREC

| ,

 OUTREC= ( E s ) 
c: p,m
,a
p
p,m,HEX
p,HEX
p,m,TRAN=LTOU
p,TRAN=LTOU
p,m,TRAN=UTOL
p,TRAN=UTOL
p,m,TRAN=ALTSEQ
p,TRAN=ALTSEQ
p,m,Y2x
p,m,Y2x(c)
p,m,Y2xP
p,m,f ,edit
(p,m,f) ,to
deccon ,edit
(deccon) ,to
arexp ,edit
(arexp) ,to
p,m,Y2x ,edit
,to
p,m,lookup
seqnum

Specifies how the records in the data sets for this OUTFIL group are to be
reformatted. OUTREC can define which parts of the OUTFIL input record are
included in the reformatted OUTFIL output record, in what order the parts

Chapter 3. Using DFSORT Program Control Statements 203


OUTFIL Control Statements

appear, how they are aligned, and how they are edited or changed. You can
also insert separation fields (blanks, zeros, strings, current date and current
| time), sequence numbers, decimal constants, and the results of arithmetic
| expressions before, between, and after the input fields, and produce multiple
reformatted output records for each input record, with or without intervening
blank output records.

You can use the 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 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 OUTREC fields.

The OUTREC parameter can be used with any or all of the report parameters
(LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS, and
NODETAIL) to produce reports. The report parameters specify the report
records to be produced, while the 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 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.