DFSORT Application Programming Guide V1R5
DFSORT Application Programming Guide V1R5
SC26-7523-00
z/OS
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.
Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
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
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
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
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
Programming Interface Information . . . . . . . . . . . . . . . . . 680
Trademarks. . . . . . . . . . . . . . . . . . . . . . . . . . 680
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
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
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.
You can use LookAt from the following locations to find IBM message explanations
for z/OS elements and features, z/VM, and VSE:
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.
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
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.
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.
Required
Optional
v Where you can make one choice between two or more parameters, the
alternatives are stacked vertically.
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
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.
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.
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.
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.
The IBM-supplied default for ICEMAC option ZDPRINT has been changed from NO
to YES.
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 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.
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.
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.
The maximum length for an SS field used with INCLUDE and OMIT has been
raised to 32752.
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.
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.
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 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.
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 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).
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.
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 SKIP=0L option of OUTFIL SECTIONS allows you to suppress blank lines
between sections on the same page.
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 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).
The maximum length for an AQ or AC field used with SORT and MERGE has been
raised to 4092.
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.
DFSORT now issues message ICE042A and terminates if the QNAME option is
specified on an output DD statement.
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).
Merging records first requires that the input data sets are identically sorted for the
information you will use to merge them and that they are in the same order required
for output. You can merge up to 100 different data sets at a time.
In addition to the three basic functions, you can perform other processing
simultaneously:
You can control which records to keep in the final output data set of a DFSORT
run by using INCLUDE and OMIT statements in your application. These statements
work like filters, testing each record against criteria that you supply and retaining
only the ones you want for the output data set. For example, you might choose to
work only with records that have a value of Kuala Lumpur in the field reserved for
office location. Or perhaps you want to leave out any record dated after 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.
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 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.
Invoking DFSORT
You can invoke DFSORT processing in the following ways:
v With an EXEC job control statement in the input stream using the name of the
program (for example, PGM=ICEMAN or PGM=SORT) or the name of a
cataloged procedure (for example, SORTD). See Chapter 2, Invoking DFSORT
with Job Control Language, on page 25.
TSO users can allocate the needed ddnames (for example, SYSOUT, SORTIN,
SORTOUT and SYSIN), and invoke DFSORT using a calling method equivalent
to PGM=ICEMAN. For example:
call *(iceman)
| or any other alias for DFSORT (for example, SORT) in this form.
See Chapter 10, Examples of DFSORT Job Streams, on page 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.
The Blockset technique is DFSORTs most efficient technique for sorting, merging
and copying data sets. DFSORT uses the Blockset technique whenever possible to
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 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,
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
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.
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.
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.
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.
SORTIN SORTINnn
SKIPREC
INCLUDE / OMIT
INREC INREC
SORT / SUM
or MERGE / SUM
COPY
OUTREC OUTREC
|
| Figure 2. Record Processing Order
|
As shown in Figure 2, DFSORT processing follows this order:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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
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
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.
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 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.
If possible and appropriate, remove the obstacle that is causing Blockset not to be
selected.
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.
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
//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.
, other parameters
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.
When you specify EXEC PROC=SORT or EXEC SORT, the following JCL
statements are generated:
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
When you specify EXEC PROC=SORTD or EXEC SORTD, the following JCL
statements are generated:
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
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.
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.
| ,
,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
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
WRKREL
NOWRKREL
WRKSEC
NOWRKSEC
Y2PAST= s
f
ZDPRINT
NZDPRINT
ABEND or NOABEND
ABEND
NOABEND
ARESALL= n
nK
nM
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.
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).
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.
CINV or NOCINV
CINV
NOCINV
COBEXIT= COB1
COB2
DSPSIZE
DSPSIZE= MAX
n
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
DYNALLOC
= (OFF)
OFF
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.
EFS= name
NONE
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.
EQUALS
NOEQUALS
E15=COB
Specifies that your E15 routine is written in COBOL and temporarily overrides
the MODS statement for E15. If you specify E15=COB but do not identify an
E15 module with a MODS statement, the E15=COB is ignored.
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.
FILSZ= x
Ex
Ux
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
HIPRMAX= OPTIMAL
n
p%
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.
LIST
NOLIST
LISTX
NOLISTX
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.
LOCALE= name
CURRENT
NONE
| 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.
MSGDDN=ddname
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.
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.
| 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.
ODMAXBF= n
nK
nM
Limit: 2 digits
OUTREL
NOOUTREL
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.
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.
RESALL= n
nK
nM
RESET
NORESET
Note: A VSAM output data set defined without REUSE is processed as a MOD
data set.
SDB= LARGE
YES
INPUT
NO
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.
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
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.
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).
SOLRF
NOSOLRF
SPANINC= RC0
RC4
RC16
STIMER
NOSTIMER
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.
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.
SZERO
NOSZERO
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.
VERIFY
NOVERIFY
VLLONG
NOVLLONG
VLSCMP
NOVLSCMP
VLSHRT
NOVLSHRT
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.
VSAMEMT
NVSAMEMT
VSAMIO
NOVSAMIO
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.
WRKREL
NOWRKREL
WRKSEC
NOWRKSEC
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.
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.
ZDPRINT
NZDPRINT
ZDPRINT
means convert positive ZD summation results to printable numbers.
NZDPRINT
means do not convert positive ZD summation results to printable numbers.
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).
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.
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.
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.
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 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.
//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
SORTLIB DD Statement
The SORTLIB DD statement can usually be omitted. This statement describes the
data set that contains special DFSORT load modules.
//SORTLIB DD DSNAME=USORTLIB,DISP=SHR
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.
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.
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.
//SORTIN DD DSNAME=INPUT,DISP=SHR
//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.
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.
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.
//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)
//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.
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.
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.
//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)
//SORTWK01 DD UNIT=3480,LABEL=(,NL)
//SORTWK02 DD UNIT=3480,LABEL=(,NL)
//SORTWK03 DD UNIT=3480,LABEL=(,NL)
These parameters specify unlabeled data sets on three 3480 tape units. Because
the DSNAME parameters are omitted, the system assigns unique names.
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.
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.
Reblockable Indicator: DFSORT sets the reblockable indicator in the output data
set label when:
v See the discussion of the SOLRF and NOSOLRF options in OPTION Control
Statement on page 142 for information related to the SORTOUT LRECL.
//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.
//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.
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.
//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.
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
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).
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.
//DFSPARM DD *
SORT FIELDS=(1,2,CH,A),STOPAFT=300
ABEND
OPTION SORTIN=DATAIN
STOPAFT=500
In this example the DFSPARM DD data set passes a DFSORT SORT statement,
the ABEND and STOPAFT parameters equivalent to specifying
PARM='ABEND,STOPAFT=500' in a JCL EXEC statement, and a DFSORT
OPTION statement.
Notes:
1. SORT and OPTION are control statements. ABEND and STOPAFT=500 are
PARM options.
2. The PARM option STOPAFT=500 overrides the SORT control statement option
STOPAFT=300.
| 3. When PARMDDN=DFSPARM is specified or defaulted:
| v if a //DFSPARM DD data set is available at run-time, DFSORT will use it
| v if a //DFSPARM DD data set is not available at run-time, DFSORT will use a
| //$ORTPARM DD data set if available.
//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.
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.
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.
//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.
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
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
This chapter begins with a summary of DFSORT program control statements and
coding rules. A detailed description of each statement follows.
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.
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.
72 73 80
(Continuation column)
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).
SORT EQUALS,FORMAT=CH,FIELDS=(10,30,A)
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)
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.
| 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)
| 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)
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).
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.
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).
CODE=( E fftt )
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.
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)
Example 5
OPTION COPY
ALTSEQ CODE=(0040)
OUTREC FIELDS=(1,80,TRAN=ALTSEQ)
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
NOABEND
Specifies that an unsuccessful sort, copy, or merge terminates with a return
code of 16.
BSAM
Temporarily bypasses the EXCP access method for input and output data sets.
BSAM is ignored for VSAM input and output data sets.
CFW
NOCFW
NOCFW
Specifies that DFSORT cannot use cache fast write.
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).
EFSDPAFT=( E n )
Initiates a SNAP dump after a Major Call to an EFS program. Any combination
of the numbers can be specified.
EFSDPBFR
EFSDPBFR=( E n )
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.
ESTAE
NOESTAE
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.
NOASSIST
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
When you link-edit user exit routines dynamically, the END statement marks the
end of the DFSORT control statements and the beginning of exit routine object
decks in SYSIN.
Because the OPTION statement appears after the END statement, it is not read.
Example 2
//SYSIN DD *
SORT FIELDS=(5,8,CH,A)
MODS E15=(E15,1024,SYSIN,T)
END
object deck for E15 user exit here
The END statement precedes the E15 user exit routine object deck in SYSIN.
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.
relational condition1
.
If the logical expression is true for a given record, the record is included in the
output data set.
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
logical expression
specifies one or more relational conditions logically combined, based on
fields in the input record. If the logical expression is true for a given
record, the record is included in the output data sets.
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.
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.
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.
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
| (p1,m1, EQ , p2,m2 )
f1, NE ,f2
GT constant
GE
LT
LE
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.
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.
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
Decimal Number Format: The format for coding a decimal constant is:
[]n
Character String Format: The format for coding a character string constant is:
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:
| 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.
Character and hexadecimal strings are truncated and padded on the right.
Decimal constants are padded and truncated on the left. Padding is done with zeros
in the proper format.
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.
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)
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
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)))
| 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))
compare compare
RDW field A field B
T1
7 10
compare compare
RDW field C field D
T2
7 20 25
Example 5
INCLUDE COND=(21,8,ZD,GT,DATE1P)
(p1,m1,SS, EQ , constant )
NE
| (p1,m1, EQ , constant )
SS, NE
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.
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.
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.
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.
Bit operators describe the input field to mask relationship to be tested as follows:
ALL or BO
All mask bits are on in the input field
SOME or BM
Some, but not all mask bits are on in the input field
NONE or BZ
No mask bits are on in the input field
NOTALL or BNO
Some or no mask bits are on in the input field
NOTSOME or BNM
All or no mask bits are on in the input field
NOTNONE or BNZ
All or some mask bits are on in the input field
The first set of operators (ALL, SOME, and so on) are intended for those who like
meaningful mnemonics. The second set of operators (BO, BM, and so on) are
intended for those familiar with the conditions associated with the Test Under Mask
(TM) instruction.
Fields
p1,m1: These variables specify the binary field in the input record to be tested
against the mask.
v p1 specifies the first byte of the binary input field to be tested against the mask,
relative to the beginning of the input record.7 The first data byte of a fixed-length
record (FLR) has relative position 1. The first data byte of a variable-length (VLR)
record has relative position 5 (because the first 4 bytes contain the record
descriptor word). All fields to be tested must start on a byte boundary and must
not extend beyond byte 32752.
v m1 specifies the length of the field to be tested. The length can be 1 to 256
bytes.
Mask
A hexadecimal string or bit string that indicates the bits in the field selected for
testing. If a mask bit is on (1), the corresponding bit in the field is tested. If a mask
bit is off (0), the corresponding bit in the field is ignored.
Hexadecimal String Format: The format for coding a hexadecimal string mask is:
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.
7. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.
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
(p1,m1,BI, EQ , constant )
NE
| (p1,m1, EQ , constant )
BI, NE
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).
8. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.
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
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).
(p1,m1,Y2x, EQ , p2,m2,Y2x )
NE constant
GT
GE
LT
LE
| (p1,m1, EQ , p2,m2 )
Y2x, NE ,Y2x
GT constant
GE
LT
LE
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.
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.
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).
v Y'LOW' (BI zeros), Y'BLANKS' (blanks) and Y'HIGH' (BI ones) can be used with
Y2T, Y2W and Y2S dates.
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.
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 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
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.
For information concerning the interaction of INREC and OUTREC, see INREC
Statement Notes on page 127.
FIELDS
| ,
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.
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
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
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
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).
10. If your E15 user exit reformats the record, p must refer to the record as reformatted by the exit.
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.
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
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.
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)
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.
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.
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
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 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.
| ,
( 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
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.
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.
If locale processing is to be used, the active locale will only be used to process
character (CH) control fields.
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
EQUALS or NOEQUALS
EQUALS
NOEQUALS
FILES=n
Specifies the number of input files for a merge when input is supplied through
the E32 exit.
FILSZ=x
SIZE=y
SKIPREC=z
STOPAFT=n
Y2PAST= s
f
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.
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
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.
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.
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.
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.
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.
relational condition1
.
If the logical expression is true for a given record, the record is omitted from the
output data set.
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
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.
FORMAT=f
| For details on this parameter, see INCLUDE Control Statement on page 96.
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.
| ,
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)
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)
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
ARESALL= n
nK
nM
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.
ARESINV= n
nK
nM
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.
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.
CHALT
NOCHALT
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.
CHECK or NOCHECK
CHECK
NOCHECK
CINV
NOCINV
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.
COBEXIT COB1
COB2
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,
Note: User labels will not be copied to the output data sets.
DSPSIZE= MAX
n
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.
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.
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.
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.
DYNSPC=n
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
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.
EFS= name
NONE
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.
EQUALS
NOEQUALS
For sort applications, the sequence of the output records depends upon the
order of:
v The records from the SORTIN file
v The records inserted by an E15 user exit routine
v The E15 records inserted within input from SORTIN.
For merge applications, the sequence of the output records depends upon the
order of:
v The records from a SORTINnn file. Records that collate identically are output
in the order of their file increments. For example, records from SORTIN01
are output before any records that collate identically from SORTIN02.
v The records from an E32 user exit routine for the same file increment
number. Records that collate identically from E32 are output in the order of
their file increments. For example, records from the file with increment 0 are
output before any records that collate identically from the file with increment
4.
Notes:
1. When EQUALS is in effect, the total number of bytes occupied by all control
fields must not exceed 4088.
2. Using EQUALS can degrade performance.
3. When EQUALS is in effect with SUM, the first record of summed records is
kept. When NOEQUALS is in effect with SUM, the record to be kept is
unpredictable.
If a technique other than Blockset is selected, NOEQUALS is forced if SUM
is specified.
4. Do not specify EQUALS if variable-length records are sorted using tape
work files and the RDW is part of the control field.
5. The number of records to be sorted cannot exceed 4294967295
(4 gigarecords minus 1); if the number of records exceeds this number,
message ICE121A is issued and DFSORT terminates.
EXITCK STRONG
WEAK
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
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 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
HIPRMAX= OPTIMAL
n
p%
| 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.
Hipersorting can cause a small CPU time degradation. When CPU optimization
is a concern, you can use HIPRMAX=0 to suppress Hipersorting.
LIST
NOLIST
Note: LIST or NOLIST are processed only if they are passed on the OPTION
control statement in an extended parameter list or in DFSPARM.
LISTX
NOLISTX
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
LOCALE= name
CURRENT
NONE
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.
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.
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.
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.
| MOSIZE= MAX
n
p%
|
| Note: The bar refers to the 2-gigabyte address within the 64-bit address
| space. The bar separates storage below the 2-gigabyte address called
| below the bar, from storage above the 2-gigabyte address called
| above the bar.
| Several factors can limit the size of a memory object an application uses:
| 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.
| 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.
MSGDDN=ddname
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
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.
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.
NOOUTREL
NOOUTSEC
NOSTIMER
If your exits take checkpoints and STIMER=YES is the installation default, you
must specify this parameter.
| NULLOUT= RC0
RC4
RC16
|
| 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.
ODMAXBF= n
nK
nM
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
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.
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.
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.
RESALL= n
nK
nM
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.
RESET
NORESET
Note: A VSAM output data set defined without REUSE is processed as a MOD
data set.
RESINV= n
nK
nM
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.
SDB= LARGE
YES
INPUT
NO
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.
Figure 13. SDB=LARGE Block Sizes for Tape Output Data Sets
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.
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.
SMF= SHORT
FULL
NO
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.
SOLRF
NOSOLRF
SORTDD=cccc
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.
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.
SPANINC= RC0
RC4
RC16
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)
SZERO or NOSZERO
SZERO
NOSZERO
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.
USEWKDD
VERIFY
NOVERIFY
VLLONG
NOVLLONG
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.
VLSCMP
NOVLSCMP
The compare fields are only padded temporarily for testing; they are not actually
changed for output.
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
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.
VLSHRT or NOVLSHRT
VLSHRT
NOVLSHRT
VSAMEMT
NVSAMEMT
VSAMIO
NOVSAMIO
These conditions ensure that the VSAM data set is processed as NEW for
output and will contain the sorted input records, that is, it will be sorted
in-place.
DFSORT terminates if the same VSAM data set is specified for input and
output and any of the above conditions are not met.
NOVSAMIO
specifies that DFSORT terminates if the same VSAM data set is used for
input and output.
WRKREL
NOWRKREL
WRKSEC
NOWRKSEC
NOWRKSEC
specifies that automatic secondary allocation for temporary JCL
SORTWKdd data sets is not used.
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.
ZDPRINT
NZDPRINT
NZDPRINT
means do not convert positive ZD summation results to printable numbers.
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.
Example 3
OPTION FILSZ=50,SKIPREC=5,DYNALLOC=3390
SORT FIELDS=(1,2,CH,A),SKIPREC=1,SIZE=200,DYNALLOC=(3380,5)
This example shows how parameters specified on the OPTION control statement
override those specified on the SORT control statement, regardless of the order of
the two statements.
FILSZ
DFSORT expects 50 records on the input data set. (Note that there is a
difference in meaning between FILSZ and SIZE and that the OPTION
specification of FILSZ is used in place of SIZE.)
SKIPREC
DFSORT causes five records from the beginning of the input file to be skipped.
(SKIPREC=1 on the SORT statement is ignored.)
DYNALLOC
DFSORT allocates two work data sets (by default) on an IBM 3390.
FIELDS
The control field begins on the first byte of each record in the input data set, is
2 bytes long, contains character data, and is to be sorted in ascending order.
Example 4
OPTION NOBLKSET
NOBLKSET
DFSORT does not use the Blockset technique for a sort or merge.
Example 5
| OPTION STOPAFT=100
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
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
Example 8
SORT FIELDS=(3,4,CH,A)
OPTION COPY,SKIPREC=10,CKPT
MODS E15=(E15,1024,MODLIB),E35=(E35,1024,MODLIB)
SORT
The sort statement is ignored because the COPY option has been specified.
COPY
The copy processing is always done on a record-by-record basis. Each record
is therefore read from SORTIN, passed to the E15 exit, passed to the E35 exit,
and written to SORTOUT. (Contrast this with a sort, where all the records are
read from SORTIN and passed to the E15 exit before any records are passed
to the E35 exit and written to SORTOUT.)
SKIPREC
Ten records are skipped before copying starts.
CKPT
The checkpoint option is not used for copy applications.
Example 9
SORT FIELDS=(5,4,CH,A)
SUM FIELDS=(12,5,ZD,25,6,ZD)
OPTION ZDPRINT
ZDPRINT
The positive summed ZD values are printable because DFSORT uses an F sign
for the last digit.
| ,
( 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
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.
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.
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.
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.
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
|
| 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
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.
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
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
| SAMPLE= n
(n,m)
| 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)
Selects the records to be included in the data sets for this OUTFIL group.
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)
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:
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)
SAVE
Sample Syntax:
OUTFIL INCLUDE=(8,6,CH,EQ,CACCTNG),FNAMES=GP1
OUTFIL INCLUDE=(8,6,CH,EQ,CDVPMNT),FNAMES=GP2
OUTFIL SAVE,FNAMES=NOT1OR2
| ,
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
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.
For example, if your data records are 40 bytes, but your longest report record is
60 bytes, you can use an OUTREC parameter such as:
OUTREC=(1,40,80:X)
DFSORT will then set the LRECL to 81 (1 byte for the ANSI carriage control
character plus 80 bytes for the length of the data records), and pad the data
records with blanks on the right.
If you dont want the ANSI carriage control characters to appear in the output
data set, use the REMOVECC parameter to remove them. For example, if you
specify:
OUTREC=(1,40,80:X),REMOVECC
DFSORT will set the LRECL to 80 instead of 81 and remove the ANSI carriage
control character from each record before it is written.
Note: The OUTREC statement applies to all input records, whereas the
OUTREC parameter of the OUTFIL statement applies only to the
OUTFIL input records for its OUTFIL group. The OUTREC parameter of
the OUTFIL statement supports the slash (/) separator for creating blank
records and new records; the OUTREC statement does not.
You can choose to include any or all of the following in your reformatted
OUTFIL output records:
v Blanks, binary zeros, character strings, and hexadecimal strings
v Current date and current time in various forms
v Unedited input fields aligned on byte, halfword, fullword, and doubleword
boundaries
v Hexadecimal representations of binary input fields
v Numeric input fields of various formats converted to different numeric
formats, or to character format edited to contain signs, thousands separators,
decimal points, leading zeros or no leading zeros, and so on.
| v Decimal constants converted to different numeric formats, or to character
| format edited to contain signs, thousands separators, decimal points, leading
| zeros or no leading zeros, and so on.
| v The results of arithmetic expressions combining fields, decimal constants,
| operators (MIN, MAX, MUL, DIV, MOD, ADD and SUB) and parentheses
| converted to different numeric formats, or to character format edited to
| contain signs, thousands separators, decimal points, leading zeros or no
| leading zeros, and so on.
v SMF date and time fields converted to different numeric formats, or to
character format edited to contain separators, leading zeros or no leading
zeros, and so on.
v Two-digit year input dates of various formats converted to four-digit year
dates in different numeric formats, or to character format edited to contain
separators, leading zeros or no leading zeros, and so on.
v Sequence numbers in various formats.
v Character or hexadecimal strings from a lookup table.
| The reformatted OUTFIL output record consists of the separation fields, edited
| and unedited input fields, edited decimal constants, edited results of arithmetic
| expressions, and sequence numbers you select, in the order in which you
| select them, aligned on the boundaries or in the columns you indicate.
| 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 OUTFIL output record. Count the RDW (variable-length output
records only) but not the carriage control character (for reports) when specifying
c:. That is, 1: indicates the first byte of the data in fixed-length output records
and 5: indicates the first byte of the data in variable-length output records.
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 OUTFIL output 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 OUTFIL
input record.
v The colon (:) is treated like the comma (,) or semicolon (;) for continuation to
another line.
See Table 20 on page 119 for examples of valid and invalid column alignment.
See Table 23 on page 121 for examples of valid and invalid character
string separation.
nX'yy...yy'
Hexadecimal string separation. n repetitions of the hexadecimal string
constant (X'yy...yy') are to appear in the reformatted OUTFIL output
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.
See Table 24 on page 121 for examples of valid and invalid
hexadecimal string separation.
DATEn, DATEN(c), DATEnP
Constant for current date. The date of the run is to appear in the
reformatted OUTFIL output records. Table 31 on page 207 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.
/.../ or n/
Blank records or a new record. A new output record is to be started with
or without intervening blank output records. If /.../ or n/ is specified at
the beginning or end of OUTREC, n blank output records are to be
produced. If /.../ or n/ is specified in the middle of OUTREC, n1 blank
output records are to be produced (thus, / or 1/ indicates a new output
record with no intervening blank output records).
At least one input field or separation field must be specified if you use
/.../ or n/. For example, OUTREC=(//) is not allowed, whereas
OUTREC=(//X) is allowed.
Either n/ (for example, 5/) or multiple /'s (for example, /////) can be used.
n can range from 1 to 255. If n is omitted, 1 is used.
As an example, if you specify:
Note that four OUTFIL output records are produced for each OUTFIL
input record.
p,m,a
specifies that an unedited input field is to appear in the reformatted OUTFIL
output record.
p specifies the first byte of the input field relative to the beginning of the
OUTFIL input record. 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 four bytes are occupied by the RDW. All fields
must start on a byte boundary, and no field can extend beyond byte 32752.
See OUTFIL Statements Notes on page 262 for special rules concerning
variable-length records.
m specifies the length in bytes of the input field.
a specifies the alignment (displacement) of the input field in the reformatted
OUTFIL output record relative to the start of the reformatted OUTFIL output
record.
The permissible values of a are:
H Halfword aligned. The displacement (p1) of the field from the
beginning of the reformatted OUTFIL input record, in bytes, is a
multiple of 2 (that is, position 1, 3, 5, and so forth).
F Fullword aligned. The displacement is a multiple of 4 (that is,
position 1, 5, 9, and so forth).
D Doubleword aligned. The displacement is a multiple of 8 (that is,
position 1, 9, 17, and so forth).
Alignment can be necessary if, for example, the data is used in a COBOL
application program where items are aligned through the SYNCHRONIZED
clause. Unused space preceding aligned fields are always padded with
binary zeros.
p specifies the unedited variable part of the OUTFIL input record (that part
beyond the minimum record length) is to appear in the reformatted OUTFIL
output 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.
A value must be specified for p that is less than or equal to the minimum
OUTFIL input record length plus 1 byte.
p,m,HEX
specifies that the hexadecimal representation of an input field is to appear in
the reformatted OUTFIL output record.
p See p under p,m,a.
m specifies the length in bytes of the input field. The value for m must be 1 to
16376.
HEX
requests hexadecimal representation of the input field. Each byte of the
input field is replaced by its two-byte equivalent. For example, the
characters AB would be replaced by C1C2.
p,HEX
specifies that the hexadecimal representation of the variable part of the OUTFIL
input record (that part beyond the minimum record length) is to appear in the
reformatted OUTFIL output 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.
p A value must be specified for p that is less than or equal to the minimum
record length plus 1 byte.
HEX
requests hexadecimal representation of the variable part of the OUTFIL
input record. Each byte of the input field is replaced by its two-byte
equivalent. For example, the characters AB would be replaced by C1C2.
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 OUTFIL
output record.
p See p under p,m,a
m See m under p,m,a
TRAN=LTOU
requests conversion of lowercase letters to uppercase letters. Each a-z
character of the input field is replaced by the corresponding A-Z character.
Other characters are not changed. For example, the characters
Vicky-123,x would be replaced by VICKY-123,X.
p,TRAN=LTOU
specifies that lowercase EBCDIC letters (that is, a-z) in the variable part of the
OUTFIL input record (that part beyond the minimum record length), are to
appear as uppercase EBCDIC letters (that is, A-Z) in the reformatted OUTFIL
output 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.
p A value must be specified for p that is less than or equal to the minimum
record length plus 1 byte.
TRAN=LTOU
requests conversion of lowercase EBCDIC letters to uppercase EBCDIC
letters. Each a-z character of the variable part of the OUTFIL input record is
| 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.
| Attention: If TRAN=ALTSEQ is used for numeric data, it may have
| unintended consequences. For example, with TRAN=ALTSEQ and ALTSEQ
| CODE=(0040), a PD field with X00003C (P3) would appear as X40403C
| (P40403).
p,TRAN=ALTSEQ
specifies that the characters in the variable part of the OUTFIL input record
(that part beyond the minimum record length), are to be changed according to
the ALTSEQ translation table in effect in the reformatted OUTFIL output 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.
p A value must be specified for p that is less than or equal to the minimum
record length plus 1 byte.
TRAN=ALTSEQ
requests conversion of characters according to the ALTSEQ translation
table in effect. Each character of the variable part of the OUTFIL input
record which has been assigned a different character in the ALTSEQ table
is replaced by that character. Other characters are not changed. For
example, if this ALTSEQ statement is specified:
ALTSEQ CODE=(5C61,C1F1)
Sample Syntax:
p,m,Y2x
specifies that the four-digit year CH date representation of a two-digit year input
date field is to appear in the reformatted OUTFIL output 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 C'000000' to
C'00000000').
p See p under p,m,a.
Sample Syntax:
OUTFIL OUTREC=(21,3,Y2V,X,12,5,Y2W)
p,m,Y2x(c)
specifies that the four-digit year CH date representation with separators of a
two-digit year input date field is to appear in the reformatted OUTFIL output
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
C'000000' to C'0000/00/00').
p See p under p,m,a.
m specifies the length in bytes of the two-digit year date field.
Y2x
specifies the Y2 format. See Appendix C, Data Format Descriptions, on
page 657 for detailed format descriptions.
c specifies the separator character. c can be any character except a blank.
Sample Syntax:
OUTFIL OUTREC=(25,6,Y2T(-),X,14,2,Y2U(/))
Table 34 shows the output produced for each type of Y2x(c) date field when / is
used for c.
Table 34. p,m,Y2x(c) Output
Type of Date Fields (m,f) Output for
p,m,Y2x(/)
yyx 3,Y2T 2,Y2U C'yyyy/x'
p,m,Y2xP
specifies that the four-digit year PD date representation of a two-digit year input
date field is to appear in the reformatted OUTFIL output 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 C'000000' to
P'00000000'):
p See p under p,m,a.
m specifies the length in bytes of the two-digit year date field.
Y2xP
specifies the Y2 format. See Appendix C, Data Format Descriptions, on
page 657 for detailed format descriptions.
Sample Syntax:
OUTFIL OUTREC=(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
OUTFIL output 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
Mn
EDIT= (pattern)
EDxy= (pattern)
, SIGNS= (lp,ln,tp,tn) ,LENGTH= n
SIGNz= (n)
Specifies how the numeric field is to be edited for output. If an Mn, EDIT, or
EDxy parameter is not specified:
v a DT1, DT2, DT3, TM1, TM2, TM3, or TM4 field is edited using the M11 edit
mask.
v a BI, FI, PD, PD0, ZD, or CSF/FS field is edited using the M0 edit mask.
Mn
specifies one of twenty-seven pre-defined edit masks (M0-M26) for
presenting numeric data. If these pre-defined edit masks are not suitable for
presenting your numeric data, the EDIT parameter gives you the flexibility to
define your own edit patterns.
The twenty-seven pre-defined edit masks can be represented as follows:
Table 37. Edit Mask Patterns
Mask Pattern Examples
Value Result
M0 IIIIIIIIIIIIIITS +01234 1234
00001 1
M1 TTTTTTTTTTTTTTTS 00123 00123
+00123 00123
M2 I,III,III,III,IIT.TTS +123450 1,234.50
000020 0.20
M3 I,III,III,III,IIT.TTCR 001234 12.34CR
+123456 1,234.56
M4 SI,III,III,III,IIT.TT +0123456 +1,234.56
1234567 12,345.67
M5 SI,III,III,III,IIT.TTS 001234 (12.34)
+123450 1,234.50
M6 III-TTT-TTTT 00123456 012-3456
12345678 1-234-56788
M7 TTT-TT-TTTT 00123456 000-12-3456
12345678 012-34-5678
The elements used in the representation of the edit masks in Table 37 on page 215
are as follows:
v I indicates a leading insignificant digit. If zero, this digit will not be shown.
v T indicates a significant digit. If zero, this digit will be shown.
v CR (in M3) is printed to the right of the digits if the value is negative; otherwise,
two blanks are printed to the right of the digits.
v S indicates a sign. If it appears as the first character in the pattern, it is a leading
sign. If it appears as the last character in the pattern, it is a trailing sign. If S
appears as both the first and last characters in a pattern (example: M5), the first
character is a leading sign and the last character is a trailing sign. Four different
sign values are used: leading positive sign (lp), leading negative sign (ln), trailing
positive sign (tp) and trailing negative sign (tn). Their applicable values for the
Mn edit masks are:
Table 38. Edit Mask Signs
Mask lp ln tp tn
M0 none none blank
M1 none none blank
M2 none none blank
M3 none none none none
M4 + none none
M5 blank ( blank )
M6 none none none none
M7 none none none none
M8 none none none none
M9 none none none none
M10 none none none none
M11 none none none none
M12 blank none none
M13 blank none none
M14 blank ( blank )
M15 none none blank
M16 blank none none
M17 blank none none
M18 blank none none
M19 blank none none
M20 blank ( blank )
M21 none none blank
M22 blank none none
M23 blank none none
M24 blank none none
M25 blank none none
M26 + none none
v any other character (for example, /) will be printed as shown, subject to certain
rules to be subsequently discussed.
The implied length of the edited output field depends on the number of digits and
characters needed for the pattern of the particular edit mask used. The LENGTH
parameter can be used to change the implied length of the edited output field.
The number of digits needed depends on the format and length of the numeric field
as follows:
Table 39. Digits Needed for Numeric Fields
Format Input Length Digits Needed
ZD m m
PD m 2m1
PD0 m 2m2
BI, FI 1 3
BI, FI 2 5
BI, FI 3 8
BI, FI 4 10
CSF or FS 16 15
CSF or FS m (less than 16) m
The length of the output field can be represented as follows for each pattern, where
d is the number of digits needed, as shown in Table 39, and the result is rounded
down to the nearest integer:
Table 40. Edit Mask Output Field Lengths
Mask Output Field Length Example
Input (f,m) Output Length
M0 d+1 ZD,3 4
M1 d+1 PD,5 10
M2 d + 1 + d/3 BI,4 14
M3 d + 2 + d/3 ZD,6 10
M4 d + 1 + d/3 PD,8 21
M5 d + 2 + d/3 FI,3 12
M6 12 ZD,10 12
M7 11 PD,5 11
M8 8 ZD,6 8
M9 8 PD,4 8
M10 d BI,1 3
M11 d PD,5 9
M12 d + 1 + (d 1)/3 PD,3 7
M13 d + 1 + (d 1)/3 FS,5 7
M14 d + 2 + (d 1)/3 ZD,5 8
M15 d + 1 + (d 1)/3 FI,3 11
M16 d + 1 + (d 1)/3 ZD,6 8
M17 d + 1 + (d 1)/3 FI,4 14
M18 d + 1 + d/3 BI,4 14
To illustrate conceptually how DFSORT produces the edited output from the
numeric value, consider the following example:
OUTFIL OUTREC=(5,7,ZD,M5)
To state the rules in more general terms, the steps DFSORT takes conceptually to
produce the edited output from the numeric value are as follows:
v Determine the specific pattern and its length, using the preceding tables.
v Map the digits of the numeric value to the pattern.
v If the value is positive, replace the leading and trailing signs (if any) with the
characters for positive values shown in Table 38 on page 217. Otherwise, replace
the leading and trailing signs (if any) with the characters for negative values
shown in that same table.
v Replace all digits before the first non-zero (I) or significant digit (T) with blanks.
v Float the leading sign (if any) to the right, next to the first non-zero (I) or
significant digit (T).
The implied length of the edited output field is the same as the length of the
pattern. The LENGTH parameter can be used to change the implied length of
the edited output field.
To illustrate conceptually how DFSORT produces the edited output from the
numeric value, consider the following example:
OUTFIL OUTREC=(1,5,ZD,EDIT=(**I/ITTTCR))
In general terms, the steps DFSORT takes conceptually to produce the edited
output from the numeric value are as follows:
v Map the digits of the numeric value to the pattern, padding on the left with
zeros, if necessary.
v If the value is positive, replace the leading and trailing signs (if any) with the
characters for positive values specified by the SIGNS parameter and replace
any characters between the last digit and the trailing sign (if any) with blanks.
Otherwise, replace the leading and trailing signs (if any) with the characters
for negative values specified by the SIGNS parameter and keep any
characters between the last digit and the trailing sign (if any).
v Replace all digits before the first non-zero (I) or significant digit (T) with
blanks.
v Float all characters (if any) before the first digit in the pattern to the right,
next to the first non-zero (I) or significant digit (T).
first character of the edit mask or pattern and the value is positive, the lp
value will be used as the leading sign.
ln specifies the value for the leading negative sign. If an S is specified as the
first character of the edit mask or pattern and the value is negative, the ln
value will be used as the leading sign.
tp specifies the value for the trailing positive sign. If an S is specified as the
last character of the edit mask or pattern and the value is positive, the tp
value will be used as the trailing sign.
tn specifies the value for the trailing negative sign. If an S is specified as the
last character of the edit mask or pattern and the value is negative, the tn
value will be used as the trailing sign.
If you want to use any of the following characters as sign values, you must
enclose them in single apostrophes: comma, blank, or unbalanced left or right
parentheses. A single apostrophe must be specified as four single apostrophes
(that is, two single apostrophes enclosed in single apostrophes).
LENGTH does not change the pattern used, only the length of the resulting
edited output field. For example, as discussed previously for Mn, if you specify:
OUTFIL OUTREC=(5,1,ZD,M4)
the pattern will be C'ST' rather than C'ST.TT' because the digit length is 1.
Specifying:
OUTFIL OUTREC=(5,1,ZD,M4,LENGTH=5)
If you specify a value for n that is shorter than the implied length, truncation will
occur on the left after editing. For example, if you specify:
OUTFIL OUTREC=(1,5,ZD,EDIT=($IIT.TT),LENGTH=5)
with a value of C'12345', editing according to the specified $IIT.TT pattern will
produce C'$123.45', but the specified length of 5 will truncate this to C'23.45'.
If you specify a value for n that is longer than the implied length, padding on the
left with blanks will occur after editing. For example, if you specify:
OUTFIL OUTREC=(1,5,ZD,EDIT=($IIT.TT),LENGTH=10)
with a value of C'12345', editing according to the specified $IIT.TT pattern will
produce C'$123.45', but the specified length of 10 will pad this to
C' $123.45'.
Sample Syntax:
| OUTFIL FNAMES=OUT1,OUTREC=(5:21,8,ZD,M19,25:46,5,ZD,M13)
| OUTFIL FILES=1,OUTREC=(5,2,BI,C * ,18,2,BI,80:X),
| ENDREC=2000,OMIT=(5,2,BI,EQ,18,2,BI)
| OUTFIL FILES=(2,3),
| OUTREC=(11:35,6,FS,SIGNS=(,,+,-),LENGTH=10,
| 31:(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
OUTFIL output 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.
p See p under p,m,f,edit.
m See m under p,m,f,edit.
f See f under p,m,f,edit.
to
fo
TO= fo ,LENGTH= n
(fo) (n)
For ZD output, F is used as the positive sign and D is used as the negative
sign.
For PD output, C is used as the positive sign and D is used as the negative
sign.
For CSF/FS output, blank is used as the positive sign, is used as the
negative sign and leading zeros are suppressed.
For ZD, PD and CSF/FS output, the maximum output value is
999999999999999 (15 digits) and the minimum output value is
999999999999999 (15 digits) which correspond to the maximum and minimum
input values, respectively.
For BI output:
v An input value greater than 4294967295 (XFFFFFFFF) produces an output
value of 4294967295 (XFFFFFFFF)
v An input value less than zero produces an absolute output value. For
example, an input value of P5000 produces a BI output value of 5000
(X1388).
If you specify a value for n that is longer than the implied length, padding
on the left will occur after conversion using:
v Blanks for CSF/FS output values
v Character zeros for ZD output values
v Binary zeros for PD and BI output values
v Binary zeros for positive FI output values
Sample Syntax:
| OUTFIL OUTREC=((21,5,ZD),PD,X,8,4,ZD,TO=FI,LENGTH=2)
| deccon,edit or (deccon),edit
| specifies that an edited decimal constant is to appear in the reformatted
| OUTFIL output 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. If an Mn, EDIT, or EDxy parameter is not specified, the decimal
| constant is edited using the M0 edit mask.
| See edit under p,m,f,edit for further details on the edit fields you can use.
| Sample Syntax:
| OUTFIL OUTREC=(5,8,+4096,2X,-17,M18,LENGTH=7,2X,
| (+2000000),EDIT=(STTTTT.TT),SIGNS=(+))
| deccon,to or (deccon),to
| specifies that a converted decimal constant is to appear in the reformatted
| OUTFIL output 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 to under p,m,f,to for further details on the to fields you can use.
| Sample Syntax:
| OUTFIL FNAMES=OUT1,
| OUTREC=(6:+0,TO=PD,LENGTH=6,+0,TO=PD,LENGTH=6,/,
| 6:(-4096),ZD,LENGTH=12)
| arexp,edit or (arexp),edit
| Specifies that the edited result of an arithmetic expression is to appear in the
| reformatted OUTFIL output record. An arithmetic expression takes the form:
| term,operator,term<,operator,...>
| where:
| v term is a field (p,m,f) or a decimal constant (+n or n). See p,m,f under
| p,m,f,edit for details on the fields you can use. See deccon under deccon,edit
| for details on the decimal constants you can use.
| v operator is MIN (minimum), MAX (maximum), MUL (multiplication), DIV
| (division), MOD (modulus), ADD (addition) or SUB (subtraction).
| See edit under p,m,f,edit for further details on the edit fields you can use.
| Sample Syntax:
| OUTFIL OUTREC=(5:C% REDUCTION FOR ,21,8,C IS ,
| ((11,6,ZD,SUB,31,6,ZD),MUL,+1000),DIV,11,6,ZD,
| EDIT=(SIIT.T),SIGNS=(+,-))
| arexp,to or (arexp),to
| specifies that the converted result of an arithmetic expression is to appear in
| the reformatted OUTFIL output record. See arexp under arexp,edit for further
| details on arithmetic expressions.
| An arithmetic expression produces a signed, 15-digit zoned decimal (ZD) result
| to be converted as specified.
| See to under p,m,f,to for further details on the to fields you can use.
| Sample Syntax:
| OUTFIL FNAMES=OUT,
| OUTREC=(61,3,X,
| 35,6,FS,ADD,45,6,FS,ADD,55,6,FS,TO=FS,LENGTH=7,X,
| (5,3,PD,MIN,11,3,PD),PD,LENGTH=3,X,
| 64,5,SEQNUM,5,ZD)
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 OUTFIL output record. The
two-digit year date field you specify is transformed to a four-digit year ZD date
field as shown in Table 33 on page 212, and then edited according to the edit
parameters you specify.
For example, if you specify:
OUTFIL OUTREC=(28,3,Y2V,EDIT=(TTTT-T-T))
the Cxxyy date value will be transformed to a Zxxyyyy date value and then
converted to PL6xxyyyy (X00000xxyyyyC).
CHANGE=(-v E ,find,set )
,NOMATCH=( set )
q,n
For bit constants, because of the specification of bits to be ignored, more than
one find-constant can match an input field value; the set-constant for the first
match found will be used as the output field. For example, if you specify:
OUTFIL OUTREC=(5,1,
CHANGE=(2,B11......,CA,B1.......,CB))
input field value X'C0' (B'11000000') matches both bit constants, but C'A' will be
used for the set-constant because its find-constant is the first match.
NOMATCH
specifies the action to be taken if an input field value does not match any of
the find-constants. If you do not specify NOMATCH, and no match is found
for any input value, DFSORT will terminate processing.
If you specify NOMATCH, it must follow CHANGE.
set
specifies a set-constant to be used as the output field if no match is
found. See set under CHANGE for details.
q specifies the position of an input field to be used as the output field if
no match is found. See p under p,m,a for details.
n specifies the length of an input field to be used as the output field if no
match is found. The value for n must be 1 to v. If n is less than v, the
input field will be padded on the right to a length of v bytes, using
blanks (X'40').
Sample Syntax:
OUTFIL FILES=1,
OUTREC=(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
SEQNUM,n,fs
,START= j
(j)
,INCR= i
(i)
Sample Syntax:
OUTFIL FNAMES=O1,OUTREC=(SEQNUM,6,ZD,START=1000,INCR=50,
X,22,8,X,13,5)
OUTFIL FNAMES=O2,OUTREC=(1,12,SEQNUM,4,BI)
VTOF
CONVERT
You must specify an OUTREC parameter. The fields and columns you specify
produce a reformatted fixed-length OUTFIL output record without an RDW (the
data starts at position 1). Any OUTREC fields you specify apply to the
variable-length OUTFIL input records (the data starts at position 5 after the
4-byte RDW). However, you cannot specify parameters for the variable-part of
the OUTFIL input records (for example, p or p,HEX). Any OUTREC columns
you specify apply to the reformatted fixed-length OUTFIL output records.
If you do not specify a RECFM for the OUTFIL data set, it will be given a record
format of FB.
If you specify a RECFM for the OUTFIL data set, it must have a fixed-length
record format (for example, FB).
Sample Syntax:
OUTFIL FNAMES=FIXOUT,VTOF,
OUTREC=(1:5,14,35:32,8,50:22,6,7c'*')
VLFILL=byte
Sample Syntax:
OUTFIL FNAMES=FIXOUT,VTOF,OUTREC=(5,20,2X,35,10),VLFILL=C*
OUTFIL FNAMES=OUT1,VLFILL=XFF,OUTREC=(1,4,15,5,52)
FTOV
If you do not specify an OUTREC parameter, the OUTREC fields and columns
you specify produce a reformatted fixed-length OUTFIL input record is
converted to a variable-length OUTFIL output record. A 4-byte RDW is
prepended to the fixed-length record before it is written.
If you specify an OUTREC parameter, the OUTREC fields and columns you
specify produce a reformatted fixed-length record that is converted to a
variable-length OUTFIL output record. Any OUTREC fields you specify apply to
the fixed-length OUTFIL input records (the data starts at position 1). A 4-byte
RDW is prepended to the reformatted fixed-length record before it is written.
If you do not specify a RECFM for the OUTFIL data set, it will be given a record
format of VB.
If you specify a RECFM for the OUTFIL data set, it must have a variable-length
record format (for example, VB or VBS).
If you do not specify an LRECL for the OUTFIL data set, it will be given an
LRECL that can contain the largest variable-length output record to be
produced, up to a maximum of 32756 for an unspanned record format (for
example, VB) or up to 32767 for a spanned record format (for example, VBS).
If you specify an LRECL for the OUTFIL data set, it must be big enough to
contain the largest variable-length output record to be produced.
If your largest variable-length output record is between 32757 and 32767 bytes,
youll need to specify a spanned record format (for example, VBS) for the
output data set.
Sample Syntax:
OUTFIL FNAMES=VAROUT,FTOV
OUTFIL FNAMES=V1,FTOV,OUTREC=(1,20,26:21,10,6C*)
VLTRIM=byte
VLTRIM=byte specifies that the trailing bytes are to be removed from the end of
variable-length OUTFIL output records for this OUTFIL group before the records
are written.
The trim byte can be any value, such as blank, binary zero, or asterisk. If
DFSORT finds one or more trim bytes at the end of a variable-length OUTFIL
data record or report record, it will decrease the length of the record
accordingly, effectively removing the trailing trim bytes. However, VLTRIM=byte
will not remove the RDW, the ANSI carriage control character (if produced), or
the first data byte.
For example, say that you have the following 17-byte fixed-length data records
that you want to convert to variable-length data records:
123456***********
0003*************
ABCDEFGHIJ*****22
*****************
If you use:
OUTFIL FTOV
the following variable-length output records will be written (4-byte RDW followed
by data):
Length | Data
21 123456***********
21 0003*************
21 ABCDEFGHIJ*****22
21 *****************
the following variable-length output records will be written (4-byte RDW followed
by data):
Length | Data
10 123456
8 0003
21 ABCDEFGHIJ*****22
5 *
VLTRIM=C* removed the trailing asterisks from the first and second records.
The third record did not have any trailing asterisks to remove. The fourth record
had all asterisks, so one asterisk was kept.
Sample Syntax:
Fixed input:
OUTFIL FNAMES=TRIM1,FTOV,VLTRIM=C
Variable input:
OUTFIL FNAMES=TRIM2,VLTRIM=X00
OUTFIL FNAMES=TRIM3,VLTRIM=C*,
OUTREC=(1,15,5X,16,8,5X,28)
| REPEAT=n
| Specifies the number of times each OUTFIL output record is to be repeated for
| this OUTFIL group. Each OUTFIL output record is written n times.
| If SEQNUM is used in the OUTREC parameter for this OUTFIL group, the
| sequence number will be incremented for each repeated record. For example, if
| your input is:
| RECORD A
| RECORD B
| If you specify REPEAT=n with / in OUTFIL OUTREC, the first line is written n
| times, then the second line is written n times, and so on. If SEQNUM is used,
| all lines for the same record are given the same sequence number. For
| example, if your input is:
| RECORD A
| RECORD B
| The REPEAT parameter cannot be used with any of the report parameters
| (LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS, and
| NODETAIL).
| Sample Syntax:
| * WRITE EACH OUTPUT RECORD 12 TIMES.
| OUTFIL FNAMES=OUT1,REPEAT=12
|
| * WRITE EACH INCLUDED AND REFORMATTED OUTPUT RECORD 50 TIMES.
| * (THE SEQUENCE NUMBER WILL BE INCREMENTED FOR EACH REPETITION.)
| OUTFIL FNAMES=OUT2,INCLUDE=(5,2,SS,EQ,CB2,C5,M3),
| Splits the output records one record at a time in rotation among the data sets of
| this OUTFIL group until all of the output records have been written. As a result,
| the records will be split as evenly as possible among all of the data sets in the
| group.
| The SPLIT parameter cannot be used with any of the report parameters
| (LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS, and
| NODETAIL).
| Sample Syntax:
| * WRITE RECORD 1 TO PIPE1, RECORD 2 TO PIPE2, RECORD 3 TO PIPE3,
| * RECORD 4 TO PIPE4, RECORD 5 TO PIPE1, RECORD 6 TO PIPE2, AND SO ON.
| OUTFIL FNAMES=(PIPE1,PIPE2,PIPE3,PIPE4),SPLIT
|
| * SPLIT THE INCLUDED AND REFORMATTED OUTPUT RECORDS EVENLY BETWEEN
| * TAPE1 AND TAPE2.
| OUTFIL FNAMES=(TAPE1,TAPE2),SPLIT,
| INCLUDE=(8,2,ZD,EQ,27),OUTREC=(5X,1,75)
| SPLITBY=n
| Splits the output records n records at a time in rotation among the data sets of
| this OUTFIL group until all of the output records have been written.
| v the first OUTFIL data set in the group will receive records 1-10, 31-40, and
| so on.
| v the second OUTFIL data set in the group will receive records 11-20, 41-50,
| and so on.
| v the third OUTFIL data set in the group will receive records 21-30, 51-60, and
| so on.
| SPLITBY=1 is equivalent to SPLIT.
| The SPLITBY parameter cannot be used with any of the report parameters
| (LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS, and
| NODETAIL).
| n specifies the number of records to split by. The value for n starts at 1 and is
| limited to 28 digits (15 significant digits).
| Sample Syntax:
| * WRITE RECORDS 1-5 TO PIPE1, RECORDS 6-10 TO PIPE2, RECORDS 11-15 TO
| * PIPE3, RECORDS 16-20 TO PIPE4, RECORDS 21-25 TO PIPE1, RECORDS 26-30
| * TO PIPE2, AND SO ON.
| OUTFIL FNAMES=(PIPE1,PIPE2,PIPE3,PIPE4),SPLITBY=5
|
| * SPLIT THE INCLUDED AND REFORMATTED OUTPUT RECORDS 100 AT A TIME
| * BETWEEN TAPE1 AND TAPE2.
| OUTFIL FNAMES=(TAPE1,TAPE2),SPLITBY=100,
| INCLUDE=(8,2,ZD,EQ,27),OUTREC=(5X,1,75)
| NULLOFL= RC0
RC4
RC16
| specifies the action to be taken by DFSORT when there are no data records for
| a data set associated with this OUTFIL statement, as indicated by a DATA
| count of 0 in message ICE227I. OUTFIL report records have no affect on the
| action taken as a result of this option.
| RC0
| specifies that DFSORT should issue message ICE174I, set a return code of
| 0, and continue processing when there are no data records for a data set
| associated with this OUTFIL statement.
| RC4
| specifies that DFSORT should issue message ICE174I, set a return code of
| 4, and continue processing when there are no data records for the a data
| set associated with this OUTFIL statement.
| RC16
| specifies that DFSORT should issue message ICE209A, terminate, and give
| a return code of 16 when there are no data records for a data set
| associated with this OUTFIL statement.
Notes:
| 1. The NULLOFL value specified for each OUTFIL statement applies to the
| data sets associated with that OUTFIL statement. If a NULLOFL value is not
| specified for an OUTFIL statement, the ICEMAC default NULLOFL value
| applies to the data sets associated with that OUTFIL statement. For
| example, if the ICEMAC default is NULLOFL=RC0 (IBMs shipped default)
| and the following is specified:
| OUTFIL FNAMES=OUT1,NULLOFL=RC16,INCLUDE=(5,3,CH,EQ,CD01)
| OUTFIL FNAMES=(OUT2,OUT3),INCLUDE=(5,3,CH,EQ,CD02
| OUTFIL FNAMES=OUT4,NULLOFL=RC4,SAVE
LINES=n
Specifies the number of lines per page to be used for the reports produced for
this OUTFIL group. DFSORT uses ANSI carriage control characters to control
page ejects and the placement of the lines in your report, according to your
specifications.
n specifies the number of lines per page. The value for n must be between 1
and 255. However, n--or the default for n if LINES is not specified--must be
greater than or equal to the number of lines needed for each of the
following:
v The HEADER1 lines
v The TRAILER1 lines
v The sum of all lines for HEADER2, TRAILER2, HEADER3s, TRAILER3s,
and the data lines and blank lines produced from an input record.
Sample Syntax:
OUTFIL FNAMES=RPT1,LINES=50
HEADER1=( E )
r
c: p,m
DATE
&DATE
DATE=(abcd)
&DATE=(abcd)
DATENS=(abc)
TIME
&TIME
TIME=(abc)
&TIME=(abc)
TIMENS=(ab)
PAGE
&PAGE
Specifies the report header to be used for the reports produced for this OUTFIL
group. The report header appears by itself as the first page of the report.
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 choose to include any or all of the following report elements in your
report header:
v Blanks and character strings
v Unedited input fields from the first OUTFIL input record
v Current date
v Current time
v Page number.
The report header consists of the elements you select, in the order in which you
specify them, and in the columns or lines you specify.
c: specifies the column in which the first position of the associated report
element is to appear, relative to the start of the data in the report record.
Ignore the RDW (variable-length report records only) and carriage control
character when specifying c:. That is, 1: indicates the first byte of the data
in the report record for both fixed-length and variable-length report records.
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 report element, but must not precede / or n/.
v c must not overlap the previous report element in the report record.
v The colon (:) is treated like the comma (,) or semicolon (;) for
continuation to another line.
r specifies that blanks or a character string are to appear in the report record,
or that a new report record is to be started in the header, with or without
intervening blank lines. These report elements can be specified before or
after any other report elements. Consecutive character strings or blank lines
can be specified. Permissible values are nX, n'xx...x', nC'xx...x', /.../ and n/.
nX Blanks. n bytes of EBCDIC blanks (X'40') are to appear in the
report record. n can range from 1 to 4095. If n is omitted, 1 is used.
n'xx...x'
Character string. n repetitions of the character string constant
('xx...x') are to appear in the report record. n can range from 1 to
4095. If n is omitted, 1 is used. x can be any EBCDIC character.
You can specify 1 to 256 characters.
nC'xx...x' can be used instead of n'xx...x'.
If you want to include a single apostrophe in the character string,
you must specify it as two single apostrophes:
Required: O'NEILL Specify: 'O''NEILL' or C'O''NEILL'
/.../ or n/
Blank lines or a new line. A new report record is to be started in the
header with or without intervening blank lines. If /.../ or n/ is
specified at the beginning or end of the header, n blank lines are to
appear in the header. If /.../ or n/ is specified in the middle of the
header, n1 blank lines are to appear in the header (thus, / or 1/
indicates a new line with no intervening blank lines).
Either n/ (for example, 5/) or multiple /s (for example, /////) can be
used. n can range from 1 to 255. If n is omitted, 1 is used.
As an example, if you specify:
OUTFIL HEADER1=(2/,First line of text,/,
Second line of text,2/,
Third line of text,2/)
DATE=(abcd)
specifies that the current date is to appear in the report record in the form
adbdc, where a, b, and c indicate the order in which the month, day, and
year are to appear and whether the year is to appear as two or four digits,
and d is the character to be used to separate the month, day and year.
For a, b, and c, use M to represent the month (01-12), D to represent the
day (01-31), Y to represent the last two digits of the year (for example, 95),
or 4 to represent the four digits of the year (for example, 1995). M, D, and
Y or 4 can each be specified only once. Examples: DATE=(DMY.) would
produce a date of the form dd.mm.yy which on March 29, 1995, would
appear as 29.03.95. DATE=(4MD) would produce a date of the form
yyyy-mm-dd which on March 29, 1995, would appear as 1995-03-29.
a, b, c, and d must be specified.
&DATE=(abcd)
&DATE=(abcd) can be used instead of DATE=(abcd).
DATENS=(abc)
specifies that the current date is to appear in the report record in the form
'abc', where a, b and c indicate the order in which the month, day, and year
are to appear and whether the year is to appear as two or four digits.
For a, b and c, use M to represent the month (01-12), D to represent the
day (01-31), Y to represent the last two digits of the year (for example, 02),
or 4 to represent the four digits of the year (for example, 2002). M, D, and
Y or 4 can each be specified only once. Examples: DATENS=(DMY) would
produce a date of the form 'ddmmyy' which on March 29, 2002, would
appear as '290302'. DATENS=(4MD) would produce a date of the form
'yyyymmdd' which on March 29, 2002, would appear as '20020329'.
a, b and c must be specified.
TIME
specifies that the current time is to appear in the report record in the form
hh:mm:ss, where hh represents the hour (00-23), mm represents the
minutes (00-59), and ss represents the seconds (00-59).
&TIME
&TIME can be used instead of TIME.
TIME=(abc)
specifies that the current time is to appear in the report record in the form
hhcmmcss (24-hour time) or hhcmmcss xx (12-hour time).
If ab is 24, the time is to appear in the form hhcmmcss (24-hour time)
where hh represents the hour (00-23), mm represents the minutes (00-59),
ss represents the seconds (00-59), and c is the character used to separate
the hours, minutes, and seconds. Example: TIME=(24.) would produce a
time of the form hh.mm.ss which at 08:25:13 pm would appear as
20.25.13.
If ab is 12, the time is to appear in the form hhcmmcss xx (12-hour time)
where hh represents the hour (01-12), mm represents the minutes (00-59),
ss represents the seconds (00-59), xx is am or pm, and c is the character
used to separate the hours, minutes, and seconds. Example: TIME=(12.)
would produce a time of the form hh.mm.ss xx which at 08:25:13 pm
would appear as 08.25.13 pm.
ab and c must be specified.
&TIME=(abc)
&TIME=(abc) can be used instead of TIME=(abc).
TIMENS=(ab)
specifies that the current time is to appear in the report record in the form
'hhmmss' (24-hour time) or 'hhmmss xx' (12-hour time).
If ab is 24, the time is to appear in the form 'hhmmss' (24-hour time) where
hh represents the hour (00-23), mm represents the minutes (00-59), and ss
represents the seconds (00-59). Example: TIMENS=(24) would produce a
time of the form 'hhmmss' which at 08:25:13 pm would appear as '202513'.
If ab is 12, the time is to appear in the form 'hhmmss xx' (12-hour time)
where hh represents the hour (01-12), mm represents the minutes (00-59),
and ss represents the seconds (00-59). Example: TIMENS=(12) would
produce a time of the form 'hhmmss xx' which at 08:25:13 pm would appear
as '082513 pm'.
ab must be specified.
PAGE
specifies that the page number is to appear in the report record. The page
number for the report header appears as 1.
If HEADER1 is specified with PAGE, PAGE for the report header (first page)
will be 1 and PAGE for the next page (second page) will be
2. If HEADER1 is specified without PAGE, PAGE for the page after
the report header (second page) will be 1 (typical of a report with a
cover sheet).
&PAGE
&PAGE can be used instead of PAGE.
Sample Syntax:
OUTFIL FNAMES=(RPT1,RPT2),
HEADER1=(30:January Report,4/,
28:Prepared on ,DATE,//,
32:at ,TIME,//,
28:using DFSORTS OUTFIL,5/,
10:Department: ,12,8,50:Page:,PAGE)
TRAILER1= ( E r )
c: p,m
DATE
&DATE
DATE=(abcd)
&DATE=(abcd)
DATENS=(abc)
TIME
&TIME
TIME=(abc)
&TIME=(abc)
TIMENS=(ab)
PAGE
&PAGE
COUNT
COUNT15
COUNT=(edit)
SUBCOUNT
SUBCOUNT15
SUBCOUNT=(edit)
TOTAL= (p,m,f )
TOT= ,edit
MIN= (p,m,f )
,edit
MAX= (p,m,f )
,edit
AVG= (p,m, )
,edit
SUBTOTAL= (p,m,f )
SUBTOT= ,edit
SUB=
SUBMIN= (p,m,f )
,edit
SUBMAX= (p,m,f )
,edit
SUBAVG= (p,m,f )
,edit
Specifies the report trailer to be used for the reports produced for this OUTFIL
group. The report trailer appears by itself as the last page of the report.
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 choose to include any or all of the following report elements in your
report trailer:
v Blanks and character strings
v Unedited input fields from the last OUTFIL input record
v Current date
v Current time
v Page number
v Any or all of the following statistics:
Count of data records in the report
Total, minimum, maximum, or average for each specified ZD, PD, BI, FI,
or CSF/FS numeric input field in the data records of the report, edited to
contain signs, decimal points, leading zeros or no leading zeros, and so
on.
The report trailer consists of the elements you select, in the order in which you
specify them, and in the columns or lines you specify.
c: See c: under HEADER1.
r specifies that blanks or a character string are to appear in the report record,
or that a new report record is to be started in the trailer, with or without
intervening blank lines. These report elements can be specified before or
after any other report elements. Consecutive character strings or blank lines
can be specified. Permissible values are nX, n'xx...x', nC'xx...x', /.../, and n/.
nX Blanks. See nX under r for HEADER1.
n'xx...x'
Character string. See n'xx...x' under r for HEADER1. nC'xx...x' can
be used instead of n'xx...x'
/.../ or n/
Blank lines or a new line. A new report record is to be started in the
trailer, with or without intervening blank lines. If /.../ or n/ is specified
at the beginning or end of the trailer, n blank lines are to appear in
the trailer. If /.../ or n/ is specified in the middle of the trailer, n1
blank lines are to appear in the trailer (thus, / or 1/ indicates a new
line with no intervening blank lines).
Either n/ (for example, 5/) or multiple /s (for example, /////) can be
used. n can range from 1 to 255. If n is omitted, 1 is used.
p,m
specifies that an unedited input field, from the last OUTFIL input record for
which a data record appears in the report, is to appear in the report record.
p See p under HEADER1.
m See m under HEADER1.
DATE
See DATE under HEADER1.
&DATE
&DATE can be used instead of DATE. See &DATE under HEADER1.
DATE=(abcd)
See DATE=(abcd) under HEADER1.
&DATE=(abcd)
&DATE=(abcd) can be used instead of DATE=(abcd). See &DATE=(abcd)
under HEADER1.
DATENS=(abc)
See DATENS=(abc) under HEADER1.
TIME
See TIME under HEADER1.
&TIME
&TIME can be used instead of TIME. See &TIME under HEADER1.
TIME=(abc)
See TIME=(abc) under HEADER1.
&TIME=(abc)
&TIME=(abc) can be used instead of TIME=(abc). See &TIME=(abc) under
HEADER1.
TIMENS=(ab)
See TIMENS=(ab) under HEADER1.
PAGE
specifies that the current page number is to appear in the report record.
The page number for the trailer appears as 6 digits, right-justified, with
leading zeros suppressed. For example, if the page is numbered 12, it
appears as 12.
&PAGE
&PAGE can be used instead of PAGE.
COUNT
specifies that the count of data records in the report is to appear in the
report record as 8 digits, right-justified, with leading zeros suppressed. For
example, if there are 6810 input records in the report, the count appears as
' 6810'.
COUNT counts input records, not data records. However, unless slash (/) is
used in OUTREC to produce multiple records, the count will also represent
the number of data records.
COUNT15
same as COUNT except that the count appears as 15 digits.
COUNT=(edit)
same as COUNT except that the 15digit count appears edited as
specified. See p,m,f,edit under OUTREC for further details on the edit fields
you can use.
SUBCOUNT
specifies that the running count of input records in the report is to appear in
the report record as 8 digits, right-justified, with leading zeros suppressed.
For TRAILER1, the running count is the same as the count, so SUBCOUNT
produces the same value as COUNT.
SUBCOUNT counts input records, not data records. However, unless slash
(/) is used in OUTREC to produce multiple records, the running count will
also represent the number of data records.
SUBCOUNT15
same as SUBCOUNT except that the running count appears as 15 digits.
SUBCOUNT=(edit)
same as SUBCOUNT except that the 15digit running count appears edited
as specified. See p,m,f,edit under OUTREC for further details on the edit
fields you can use.
TOTAL
specifies that an edited total, for the values of a numeric input field in all
data records of the report, is to appear in the report record.
TOT can be used instead of TOTAL.
p,m,f,edit
specifies the numeric input field for which the total is to be produced
and how the output field (that is, the total) is to be edited.
See p,m,f,edit under OUTREC for further details. However, note that
PD0, DT1, DT2, DT3, TM1, TM2, TM3 and TM4 are not allowed for
TOTAL and that for TOTAL, the number of digits needed with Mn edit
masks is the maximum for that format type rather than the actual length
of the field, as follows:
Table 42. Digits Needed for TOTAL Fields
Format Digits Needed
ZD 15
PD 15
BI 10
FI 10
CSF or FS 15
MIN
specifies that an edited minimum, for the values of a numeric input field in
all data records of the report, is to appear in the report record.
p,m,f,edit
specifies the numeric input field for which the minimum is to be
produced and how the output field (that is, the minimum) is to be
edited.
See p,m,f,edit under OUTREC for further details. However, note that
PD0, DT1, DT2, DT3, TM1, TM2, TM3 and TM4 are not allowed for
MIN.
MAX
specifies that an edited maximum, for the values of a numeric input field in
all data records of the report, is to appear in the report record.
p,m,f,edit
specifies the numeric input field for which the maximum is to be
produced and how the output field (that is, the maximum) is to be
edited.
See p,m,f,edit under OUTREC for further details. However, note that
PD0, DT1, DT2, DT3, TM1, TM2, TM3 and TM4 are not allowed for
MAX.
AVG
specifies that an edited average, for the values of a numeric input field in all
data records of the report, is to appear in the report record. The average (or
mean) is calculated by dividing the total by the count and rounding down to
the nearest integer. For example:
+2305 / 152 = +15
-2305 / 152 = -15
p,m,f,edit
specifies the numeric input field for which the average is to be produced
and how the output field (that is, the average) is to be edited.
See p,m,f,edit under OUTREC for further details. However, note that
PD0, DT1, DT2, DT3, TM1, TM2, TM3 and TM4 are not allowed for
AVG.
SUBTOTAL
specifies that an edited running total, for the values of a numeric input field
in all data records of the report, is to appear in the report record.
SUBTOT or SUB can be used instead of SUBTOTAL.
For TRAILER1, the running total is the same as the total, so SUBTOTAL
produces the same value as TOTAL.
p,m,f,edit
specifies the numeric input field for which the running total is to be
produced and how the output field (that is, the running total) is to be
edited.
See p,m,f,edit under TOTAL for further details.
SUBMIN
specifies that an edited running minimum, for the values of a numeric input
field in all data records of the report, is to appear in the report record.
For TRAILER1, the running minimum is the same as the minimum, so
SUBMIN produces the same value as MIN.
p,m,f,edit
specifies the numeric input field for which the running minimum is to be
produced and how the output field (that is, the running minimum) is to
be edited.
See p,m,f,edit under OUTREC for further details. However, note that
PD0, DT1, DT2, DT3, TM1, TM2, TM3 and TM4 are not allowed for
SUBMIN.
SUBMAX
specifies that an edited running maximum, for the values of a numeric input
field in all data records of the report, is to appear in the report record.
For TRAILER1, the running maximum is the same as the maximum, so
SUBMAX produces the same value as MAX.
p,m,f,edit
specifies the numeric input field for which the running maximum is to be
produced and how the output field (that is, the running maximum) is to
be edited.
See p,m,f,edit under OUTREC for further details. However, note that
PD0, DT1, DT2, DT3, TM1, TM2, TM3 and TM4 are not allowed for
SUBMAX.
SUBAVG
specifies that an edited running average, for the values of a numeric input
field in all data records of the report, is to appear in the report record.
For TRAILER1, the running average is the same as the average, so
SUBAVG produces the same value as AVG.
p,m,f,edit
specifies the numeric input field for which the running average is to be
produced and how the output field (that is, the running average) is to be
edited.
See p,m,f,edit under OUTREC for further details. However, note that
PD0, DT1, DT2, DT3, TM1, TM2, TM3 and TM4 are not allowed for
SUBAVG.
Sample Syntax:
OUTFIL FNAMES=RPT,
TRAILER1=(5/,
10:Summary of Report for Division Revenues,3/,
10:Number of divisions reporting: ,COUNT,2/,
10:Total revenue: ,TOTAL=(25,5,PD,M5),2/,
10:Lowest revenue: ,MIN=(25,5,PD,M5),2/,
10:Highest revenue: ,MAX=(25,5,PD,M5),2/,
10:Average revenue: ,AVG=(25,5,PD,M5))
HEADER2= ( E r )
c: p,m
DATE
&DATE
DATE=(abcd)
&DATE=(abcd)
DATENS=(abc)
TIME
&TIME
TIME=(abc)
&TIME=(abc)
TIMENS=(ab)
PAGE
&PAGE
Specifies the page header to be used for the reports produced for this OUTFIL
group. The page header appears at the top of each page of the report, except
for the report header page (if any) and report trailer page (if any). 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 choose to include any or all of the following report elements in your
page header:
v Blanks and character strings
v Unedited input fields from the first OUTFIL input record for which a data
record appears on the page
v Current date
v Current time
v Page number.
The page header consists of the elements you select, in the order in which you
specify them, and in the columns or lines you specify.
c: See c: under HEADER1.
r See r under HEADER1.
p,m
specifies that an unedited input field, from the first OUTFIL input record for
which a data record appears on the page, is to appear in the report record.
See p,m under HEADER1 for further details.
DATE
See DATE under HEADER1.
&DATE
&DATE can be used instead of DATE. See &DATE under HEADER1.
DATE=(abcd)
See DATE=(abcd) under HEADER1.
&DATE=(abcd)
&DATE=(abcd) can be used instead of DATE=(abcd). See &DATE=(abcd)
under HEADER1.
DATENS=(abc)
See DATENS=(abc) under HEADER1.
TIME
See TIME under HEADER1.
&TIME
&TIME can be used instead of TIME. See &TIME under HEADER1.
TIME=(abc)
See TIME=(abc) under HEADER1.
&TIME=(abc)
&TIME=(abc) can be used instead of TIME=(abc). See &TIME=(abc) under
HEADER1.
TIMENS=(ab)
See TIMENS=(ab) under HEADER1.
PAGE
specifies that the current page number is to appear in the OUTFIL report
record. The page number for the header appears as 6 digits, right-justified,
with leading zeros suppressed. For example, if the page is numbered 3, it
appears as 3.
&PAGE
&PAGE can be used instead of PAGE.
If HEADER1 is specified with PAGE and HEADER2 is specified with PAGE,
the page number for the first page header will be 2. If HEADER1 is
not specified or is specified without PAGE and HEADER2 is specified with
PAGE, the page number for the first page header will be 1.
Sample Syntax:
OUTFIL FNAMES=STATUS,
HEADER2=(5:Page ,PAGE, of Status Report for ,DATE=(MD4/),
at ,TIME=(12:),2/,
10:Item ,20:Status ,35:Count,/,
10:-----,20:------------,35:-----),
OUTREC=(10:6,5,
20:14,1,CHANGE=(12,
CS,CShip,
CH,CHold,
CT,CTransfer),
NOMATCH=(C*Check Code*),
36:39,4,ZD,M10,
132:X)
TRAILER2= ( E r )
c: p,m
DATE
&DATE
DATE=(abcd)
&DATE=(abcd)
DATENS=(abc)
TIME
&TIME
TIME=(abc)
&TIME=(abc)
TIMENS=(ab)
PAGE
&PAGE
COUNT
COUNT15
COUNT=(edit)
SUBCOUNT
SUBCOUNT15
SUBCOUNT=(edit)
TOTAL= (p,m,f )
TOT= ,edit
MIN= (p,m,f )
,edit
MAX= (p,m,f )
,edit
AVG= (p,m,f )
,edit
SUBTOTAL= (p,m,f )
SUBTOT= ,edit
SUB=
SUBMIN= (p,m,f )
,edit
SUBMAX= (p,m,f )
,edit
SUBAVG= (p,m,f )
,edit
Specifies the page trailer to be used for the reports produced for this OUTFIL
group. The page trailer appears at the very bottom of each page of the report
(as specified or defaulted by the LINES value), except for the report header
page (if any) and report trailer page (if any). 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 choose to include any or all of the following report elements in your
page trailer:
v Blanks and character strings
v Unedited input fields from the last OUTFIL input record for which a data
record appears on the page
v Current date
v Current time
v Page number
v Any or all of the following statistics:
Count of data records on the page
Total, minimum, maximum, or average for each specified ZD, PD, BI, FI,
or CSF/FS numeric input field in the data records on the page, edited to
contain signs, decimal points, leading zeros or no leading zeros, and so
on
Running total, minimum, maximum, or average for each specified ZD, PD,
BI, FI, or CSF/FS numeric input field in the data records up to this point,
edited to contain signs, decimal points, leading zeros or no leading zeros,
and so on.
The page trailer consists of the elements you select, in the order in which you
specify them, and in the columns or lines you specify.
c: See c: under HEADER1.
r See r under TRAILER1.
p,m
specifies that an unedited input field, from the last OUTFIL input record for
which a data record appears on the page, is to appear in the report record.
See p,m under TRAILER1 for further details.
DATE
See DATE under HEADER1.
&DATE
&DATE can be used instead of DATE. See &DATE under HEADER1.
DATE=(abcd)
See DATE=(abcd) under HEADER1.
&DATE=(abcd)
&DATE=(abcd) can be used instead of DATE=(abcd). See &DATE=(abcd)
under HEADER1.
DATENS=(abc)
See DATENS=(abc) under HEADER1.
TIME
See TIME under HEADER1.
&TIME
&TIME can be used instead of TIME. See &TIME under HEADER1.
TIME=(abc)
See TIME=(abc) under HEADER1.
&TIME=(abc)
&TIME=(abc) can be used instead of TIME=(abc). See &TIME=(abc) under
HEADER1.
TIMENS=(ab)
See TIMENS=(ab) under HEADER1.
PAGE
See PAGE under TRAILER1.
&PAGE
&PAGE can be used instead of PAGE. See &PAGE under TRAILER1.
COUNT
specifies that the count of data records on the page is to appear in the
report record as 8 digits, right-justified, with leading zeros suppressed. For
example, if page 1 has 40 input records, page 2 has 40 input records, and
page 3 has 26 input records, COUNT will show ' 40' for page 1,
' 40' for page 2, and ' 26' for page 3.
COUNT counts input records, not data records. However, unless slash (/) is
used to produce multiple records, the count will also represent the number
of data records.
COUNT15
same as COUNT except that the count appears as 15 digits.
COUNT=(edit)
same as COUNT except that the 15digit count appears edited as
specified. See p,m,f,edit under OUTREC for further details on the edit fields
you can use.
SUBCOUNT
specifies that the count of input records up to this point in the report is to
appear in the report record as 8 digits, right-justified, with leading zeros
suppressed. The running count accumulates the count for all pages up to
and including the current page. For example, if page 1 has 40 input
records, page 2 has 40 input records, and page 3 has 26 input records,
SUBCOUNT will show ' 40' for page 1, ' 80' for page 2, and
' 106' for page 3.
SUBCOUNT counts input records, not data records. However, unless slash
(/) is used to produce multiple records, the running count will also represent
the number of data records.
SUBCOUNT15
same as SUBCOUNT except that the running count appears as 15 digits.
SUBCOUNT=(edit)
same as SUBCOUNT except that the 15digit running count appears edited
as specified. See p,m,f,edit under OUTREC for further details on the edit
fields you can use.
TOTAL
specifies that an edited total, for the values of a numeric input field in the
data records on the page, is to appear in the report record.
TOT can be used instead of TOTAL.
p,m,f,edit
See p,m,f,edit under TOTAL for TRAILER1.
MIN
specifies that an edited minimum, for the values of a numeric input field in
the data records on the page, is to appear in the report record.
p,m,f,edit
See p,m,f,edit under MIN for TRAILER1.
MAX
specifies that an edited maximum, for the values of a numeric input field in
the data records on the page, is to appear in the report record.
p,m,f,edit
See p,m,f,edit under MAX for TRAILER1.
AVG
specifies that an edited average, for the values of a numeric input field in
the data records on the page, is to appear in the report record.
p,m,f,edit
See p,m,f,edit under AVG for TRAILER1.
SUBTOTAL
specifies that an edited running total, for the values of a numeric input field
in the data records up to this point in the report, is to appear in the report
record. The running total accumulates the total for all pages up to and
including the current page. For example, if the total for a selected numeric
field is +200 for page 1, 250 for page 2, and +90 for page 3, SUBTOTAL
will be +200 for page 1, 50 for page 2, and +40 for page 3.
SUBTOT or SUB can be used instead of SUBTOTAL.
p,m,f,edit
See p,m,f,edit under SUBTOTAL for TRAILER1.
SUBMIN
specifies that an edited running minimum, for the values of a numeric input
field in the data records up to this point in the report, is to appear in the
report record. The running minimum selects the minimum from all pages up
to and including the current page. For example, if the minimum for a
selected numeric field is +200 for page 1, 250 for page 2, and +90 for
page 3, SUBMIN will be +200 for page 1, 250 for page 2, and 250 for
page 3.
p,m,f,edit
See p,m,f,edit under SUBMIN for TRAILER1.
SUBMAX
specifies that an edited running maximum, for the values of a numeric input
field in the data records up to this point in the report, is to appear in the
report record. The running maximum selects the maximum from all pages
up to and including the current page. For example, if the maximum for a
selected numeric field is 100 for page 1, +250 for page 2, and +90 for
page 3, SUBMAX will be 100 for page 1, +250 for page 2, and +250 for
page 3.
p,m,f,edit
See p,m,f,edit under SUBMAX for TRAILER1.
SUBAVG
specifies that an edited running average, for the values of a numeric input
field in the data records up to this point in the report, is to appear in the
report record. The running average computes the average for all pages up
to and including the current page. For example, if the count of data records
and total for a selected numeric field are 60 and +2205 for page 1,
respectively, 60 and 6252 for page 2, respectively, and 23 and 320 for
page 3, respectively, SUBAVG will be +36 for page 1, 33 for page 2, and
30 for page 3.
p,m,f,edit
See p,m,f,edit under SUBAVG for TRAILER1.
Sample Syntax:
OUTFIL FNAMES=STATS,
STARTREC=3,
OUTREC=(20:23,3,PD,M16,
30:40,3,PD,M16,
80:X),
TRAILER2=(/,2:Average on page:,
20:AVG=(23,3,PD,M16),
30:AVG=(40,3,PD,M16),/,
2:Average so far:,
20:SUBAVG=(23,3,PD,M16),
30:SUBAVG=(40,3,PD,M16))
,
,
HEADER3= ( E field )
,PAGEHEAD
,
TRAILER3= ( E field )
Specifies the section break processing to be used for the reports produced for
this OUTFIL group. A section break field divides the report into sets of
sequential OUTFIL input records with the same binary value for that field, which
result in corresponding sets of data records (that is, sections) in the report. A
break is said to occur when the binary value changes. Of course, since a break
can occur in any record, the data records of a section can be split across pages
in your report.
For each section break field you specify, you can choose to include any or all of
the following:
v A page eject between sections.
v Zero, one or more blank lines to appear between sections on the same page.
v A section header to appear before the first data record of each section and
optionally, at the top of each page. When a page header and section header
are both to appear at the top of a page, the section header will follow the
page header.
v A section trailer to appear after the last data record of each section. When a
page trailer and section trailer are both to appear at the bottom of a page,
the page trailer will follow the section trailer.
DFSORT uses ANSI carriage control characters to control page ejects and the
placement of the lines in your report, according to your specifications.
If multiple section break fields are used, they are processed in first-to-last order,
in the same way they would be sorted by these fields. In fact, the input data set
is generally sorted by the section break fields, to group the records with the
same section break values together for the report. This sorting can be done by
the same application that produces the report or by a previous application.
SKIP= P
L
nL
Specifies, for reports produced for this OUTFIL group, that either:
v Each section for the associated section break field is to appear on a new
page, or
v Zero, one or more blank lines to appear after each section associated with
this section break field, when it is followed by another section on the same
page.
Thus, you can use SKIP to specify how sections will be separated from each
other.
P specifies that each section is to appear on a new page.
L specifies that one blank line is to appear between sections on the same
page. L is the same as 1L.
nL specifies that n blank lines are to appear between sections on the same
page. You can specify from 0 to 255 for n.
Sample Syntax:
OUTFIL FNAMES=(PRINT,TAPE),
SECTIONS=(10,20,SKIP=P,
42,10,SKIP=3L)
HEADER3
HEADER3= ( E r )
c: p,m
DATE
&DATE
DATE=(abcd)
&DATE=(abcd)
DATENS=(abc)
TIME
&TIME
TIME=(abc)
&TIME=(abc)
TIMENS=(ab)
PAGE
&PAGE
Specifies the section header to be used with the associated section break field
for the reports produced for this OUTFIL group. The section header appears
before the first data record of each section. 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 choose to include any or all of the following report elements in your
section header:
v Blanks and character strings
v Unedited input fields from the first OUTFIL input record for which a data
record appears in the section
v Current date
v Current time
v Page number.
The section header consists of the elements you select, in the order in which
you specify them, and in the columns or lines you specify.
c: See c: under HEADER1.
Sample Syntax:
OUTFIL FNAMES=STATUS1,
HEADER2=(10:Status Report for all departments,5X,
- ,&PAGE, -),
SECTIONS=(10,8,
HEADER3=(2/,10:Report for department ,10,8, on ,&DATE,2/,
10: Number,25:Average Time,/,
10:Completed,25: (in days),/,
10:---------,25:------------)),
OUTREC=(10:21,5,ZD,M10,LENGTH=9,
25:38,4,ZD,EDIT=(III.T),LENGTH=12,
132:X)
PAGEHEAD
PAGEHEAD
Specifies that the section header to be used with the associated section break
field is to appear at the top of each page of the report, except for the report
header page (if any) and report trailer page (if any), as well as before each
section. If you do not specify PAGEHEAD, the section header appears only
before each section; so if a section is split between pages, the section header
appears only in the middle of the page. PAGEHEAD can be used when you
want HEADER3 to be used as a page header as well as a section header.
If PAGEHEAD is specified for a section break field for which HEADER3 is not
also specified, PAGEHEAD will not be used.
Sample Syntax:
OUTFIL FNAMES=STATUS2,
HEADER2=(10:Status Report for all departments,5X,
- ,&PAGE, -),
SECTIONS=(10,8,
HEADER3=(2/,10:Report for department ,10,8, on ,&DATE,2/,
10: Number,25:Average Time,/,
10:Completed,25: (in days),/,
10:---------,25:------------),
PAGEHEAD,SKIP=P),
OUTREC=(10:21,5,ZD,M10,LENGTH=9,
25:38,4,ZD,EDIT=(III.T),LENGTH=12,
132:X)
TRAILER3
TRAILER3= ( E r )
c: p,m
DATE
&DATE
DATE=(abcd)
&DATE=(abcd)
DATENS=(abc)
TIME
&TIME
TIME=(abc)
&TIME=(abc)
TIMENS=(ab)
PAGE
&PAGE
COUNT
COUNT15
COUNT=(edit)
SUBCOUNT
SUBCOUNT15
SUBCOUNT=(edit)
TOTAL= (p,m,f )
TOT= ,edit
MIN= (p,m,f )
,edit
MAX= (p,m,f )
,edit
AVG= (p,m,f )
,edit
SUBTOTAL= (p,m,f )
SUBTOT= ,edit
SUB=
SUBMIN= (p,m,f )
,edit
SUBMAX= (p,m,f )
,edit
SUBAVG= (p,m,f )
,edit
Specifies the section trailer to be used with the associated section break field
for the reports produced for this OUTFIL group. The section trailer appears after
the last data record of each section. 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 choose to include any or all of the following report elements in your
section trailer:
v Blanks and character strings
v Unedited input fields from the last OUTFIL input record for which a data
record appears in the section
v Current date
v Current time
v Page number
v Any or all of the following statistics:
The section trailer consists of the elements you select, in the order in which you
specify them, and in the columns or lines you specify.
c: See c: under HEADER1.
r See r under TRAILER1.
p,m
specifies that an unedited input field, from the last OUTFIL input record for
which a data record appears in the section, is to appear in the report
record. See p,m under TRAILER1 for further details.
DATE
See DATE under HEADER1.
&DATE
&DATE can be used instead of DATE. See &DATE under HEADER1.
DATE=(abcd)
See DATE=(abcd) under HEADER1.
&DATE=(abcd)
&DATE=(abcd) can be used instead of DATE=(abcd). See &DATE=(abcd)
under HEADER1.
DATENS=(abc)
See DATENS=(abc) under HEADER1.
TIME
See TIME under HEADER1.
&TIME
&TIME can be used instead of TIME. See &TIME under HEADER1.
TIME=(abc)
See TIME=(abc) under HEADER1.
&TIME=(abc)
&TIME=(abc) can be used instead of TIME=(abc). See &TIME=(abc) under
HEADER1.
TIMENS=(ab)
See TIMENS=(ab) under HEADER1.
PAGE
See PAGE under TRAILER1.
&PAGE
&PAGE can be used instead of PAGE. See &PAGE under TRAILER1.
COUNT
specifies that the count of data records in the section is to appear in the
report record as 8 digits, right-justified, with leading zeros suppressed. For
example, if the first section has 40 input records, the second section has 40
input records, and the third section has 26 input records, COUNT will show
' 40' for the first section, ' 40' for the second section, and
' 26' for the third section.
COUNT counts input records, not data records. However, unless slash (/) is
used to produce multiple records, the count will also represent the number
of data records.
COUNT15
same as COUNT except that the count appears as 15 digits.
COUNT=(edit)
same as COUNT except that the 15digit count appears editied as
specified. See p,m,f,edit under OUTREC for further details on the edit fields
you can use.
SUBCOUNT
specifies that the running count of input records up to this point in the report
is to appear in the report record 8 digits, right-justified, with leading zeros
suppressed. The running count accumulates the count for all sections up to
and including the current section. For example, if the first section has 40
input records, the second section has 40 input records, and the third
section has 26 input records, SUBCOUNT will show ' 40' for the first
section, ' 80' for the second section, and ' 106' for the third
section.
SUBCOUNT counts input records, not data records. However, unless slash
(/) is used to produce multiple records, the count will also represent the
number of data records.
SUBCOUNT15
same as SUBCOUNT except that the running count appears as 15 digits.
SUBCOUNT=(edit)
same as SUBCOUNT except that the 15digit running count appears
editied as specified. See p,m,f,edit under OUTREC for further details on the
edit fields you can use.
TOTAL
specifies that an edited total, for the values of a numeric input field in the
data records in the section, is to appear in the report record.
TOT can be used instead of TOTAL.
p,m,f,edit
See p,m,f,edit under TOTAL for TRAILER1.
MIN
specifies that an edited minimum, for the values of a numeric input field in
the data records in the section, is to appear in the report record.
p,m,f,edit
See p,m,f,edit under MIN for TRAILER1.
MAX
specifies that an edited maximum, for the values of a numeric input field in
the data records in the section, is to appear in the report record.
p,m,f,edit
See p,m,f,edit under MAX for TRAILER1.
AVG
specifies that an edited average, for the values of a numeric input field in
the data records in the section, is to appear in the report record.
p,m,f,edit
See p,m,f,edit under AVG for TRAILER1.
SUBTOTAL
specifies that an edited running total, for the values of a numeric input field
in the data records up to this point in the report, is to appear in the report
record. The running total accumulates the total for all sections up to and
including the current section. For example, if the total for a selected
numeric field is +200 for the first section, 250 for the second section and
+90 for the third section, SUBTOTAL will be +200 for the first section, 50
for the second section and +40 for the third section.
SUBTOT or SUB can be used instead of SUBTOTAL.
p,m,f,edit
See p,m,f,edit under SUBTOTAL for TRAILER1.
SUBMIN
specifies that an edited running minimum, for the values of a numeric input
field in the data records up to this point in the report, is to appear in the
report record. The running minimum selects the minimum from all sections
up to and including the current section. For example, if the minimum for a
selected numeric field is +200 for the first section, 250 for the second
section and +90 for the third section, SUBMIN will be +200 for the first
section, 250 for the second section and 250 for the third section.
p,m,f,edit
See p,m,f,edit under SUBMIN for TRAILER1.
SUBMAX
specifies that an edited running maximum, for the values of a numeric input
field in the data records up to this point in the report, is to appear in the
report record. The running maximum selects the maximum from all sections
up to and including the current section. For example, if the maximum for a
selected numeric field is 100 for the first section, +250 for the second
section and +90 for the third section, SUBMAX will be 100 for the first
section, +250 for the second section and +250 for the third section.
p,m,f,edit
See p,m,f,edit under SUBMAX for TRAILER1.
SUBAVG
specifies that an edited running average, for the values of a numeric input
field in the data records up to this point in the report, is to appear in the
report record. The running average computes the average for all sections
up to and including the current section. For example, if the count of data
records and total for a selected numeric field are 60 and +2205 for the first
section, respectively, 60 and 6252 for the second section, respectively,
and 23 and 320 for the third section, respectively, SUBAVG will be +36 for
the first section, 33 for the second section and 30 for the third section.
p,m,f,edit
See p,m,f,edit under SUBAVG for TRAILER1.
Sample Syntax:
OUTFIL FNAMES=SECRPT,
INCLUDE=(11,4,CH,EQ,CSSD),
SECTIONS=(3,5,SKIP=P,
HEADER3=(2:Department: ,3,5,4X,Date: ,&DATE,2/),
TRAILER3=(2/,2:The average for ,3,5, is ,
AVG=(40,3,PD,M12),/,
2:The overall average so far is ,
SUBAVG=(40,3,PD,M12)),
45,8,SKIP=3L,
HEADER3=(4:Week Ending ,45,8,2/,
4:Item Number,20:Completed,/,
4:-,20:-),
TRAILER3=(4:The item count for week ending ,45,8,
is ,COUNT=(EDIT=(II,IIT)))),
OUTREC=(11:16,4,22:40,3,PD,M12,120:X)
NODETAIL
Specifies that data records are not to be output for the reports produced for this
OUTFIL group. With NODETAIL, the data records are completely processed
with respect to input fields, statistics, counts, sections breaks, and so on, but
are not written to the OUTFIL data set and are not included in line counts for
determining the end of a page. You can use NODETAIL to summarize the data
records without actually showing them.
Sample Syntax:
OUTFIL FNAMES=SUMMARY,NODETAIL,
HEADER2=( Date: ,DATENS=(DMY.),4X,Page: ,PAGE,2/,
10:Division,25: Total Revenue,/,
10:--------,25:-----------------),
SECTIONS=(3,5,
TRAILER3=(10:3,5,
25:TOTAL=(25,4,FI,M19,
LENGTH=17))),
TRAILER1=(5/,10:Summary of Revenue ,4/,
12:Number of divisions reporting is ,
COUNT,/,
12:Total revenue is ,
TOTAL=(25,4,FI,M19))
REMOVECC
Sample Syntax:
OUTFIL FNAMES=RPTWOCC,
TRAILER1=(3/,Number of records is ,
COUNT=(M11,LENGTH=6)),
REMOVECC
v For variable-format OUTFIL data sets: DFSORT will determine each OUTFIL data
set maximum LRECL based on the length of the OUTREC records for the group,
or the length of the OUTFIL input records (if OUTREC is not specified for the
group). If an OUTFIL data set maximum LRECL is not specified or available,
DFSORT will set it to the determined maximum LRECL. For VSAM data sets, the
maximum record size defined in the cluster is four bytes more than the maximum
LRECL.
v 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.
For example, if your data records are 40 bytes, but your longest report record is
60 bytes, you can use an OUTREC parameter such as:
OUTREC=(1,40,80:X)
DFSORT will then set the LRECL to 81 (1 byte for the ANSI carriage control
character plus 80 bytes for the length of the data records), and pad the data
records with blanks on the right.
If you dont want the ANSI carriage control characters to appear in the output
data set, use the REMOVECC parameter to remove them. For example, if you
specify:
OUTREC=(1,40,80:X),REMOVECC
DFSORT will set the LRECL to 80 instead of 81 and remove the ANSI carriage
control character from each record before it is written.
System errors can result if you print an OUTFIL report containing records longer
than your printer can handle.
v DFSORT uses appropriate ANSI 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. Although these carriage control characters may not be shown
when you view an OUTFIL data set (depending on how you view it), they will be
used if you print the report. If you are creating a report for viewing and want
blank lines to appear in headers and trailers, specify a line of blanks instead of
using n/. For example, instead of specifying:
OUTFIL FNAMES=RPT,
HEADER2=(2/,start of header,2/,next line)
which will result in blank lines for the printer, but not for viewing, specify:
OUTFIL FNAMES=RPT,
HEADER2=(X,/,X,/,start of header,/,X,/,next line)
If you dont want the ANSI carriage control characters to appear in the output
data set, use the REMOVECC parameter to remove them.
v When defining variable-length OUTFIL output or data records with OUTREC, you
| must explicitly specify the unedited 4-byte RDW (that is, 1,m where m is equal to
| or greater than 4) at the beginning of each record. When using / in OUTREC,
| you must explicitly specify the unedited 4-byte RDW at the beginning of each
new output or data record.
When defining variable-length OUTFIL header or trailer records, you must not
specify the 4-byte RDW at the beginning of the record.
v For variable-length OUTFIL records, if the variable part of the record is specified
as the last field of an INREC or OUTREC statement, then the variable part of the
record must be specified as the last field of all OUTFIL OUTREC records. If the
variable part of the record is not specified as the last field of an INREC or
OUTREC statement, then the variable part of the record must not be specified for
any OUTFIL OUTREC record. If INREC and OUTREC statements are not
specified, then the variable part of the record can be specified or not specified
independently for OUTFIL OUTREC records.
v If there are no OUTFIL input records for an OUTFIL group, the headers and
trailers appear without any data records. Blanks will be used for any specified
unedited input fields, and zero values will be used for any specified statistics
fields.
v If a variable-length OUTFIL input record is too short to contain a specified
unedited input field for a report header or trailer, blanks will be used for the
missing bytes. If a variable-length OUTFIL input record is too short to contain a
specified section break field or statistics field, zeros will be used for the missing
bytes, intentionally or unintentionally.
v If a variable-length OUTFIL input record is too short to contain an OUTFIL
INCLUDE or OMIT compare field, the action DFSORT takes depends on the
settings for VLSCMP/NOVLSCMP and VLSHRT/NOVLSHRT. For details, see the
discussion of the VLSCMP and NOVLSCMP options in OPTION Control
Statement on page 142.
v If a variable-length OUTFIL input record is too short to contain an OUTFIL
OUTREC field, DFSORT will terminate unless the VLFILL=byte parameter is
specified.
v If a variable-length OUTFIL output data record is longer than the LRECL of its
OUTFIL data set, the action DFSORT takes depends on the settings for
VLLONG/NOVLLONG. For details, see the discussion of the VLLONG and
NOVLLONG options in OPTION Control Statement on page 142. Note that
VLLONG can be used to truncate long OUTFIL data records, but has no effect
on long OUTFIL header or trailer records.
v If a page number overflows 6 digits (PAGE, &PAGE), a count or running count
overflows 15 digits (COUNT, COUNT15, SUBCOUNT, SUBCOUNT15, AVG,
SUBAVG), or a total or running total overflows 15 digits (TOTAL, SUBTOTAL,
AVG, SUBAVG), the overflowing value will be truncated to the number of digits
allowed, intentionally or unintentionally.
v Multiple OUTFIL statements can be specified in the same and different sources.
If a ddname occurs more than once in the same source, the ddname is
associated with the first OUTFIL group in which it appears. For example, if the
following is specified in SYSIN:
OUTFIL FNAMES=(OUT1,OUT2),INCLUDE=(1,1,CH,EQ,CA)
OUTFIL FNAMES=(OUT3,OUT1),SAVE
OUT1 and OUT2 are processed as part of the first OUTFIL group, that is, with
INCLUDE. OUT3 is processed as part of the second OUTFIL group, that is, with
SAVE; but OUT1 is not because it is a duplicate ddname.
If a ddname occurs in more than one source, the ddname is associated with the
highest source OUTFIL group in which it appears. For example, if the following is
specified in DFSPARM:
OUTFIL FNAMES=(OUT1,OUT2),INCLUDE=(1,1,CH,EQ,CA)
OUT1 and OUT2 are processed as part of the DFSPARM OUTFIL group, that is,
with INCLUDE. OUT3 is processed as part of the SYSIN OUTFIL group, that is,
with SAVE; but OUT1 is not because it is an overridden ddname.
v OUTFIL statements cannot be passed to or returned from an EFS program. The
D2 format cannot be specified in the INCLUDE or OMIT parameter of an OUTFIL
statement.
| v If SZERO is in effect, 0 is treated as negative and +0 is treated as positive for
| edited or converted input fields, minimums, maximums, 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, minimums, maximums,
| decimal constants, and the results of arithmetic expressions.
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.
| Case 1:
| //DFSPARM DD *
| OPTION COPY,NOSZERO
| /*
| //SYSIN DD *
| OUTFIL COND=(1,2,FS,EQ,+0)
| /*
| Case 2:
| //SYSIN DD *
| OPTION COPY,NOSZERO
| OUTFIL COND=(1,2,FS,EQ,+0)
| /*
OUTFIL FeaturesExamples
Example 1
OPTION COPY
OUTFIL INCLUDE=(15,6,CH,EQ,CMSG005),FNAMES=M005
OUTFIL INCLUDE=(15,6,CH,EQ,CMSG022),FNAMES=M022
OUTFIL INCLUDE=(15,6,CH,EQ,CMSG028),FNAMES=M028
OUTFIL INCLUDE=(15,6,CH,EQ,CMSG115),FNAMES=M115
OUTFIL SAVE,FNAMES=UNKNOWN
This example illustrates how records can be distributed to different OUTFIL data
sets based on criteria you specify:
v Input records with MSG005 in bytes 15 through 20 will be written to the OUTFIL
data set associated with ddname M005.
v Input records with MSG022 in bytes 15 through 20 will be written to the OUTFIL
data set associated with ddname M022.
v Input records with MSG028 in bytes 15 through 20 will be written to the OUTFIL
data set associated with ddname M028.
v Input records with MSG115 in bytes 15 through 20 will be written to the OUTFIL
data set associated with ddname M115.
v Input records with anything else in bytes 15 through 20 will be written to the
OUTFIL data set associated with ddname UNKNOWN
Example 2
SORT FIELDS=(18,5,ZD,D)
OUTFIL FNAMES=(V,VBU1,VBU2)
OUTFIL FNAMES=(F,FBU1),
CONVERT,OUTREC=(11,3,X,18,5,X,X0000000F)
OUTFIL FNAMES=VINF,OUTREC=(1,4,C*,5,20,C*,25)
This example illustrates how multiple sorted output data sets can be created and
how a variable-length record data set can be converted to a fixed-length record
data set:
v The first OUTFIL statement writes the variable-length input records to the
variable-length OUTFIL data sets associated with ddnames V, VBU1, and VBU2.
v The second OUTFIL statement reformats the variable-length input records to
fixed-length output records and writes them to the fixed-length OUTFIL data sets
associated with ddnames F and FBU1. CONVERT is used to indicate that a
variable-length data set is to be converted to a fixed-length data set; OUTREC is
used to describe how the variable-length input records are to be reformatted as
fixed-length output records.
v The third OUTFIL statement reformats the variable-length input records and
writes them to the variable-length OUTFIL data set associated with ddname
VINF. OUTREC is used to insert asterisks between fields. 1,4 represents the
RDW. 25 represents the variable part at the end of the input record.
Example 3
SORT FIELDS=(15,6,ZD,A)
OUTFIL FNAMES=USA,
HEADER2=(5:Parts Completion Report for USA,2/,
5:Printed on ,DATE,
at ,TIME=(12:),3/,
5:Part ,20:Completed,35: Value ($),/,
5:------,20:---------,35:------------),
OUTREC=(5:15,6,ZD,M11,
20:3,4,ZD,M12,LENGTH=9,
35:38,8,ZD,M18,LENGTH=12,
132:X)
OUTFIL FNAMES=FRANCE,
HEADER2=(5:Parts Completion Report for France,2/,
5:Printed on ,DATE=(DM4/),
at ,TIME,3/,
5:Part ,20:Completed,35: Value (F),/,
5:------,20:---------,35:------------),
OUTREC=(5:15,6,ZD,M11,
20:3,4,ZD,M16,LENGTH=9,
35:38,8,ZD,M22,LENGTH=12,
132:X)
OUTFIL FNAMES=DENMARK,
HEADER2=(5:Parts Completion Report for Denmark,2/,
5:Printed on ,DATE=(DMY-),
at ,TIME=(24.),3/,
5:Part ,20:Completed,35: Value (kr),/,
5:------,20:---------,35:------------),
OUTREC=(5:15,6,ZD,M11,
20:3,4,ZD,M13,LENGTH=9,
35:38,8,ZD,M19,LENGTH=12,
132:X)
This example illustrates how reports for three different countries can be produced
from sorted fixed-length input records. The reports differ only in the way that date,
time, and numeric formats are specified:
1. The first OUTFIL statement produces a report that has the date, time, and
numeric formats commonly used in the United States.
2. The second OUTFIL statement produces a report that has the date, time, and
numeric formats commonly used in France.
3. The third OUTFIL statement produces a report that has the date, time, and
numeric formats commonly used in Denmark.
Of course, any one of the three reports can be produced by itself using a single
OUTFIL statement instead of three OUTFIL statements. (This may be necessary if
you are sorting character data according to a specified locale for that country.)
The HEADER2 parameter specifies the page header to appear at the top of each
page for that report, which will consist of:
v A line of text identifying the report. Note that all English text in the report can be
replaced by text in the language of that country.
v A blank line (2/).
v A line of text showing the date and time. Note that variations of the DATE,
DATE=(abcd), TIME, and TIME=(abc) operands are used to specify the date and
time in the format commonly used in that country.
Chapter 3. Using DFSORT Program Control Statements 267
OUTFIL Control Statements
The OUTREC parameter specifies the three columns of data to appear for each
input record as follows:
v A 6-byte edited numeric value produced by transforming the ZD value in bytes 15
through 20 according to the pattern specified by M11. M11 is a pattern for
showing integers with leading zeros.
v A 9-byte (LENGTH=9) edited numeric value produced by transforming the ZD
value in bytes 3 through 6 according to the pattern for integer values with
thousands separators commonly used in that country. M12 uses a comma for the
thousands separator. M16 uses a blank for the thousands separator. M13 uses a
period for the thousands separator.
v A 12-byte (LENGTH=12) edited numeric value produced by transforming the ZD
value in bytes 38 through 45 according to the pattern for decimal values with
thousands separators and decimal separators commonly used in that country.
M18 uses a comma for the thousands separator and a period for the decimal
separator. M22 uses a blank for the thousands separator and a comma for the
decimal separator. M19 uses a period for the thousands separator and a comma
for the decimal separator.
Table 37 on page 215 shows the twenty-seven pre-defined edit masks (M0-M26)
from which you can choose.
132:X is used at the end of the OUTREC parameter to ensure that the data records
are longer than the report records. This will result in an LRECL of 132 for the
fixed-length OUTFIL data sets (1 byte for the ANSI control character and 131 bytes
for the data).
Example 4
SORT FIELDS=(3,10,A,16,13,A),FORMAT=CH
OUTFIL FNAMES=WEST,
INCLUDE=(42,6,CH,EQ,CWest),
HEADER1=(5/,18: Western Region,3/,
18:Profit and Loss Report,3/,
18: for ,&DATE,3/,
18: Page,&PAGE),
OUTREC=(6:16,13,24:31,10,ZD,M5,LENGTH=20,75:X),
SECTIONS=(3,10,SKIP=P,
HEADER3=(2:Division: ,3,10,5X,Page:,&PAGE,2/,
6:Branch Office,24: Profit/(Loss),/,
6:-------------,24:--------------------),
TRAILER3=(6:=============,24:====================,/,
6:Total,24:TOTAL=(31,10,ZD,M5,LENGTH=20),/,
6:Lowest,24:MIN=(31,10,ZD,M5,LENGTH=20),/,
6:Highest,24:MAX=(31,10,ZD,M5,LENGTH=20),/,
6:Average,24:AVG=(31,10,ZD,M5,LENGTH=20),/,
3/,2:Average for all Branch Offices so far:,
X,SUBAVG=(31,10,ZD,M5))),
TRAILER1=(8:Page ,&PAGE,5X,Date: ,&DATE,5/,
8:Total Number of Branch Offices Reporting: ,
COUNT,2/,
8:Summary of Profit/(Loss) for all,
Western Division Branch Offices,2/,
12:Total:,
22:TOTAL=(31,10,ZD,M5,LENGTH=20),/,
12:Lowest:,
22:MIN=(31,10,ZD,M5,LENGTH=20),/,
12:Highest:,
22:MAX=(31,10,ZD,M5,LENGTH=20),/,
12:Average:,
22:AVG=(31,10,ZD,M5,LENGTH=20))
This example illustrates how a report can be produced with a header and trailer
page and sections of columns of data, from a sorted subset of fixed-length input
records.
The FNAMES parameter specifies the ddname (WEST) associated with the
fixed-length data set for the report.
The INCLUDE parameter specifies the records to be selected for the report.
The HEADER1 parameter specifies the report header to appear as the first page of
the report, which will consist of five blank lines (5/) followed by four lines of text,
each separated by 2 blank lines (3/). The last two lines of text will show the date
(&DATE) and page number (&PAGE), respectively.
The OUTREC parameter specifies the two columns of data to appear for each
selected input record as follows:
v The character string from bytes 16 through 28 of the input record.
v A 20-byte (LENGTH=20) edited numeric value produced by transforming the ZD
value in bytes 31 through 40 according to the pattern specified by M5.
The SECTIONS parameter specifies the section break field (3,10), page ejects
between sections (SKIP=P), the header (HEADER3) to appear before each section
and the trailer (TRAILER3) to appear after each section. The section header will
consist of a line of text showing the page number, a blank line (2/) and two lines of
text showing the headings for the columns of data. The section trailer will consist of
a line of text separating the data from the trailer, lines of text showing the total
(TOTAL), minimum (MIN), maximum (MAX) and average (AVG) for the data in the
section as edited numeric values, two blank lines, and a line of text showing the
running average (SUBAVG) for all of the data records in the report up to this point.
The TRAILER1 parameter specifies the report trailer to appear as the last page of
the report, which will consist of a line of text showing the page and date, four blank
lines (5/), a text line showing the count of data records in the report, a blank line, a
line of text, a blank line, and lines of text showing the total, minimum maximum and
average for all of the data in the report as edited numeric values.
75:X is used at the end of the OUTREC parameter to ensure that the data records
are longer than the report records. This will result in an LRECL of 76 for the
fixed-length OUTFIL data set (1 byte for the ANSI control character and 75 bytes for
the data).
Western Region
for 05/11/95
Page 1
Total: 25,312,257.22
Lowest: (32,434.31)
Highest: 5,412,300.05
Average: 1,406,236.51
Example 5
SORT FIELDS=(6,5,CH,A)
OUTFIL FNAMES=STATUS,
HEADER2=(1:CPAGE ,&PAGE,C OF STATUS REPORT FOR ,&DATE,2/,
6:CITEM ,16:CSTATUS ,31:CPARTS,/,
6:C-----,16:C------------,31:C-----),
OUTREC=(1,4,
10:6,5,
20:14,1,CHANGE=(12,
C1,CSHIP,
C2,CHOLD,
C3,CTRANSFER),
NOMATCH=(C*CHECK CODE*),
37:39,1,BI,M10,
120:X)
This example illustrates how a report can be produced with a page header and
columns of data from sorted variable-length input records, using a lookup table.
The FNAMES parameter specifies the ddname (STATUS) associated with the
variable-length data set for the report.
The HEADER2 parameter specifies the page header to appear at the top of each
page, which will consist of a line of text showing the page number (&PAGE) and
date (&DATE), a blank line (2/), and two lines of text showing headings for the
columns of data.
The OUTREC parameter specifies the RDW and three columns of data to appear
for each input record as follows (remember that byte 5 is the first byte of data for
variable-length records):
v The character string from bytes 6 through 10 of the input record
v A character string produced by finding a match for byte 14 of the input record in
the table defined by CHANGE (lookup and change). NOMATCH indicates the
character string to be used if byte 14 does not match any of the entries in the
CHANGE table.
v An edited numeric value produced by transforming the BI value in byte 39
according to the pattern specified by M10.
With variable-length input records, you must account for the RDW when specifying
the c: values for OUTREC, but not for headers or trailers. The 1: used for the first
line of HEADER2 causes it to start in the first data byte (by contrast, 5: must be
used to specify the first OUTREC data byte for variable-length records). Also, since
6: is used for the ITEM heading, 10: must be used for the ITEM data to get the
heading and data to line up in columns.
120:X is used at the end of the OUTREC parameter to ensure that the data records
are longer than the report records. This will result in a maximum LRECL of 121 for
the variable-length OUTFIL data set (1 byte for the ANSI control character and a
maximum of 120 bytes for the data).
Example 6
|
| OPTION COPY
| OUTFIL FNAMES=(PIPE1,PIPE2,PIPE3,PIPE4,PIPE5),SPLIT
| OUTFIL FNAMES=(OUT1,OUT2),SPLITBY=25
|
| This example illustrates different ways to split output records among data sets.
| The first OUTFIL statement splits the output records as evenly as possible among a
| set of pipes. The first record will be written to the writer associated with PIPE1, the
| second to PIPE2, the third to PIPE3, the fourth to PIPE4, the fifth to PIPE5, the
| sixth to PIPE1, and so on until all of the records have been written.
| The second OUTFIL statement splits the output records 25 records at a time among
| a set of output data sets. Records 1-25 will be written to the data set associated
| with OUT1, records 26-50 to OUT2, records 51-75 to OUT1, and so on until all of
| the records have been written.
Example 7
OPTION COPY
OUTFIL FNAMES=RANGE1,ENDREC=1000000
OUTFIL FNAMES=RANGE2,STARTREC=1000001,ENDREC=2000000
OUTFIL FNAMES=RANGE3,STARTREC=2000001,ENDREC=3000000
OUTFIL FNAMES=RANGE4,STARTREC=3000001,ENDREC=4000000
OUTFIL FNAMES=(RANGE5,EXTRA),STARTREC=4000001
This example illustrates how specific ranges of output records can be written to
different output data sets. A typical application might be database partitioning.
The first 1 million records will be written to the data set associated with RANGE1,
the second million to RANGE2, the third million to RANGE3, and the fourth million
to RANGE4. The remaining records will be written to both the data set associated
with RANGE5 and the data set associated with EXTRA (SAVE or
STARTREC=4000001 will accomplish the same purpose in this case).
Note that the INCLUDE, OMIT, and SAVE parameters of OUTFIL can also be used
to select records to be written to different output data sets, based on criteria you
specify.
Example 8
OPTION COPY,Y2PAST
OUTFIL FNAMES=Y4,
OUTREC=(1,19,
21,2,PD0,M11,C/, transform mm
22,2,PD0,M11,C/, transform dd
20,2,Y2P, transform yy to yyyy
24,57)
This example illustrates how to transform an existing data set with a packed
decimal date field of the form Pyymmdd (X0yymmddC) in bytes 20-23 into a new
data set with a character date field of the form Cmm/dd/yyyy in bytes 20-29. yy
represents the two-digit year, yyyy represents the four-digit year, mm represents the
month, dd represents the day, and C represents a positive sign.
The input data set has an LRECL of 80 and the Y4 data set will have an LRECL of
86.
The Y2PAST=26 option sets the century window to be used to transform two-digit
years into four-digit years. If the current year is 1996, the century window will be
1970 to 2069. Using this century window, the input and output fields might be as
follows:
Input Field (HEX) Output Field (CH)
20 20
| |
0020505F 05/05/2002
0950823C 08/23/1995
0980316C 03/16/1998
0000316F 03/16/2000
Example 9
OPTION COPY,Y2PAST=1996
OUTFIL FNAMES=SPCL,
OUTREC=(1,14, copy positions 1-14
15,6,Y2T, transform yy to yyyy - allow blanks
21,20) copy positions 21 - 40
This example illustrates how to transform an existing data set with a character date
field of the form Cyymmdd and blank special indicators in bytes 15-20, into a new
date set with a character date field of the form Cyyyymmdd and blank special
indicators in bytes 15-22.
The input data set has an LRECL of 40 and the SPCL data set will have an LRECL
of 42.
The Y2PAST=1996 option sets the century window to 1996-2095. The century
window will be used to transform the two-digit years into four-digit years, but will not
be used for the special blank indicators.
MORGAN HILL CA
SAN JOSE 960512 CA
BOCA RATON 000628 FL
DENVER 951115 CO
Example 10
OPTION COPY
OUTFIL FNAMES=ALL,OUTREC=(CUS ,1,10,C is in ,11,15,/,
CWW ,1,10,C is in ,26,20,2/)
OUTFIL FNAMES=(US,WW),SPLIT,
OUTREC=(1,10,C is in ,11,15,/,
1,10,C is in ,26,20)
This example illustrates how multiple OUTFIL output and blank records can be
produced from each OUTFIL input record. The input data set has an LRECL of 50
and contains the following three records:
Finance San Francisco Buenos Aires
Research New York Amsterdam
Marketing Los Angeles Mexico City
The first OUTFIL statement creates the data set associated with ddname ALL. This
data set will have an LRECL of 40 (the length of the longest output record; the one
that includes the 26,20 input field). Each input record will result in two data records
followed by two blank records as follows:
The second OUTFIL statement creates the two data sets associated with ddnames
US and WW. These data sets will have an LRECL of 37 (the length of the longest
output record; the one that includes the 26,20 input field). Each input record will
result in two data records. SPLIT will cause the first data record to be written to the
US data set and the second data record to be written to the WW data set. Thus,
each input record will create one record in each OUTFIL data set as follows:
US data set
Finance is in San Francisco
Research is in New York
Marketing is in Los Angeles
WW data set
Example 11
SORT FIELDS=(6,3,CH,D)
OUTFIL FNAMES=SET60,OUTREC=(1,60),VLFILL=C' '
OUTFIL FNAMES=VARFIX,VTOF,OUTREC=(5,20,5X,28,20),VLFILL=C'*'
This example illustrates how variable-length records that are too short to contain all
OUTFIL OUTREC fields can be processed successfully.
The input data set has RECFM=VB and LRECL=80. The records in this data set
have lengths that vary from 15 bytes to 75 bytes.
The first OUTFIL statement creates the data set associated with ddname SET60.
This data set will have RECFM=VB and LRECL=60. Every record in this data set
will have a length of 60. The 1,60 field truncates records longer than 60 bytes to 60
bytes. Because VLFILL=C' ' is specified, the 1,60 field pads records shorter than 60
bytes to 60 bytes using a blank (C' ') as the fill byte.
The second OUTFIL statement creates the data set associated with ddname
VARFIX. This data set will have RECFM=FB and LRECL=45. VTOF changes the
variable-length input records to fixed-length output records according to the fields
specified by OUTREC. VLFILL=C'*' allows short input records to be processed.
Each missing byte in an OUTFIL OUTREC field is replaced with an asterisk (C'*') fill
byte.
Notes:
1. CONVERT can be used instead of VTOF.
2. VLFILL=C* overrides the default of VLFILL=X40 for VTOF or CONVERT.
Example 12
| OPTION COPY
| OUTFIL OUTREC=(SEQNUM,4,BI,Z,8,5,ZD,TO=PD,Z,
| 31,2,PD,TO=FI,LENGTH=2),Z,
| 16,3,ZD,ADD,+1,TO=FI,LENGTH=2,Z,
| (16,3,ZD,MAX,31,2,PD),MUL,+2,TO=ZD,LENGTH=4)
| This example illustrates how a sequence number can be generated, how values in
| one numeric format can be converted to another numeric format, and how
| arithmetic expressions involving fields and decimal constants can be used.
| The input data set has an LRECL of 50 and the SORTOUT data set will have an
| LRECL of 19.
The OUTFIL statement creates output records with the following fields:
v A binary sequence number in bytes 1-4 that starts at 1 and increments by 1.
v X00 in byte 5.
v A PD field in bytes 6-8 containing the converted ZD field from input bytes 8-12
v X00 in position 9.
v An FI field in bytes 10-11 containing the converted PD field from input bytes
31-32.
| v X00 in position 12.
| v An FI field in bytes 13-14 containing the converted result of the ZD field from
| input bytes 16-18 incremented by 1.
| v X00 in position 15.
| v A ZD field in bytes 16-19 containing the converted result of the maximum of the
| ZD field from input bytes 16-18 and the PD field from input bytes 31-32,
| multiplied by 2.
Example 13
SORT FIELDS=COPY
OUTFIL FNAMES=VAROUT1,FTOV
OUTFIL FNAMES=VAROUT2,FTOV,
OUTREC=(20,8,35,10)
OUTFIL FNAMES=VAROUT3,FTOV,VLTRIM=X40
This example illustrates several ways to convert a fixed-length record data set to a
variable-length record data set using the FTOV parameter of OUTFIL.
Example 14
OPTION COPY
OUTFIL FNAMES=OUT1,OUTREC=(DATE1(/),X,TIME1(:),X,1,80)
OUTFIL FNAMES=OUT2,OUTREC=(DATE2P,TIME3P,1,80)
OUTFIL FNAMES=OUT3,OUTREC=(DATE3(.),X,TIME2,X,1,80)
This example illustrates several different ways to insert timestamps into your
records.
The first OUTFIL statement creates the data set associated with ddname OUT1.
This data set will have LRECL=100. Each output record will have a timestamp
consisting of the date and time of the run in the form C'yyyy/mm/dd hh:mm:ss ' (20
bytes), followed by the original input record (80 bytes).
The second OUTFIL statement creates the data set associated with ddname OUT2.
This data set will have LRECL=86. Each output record will have a timestamp
consisting of the date of the run in the form P'yyyymm (4 bytes) and the time of the
run in the form P'hh' (2 bytes), followed by the original input record (80 bytes).
The third OUTFIL statement creates the data set associated with ddname OUT3.
This data set will have LRECL=94. Each output record will have a timestamp
consisting of the date and time of the run in the form C'yyyy.ddd hhmm ' (14 bytes),
followed by the original input record (80 bytes).
Example 15
OPTION COPY
OUTREC FIELDS=(1,4,11,4,DT1,7,4,TM1,60:X)
OUTFIL NODETAIL,
TRAILER1=(//,
3:Earliest SMF timestamp is ,
MIN=(5,14,ZD,EDIT=(TTTT/TT/TT TT:TT:TT)),/,
3:Latest SMF timestamp is
MAX=(5,14,ZD,EDIT=(TTTT/TT/TT TT:TT:TT)))
This example illustrates how the earliest and latest timestamps from a set of SMF
records can be displayed.
The OUTREC statement uses the DT1 format to convert the SMF date in input
bytes 11-15 to a Z'yyyymmdd' value in bytes 5-12, and uses the TM1 format to
convert the SMF time in input bytes 7-10 to a Z'hhmmss' value in bytes 13-18.
Example 16
SORT FIELDS=(1,20,BI,A)
OUTFIL FNAMES=FUPPER,OUTREC=(1,80,TRAN=LTOU)
OUTFIL FNAMES=FHEX,OUTREC=(1,80,HEX)
OUTFIL FNAMES=FTR,OUTREC=(1,80,TRAN=ALTSEQ)
ALTSEQ CODE=(005C)
This example illustrates three types of conversion for fixed length records:
lowercase to uppercase conversion, hex conversion, and conversion using an
ALTSEQ table.
The first OUTFIL statement creates the data set associated with ddname FUPPER.
This data set will have RECFM = FB and LRECL = 80. All of the lowercase
EBCDIC characters (a-z) from byte 1 to byte 80 will be converted to uppercase
EBCDIC characters (A-Z). Other characters will remain unchanged. For example,
the characters san jose, ca 95193 will be converted to SAN JOSE, CA 95193.
The second OUTFIL statement creates the data set associated with ddname FHEX.
This data set will have RECFM = FB and LRECL = 160 (2 * 80 data bytes). Each
byte from 1 to 80 will be converted to the two bytes representing its hex value. For
example, the three characters A12 will be converted to the six characters
C1F1F2.
The third OUTFIL statement creates the data set associated with ddname FTR. This
data set will have RECFM = FB and LRECL = 80. Each binary zero (X00) from
byte 1 to byte 80 will be converted to an * (X5C). Other characters will remain
unchanged.
Note: The ALTSEQ table is not used for the SORT field because its format is BI
and not AQ.
Example 17
OPTION COPY
OUTFIL FNAMES=VUPPER,OUTREC=(1,4,5,TRAN=UTOL)
OUTFIL FNAMES=VHEX,OUTREC=(1,4,5,HEX)
OUTFIL FNAMES=VTR,OUTREC=(1,4,5,TRAN=ALTSEQ)
ALTSEQ CODE=(F040,5C40)
The first OUTFIL statement creates the data set associated with ddname VUPPER.
This data set will have RECFM = VB and LRECL = 5000. All of the uppercase
EBCDIC characters (A-Z) from bytes 5 (after the RDW) to the end of each record
will be converted to lowercase EBCDIC characters (a-z). Other characters will
remain unchanged. For example, the characters SAN JOSE, CA 95193 will be
converted to san jose, ca 95193.
The second OUTFIL statement creates the data set associated with ddname VHEX.
This data set will have RECFM = VB and LRECL = 9996 (4 for RDW plus 2 * 4996
data bytes). Each byte from 5 (after the RDW) to the end of each record will be
converted to the two bytes representing its hex value. For example, the three
characters A12 will be converted to the six characters C1F1F2.
The third OUTFIL statement creates the data set associated with ddname VTR.
This data set will have RECFM = VB and LRECL = 5000. Each 0 (XF0) and *
(X5C) character from bytes 5 (after the RDW) to the end of each record will be
converted to a space (X40). Other characters will remain unchanged.
Example 18
|
| SORT FIELDS=(22,8,CH,A)
| OUTFIL FNAMES=SAMP1,REMOVECC,HEADER1=(Sample 1,2/),
| STARTREC=120,SAMPLE=(20,4),
| OUTREC=(1,8,9,5,PD,ZD,C***,14,50)
| OUTFIL FNAMES=SAMP2,REMOVECC,HEADER1=(Sample 2,2/),
| SAMPLE=1000,ENDREC=5001
|
This example illustrates how to take different samples of sorted output records.
Sorted records 120, 121, 122, 123, 140, 141, 142, 143, and so on will be
reformatted as indicated by the OUTREC parameter and written to the output data
set associated with SAMP1. The heading Sample 1 will appear before the sample
output records.
Sorted records 1, 1001, 2001, 3001, 4001 and 5001 will be written to the output
data set associated with SAMP2. The heading Sample 2 will appear before the
sample output records.
Example 19
|
| OPTION COPY
| OUTFIL FNAMES=R500,REPEAT=500
| OUTFIL FNAMES=R100,OUTREC=(SEQNUM,4,ZD,80XFF),REPEAT=100
|
| This example illustrates how one record can be used to generate many records.
| The first OUTFIL statement writes each output record 500 times to the data set
| associated with R500. Each set of 500 records will be identical.
| The second OUTFIL statement writes each reformatted output record 100 times to
| the data set associated with R100. Each set of 100 records will be identical except
| for the sequence number. The 100 records written from the first output record will
| have sequence numbers 1-100, the 100 records written from the second output
| record will have sequence numbers 101-200, and so on.
| ,
OUTREC 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
The OUTREC control statement allows you to reformat the input records before
they are output. That is, to define which parts of the input record are included in the
reformatted output 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
output record consists of those fields only, in the order in which you have specified
them, and aligned on the boundaries or in the columns you have indicated.
For information concerning the interaction of INREC and OUTREC, see INREC
Statement Notes on page 127 and OUTREC Statement Notes on page 289.
The OUTREC statement differs from the OUTREC parameter of the OUTFIL
statement in the following ways:
v The OUTREC statement applies to all input records; the OUTREC parameter
applies only to the OUTFIL input records for its OUTFIL group.
v The OUTREC parameter supports the slash (/) separator for creating blank
records and new records, whereas the OUTREC statement does not.
See OUTFIL Control Statements on page 194 for complete details on the OUTFIL
OUTREC parameter.
FIELDS
| ,
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 separation fields (blanks, zeros, strings,
| current date and current time), unedited and edited input fields, decimal
| constants, edited results of arithmetic expressions, and sequence numbers in
| the reformatted output records.
| c: specifies the position (column) for a separation field, input field decimal
| constant, arithmetic expression, or sequence number, relative to the start of
See Table 20 on page 119 for examples of valid and invalid column
alignment.
s specifies that a separation field (blanks, zeros, character string,
hexadecimal string, current date, or current time) is to appear in the
reformatted output record. It can be specified before or after any input field.
Consecutive separation fields may 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', and 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 output records. n can range from 1 to 4095. If n is
omitted, 1 is used.
See Table 21 on page 120 for examples of valid and invalid blank
separation.
nZ Binary zero separation. n bytes of binary zeros (X'00') are to appear
in the reformatted output records. n can range from 1 to 4095. If n
is omitted, 1 is used.
See Table 22 on page 120 for examples of valid and invalid binary
zero separation.
nC'xx...x'
Character string separation. n repetitions of the character string
constant (C'xx...x') are to appear in the reformatted output 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:
p,m,a
specifies that an unedited input field is to appear in the reformatted output
record.
p specifies the first byte of the input field relative to the beginning of the input
record.11 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 four bytes are occupied by the RDW. All fields must start
on a byte boundary, and no field may extend beyond byte 32752. See
OUTREC Statement Notes on page 289 for special rules concerning
variable-length records.
m specifies the length of the input field. It must include the sign if the data is
signed and must be a whole number of bytes. See OUTREC Statement
Notes on page 289 for more information.
a specifies the alignment (displacement) of the input field in the reformatted
output record relative to the start of the reformatted output record.
The 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 2
(that is, position 1, 3, 5, and so forth).
F Fullword aligned. The displacement is a multiple of 4 (that is,
position 1, 5, 9, and so forth).
D Doubleword aligned. The displacement is a multiple of 8 (that is,
position 1, 9, 17, and so forth).
11. If INREC is specified, p must refer to the record as reformatted by INREC. If your E15 user exit reformats the record, and INREC
is not specified, p must refer to the record as reformatted by your E15 user exit.
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 output
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 output 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 output
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 output 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 output 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 output record, as the last
field.
See p,TRAN=ALTSEQ under OUTFIL OUTREC for details.
Sample Syntax:
Fixed input records
OUTREC FIELDS=(1:5,10,15:8C0,
25:20,15,TRAN=LTOU,80:X)
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 output 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:
OUTREC 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 output 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:
OUTREC 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 output 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:
OUTREC 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 output
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:
| OUTREC 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
output 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:
OUTREC 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 output
| 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:
| OUTREC FIELDS=(-5000,EDIT=(-T,TT.T),21:(+0),M11,LENGTH=7)
| deccon,to or (deccon),to
| specifies that a converted decimal constant is to appear in the reformatted
| output 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:
| OUTREC FIELDS=(+1,PD,LENGTH=6,(-1),PD,LENGTH=6,
| -50,TO=ZD,LENGTH=8)
| arexp,edit or (arexp),edit
| specifies that the edited result of an arithmetic expression is to appear in the
| reformatted output 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:
| OUTREC FIELDS=(C**,27,2,FI,SUB,
| 83,4,PD,EDIT=(STTTTTTT),SIGNS=(+,-),
| 25:(((15,5,ZD,MUL,+2),ADD,+100),MAX,62,2,PD),M25,LENGTH=12)
| arexp,to or (arexp),to
| specifies that the converted result of an arithmetic expression is to appear in
| the reformatted output 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:
| OUTREC FIELDS=((15,6,FS,DIV,+5),ADD,(-1,ADD,36,6,FS),TO=FI,X,
| 3,2,FI,MAX,-6,LENGTH=4,TO=FS)
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 output record.
See p,m,Y2x,edit under OUTFIL OUTREC for details.
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 output 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 output 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:
OUTREC 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 output record.
The sequence numbers are assigned in the order in which the records are
received for OUTREC 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:
OUTREC FIELDS=(SEQNUM,6,ZD,START=1000,INCR=50,1,60)
be omitted. If INREC and OUTREC are both specified, either both must specify
position-only for the last part, or neither must specify position-only for the last
part.
| 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.
v The reformatted output records are in the format specified by OUTREC
regardless of whether INREC was specified.
v Fields referenced in OUTREC statements can overlap each other or control
fields.
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 When OUTREC is specified, your E35 user exit routine must refer to fields in the
reformatted output record.
v DFSORT issues a message and terminates processing if an OUTREC statement
is specified for a tape work data set sort or conventional merge application.
v When you specify OUTREC, VLSHRT is not used. If VLSHRT is specified, it is
ignored.
| 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.
Example 1
OUTREC FIELDS=(11,32)
This statement specifies that the output record is to contain 32 bytes beginning with
byte 11 of the input record. This statement can be used only with fixed-length input
records, because it does not include the first 4 bytes.
Example 2
OUTREC FIELDS=(1,4,11,32,D,101)
This statement is for variable-length records of minimum length 100 bytes, and
specifies that the output record is to contain an RDW plus 32 bytes of the input
record starting at byte 11 (aligned on a doubleword boundary, relative to the start of
the record) plus the entire variable portion of the input record.
Example 3
OUTREC FIELDS=(1,42,D,101)
This statement is for variable-length records of minimum length 100 bytes, and
specifies that the output record should contain an RDW plus the first 38 data bytes
of the input record plus the entire variable portion of the input record.
The 'D' parameter has no effect because the first field is always placed at the
beginning of the output record.
Example 4
SORT FIELDS=(20,4,CH,D,10,3,CH,D)
OUTREC FIELDS=(7:20,4,C FUTURE ,20,2,10,3,1Z,1,9,13,7,
24,57,TRAN=LTOU,6XFF)
This example illustrates how a fixed-length input data set can be sorted and
reformatted for output. The SORTIN LRECL is 80 bytes.
The reformatted output records are fixed length with a record size of 103 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
103. The reformatted records look as follows:
Position Contents
1-6 EBCDIC blanks for column alignment
7-10 Input positions 20 through 23
11-18 Character string: C' FUTURE '
19-20 Input positions 20 through 21
21-23 Input positions 10 through 12
24 Binary zero
25-33 Input positions 1 through 9
34-40 Input positions 13 through 19
41-97 Input positions 24 through 80 with lowercase EBCDIC letters
converted to uppercase EBCDIC letters
98-103 Hexadecimal string: X'FFFFFFFFFFFF'
Example 5
SORT FIELDS=(12,4,PD,D)
RECORD TYPE=V,LENGTH=(,,,100)
OUTREC FIELDS=(1,7,5Z,5X,28,8,6X,101)
This example illustrates how a variable-length input data set can be sorted and
reformatted for output. The variable part of the input records is included in the
output records. The minimum input record size is 100 bytes and the maximum input
record size (SORTIN LRECL or maximum record size for VSAM) is 200 bytes.
The reformatted output records are variable-length with a maximum record size of
131 bytes. The reformatted records look as follows:
Position Contents
1-4 RDW (input positions 1 through 4)
5-7 Input positions 5 through 7
8-12 Binary zeros
13-17 EBCDIC blanks
18-25 Input positions 28 through 35
26-31 EBCDIC blanks
32-n Input positions 101 through n (variable part of input records)
Example 6
MERGE FIELDS=(28,4,BI,A)
OUTREC FIELDS=(1,4,5Z,5X,5,3,28,8,6Z,DATE3,TIME1)
This example illustrates how input files can be merged and reformatted for output,
with the current date and current time included. The variable part of the input
records is not to be included in the output records. The SORTINnn LRECL is 50
bytes.
The reformatted output records are variable-length with a maximum record size of
44 bytes. The reformatted records look as follows:
Position Contents
1-4 RDW (input positions 1 through 4)
5-9 Binary zeros
10-14 EBCDIC blanks
15-17 Input positions 5 through 7
18-25 Input positions 28 through 35
26-31 Binary zeros
32-38 The current date in the form C'yyyyddd'
39-44 The current time in the form C'hhmmss'
Example 7
OPTION COPY,Y2PAST=1985
OUTREC FIELDS=(SEQNUM,8,ZD,START=1000,INCR=100,
11:8,4,PD,M12,
31:15,4,Y2V(/),
51:2,1,CHANGE=(3,
X01,CL92,X02,CM72,X03,CJ42),
NOMATCH=(C???))
This example illustrates how a sequence number can be generated, how numeric
and date values can be edited, and how a lookup table can be used.
Example 8
| SORT FIELDS=(11,4,CH,D)
| OUTREC FIELDS=(1,20,
| (5,4,FI,ADD,3,2,FI,ADD,23,2,FI),DIV,+1000,
| EDIT=(STTTTTTT),SIGNS=(,-),2X,
| 9,5,ZD,MIN,16,5,FS,TO=ZD,LENGTH=5,2X,
| 21,40)
| This example illustrates how input records can be reformatted for output to contain
| the results of arithmetic expressions involving input fields, decimal constants,
| operators and parentheses.
RECORD TYPE= F
V
D
LENGTH=( L1 )
TYPE =F,
, L2
L1
, , L3
L1 L2
LENGTH=( L1 )
TYPE= V ,
D , L2
L1
, , L3
L1 L2
, , , L4
L1 L2 L3
, , , , L5
L1 L2 L3 L4
, , , , , L6
L1 L2 L3 L4 L5
, , , , , , L7
L1 L2 L3 L4 L5 L6
The RECORD control statement can be used to specify the type and lengths of the
records being processed, and the minimum and average record lengths for a
variable-length sort.
TYPE=x
Can be used to specify the record type when input is VSAM, or an E15 or E32
exit supplies all of the input records. The record type can be:
v Fixed-length (F). The records are processed without an RDW, so the data
starts in position 1. Control statement positions should be specified
accordingly.
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).
v Variable-length (V). The records are processed with an RDW in positions
1-4, so the data starts in position 5. Control statement positions should be
specified accordingly.
An RRDS, KSDS, ESDS or VRRDS can always be processed as
variable-length. For VSAM input, DFSORT reads each record and prepends
an RDW to it. For VSAM output, DFSORT removes the RDW before writing
each record.
TYPE is only required for a Conventional merge or tape work data set sort that
uses VSAM input or an E15 or E32 exit that supplies all of the input records.
If input is non-VSAM, DFSORT determines the record type from the RECFM of
the input data set and ignores TYPE.
If input is VSAM, or an E15 or E32 exit supplies all of the input records,
DFSORT determines or assigns the record type as follows, using the
information in the order listed:
1. F or V from RECORD TYPE if specified.
2. F or V from SORTOUT RECFM if available.
3. V if OUTFIL VTOF, CONVERT or VLFILL is specified, or F if OUTFIL FTOV
is specified.
4. F or V from OUTFIL RECFM if available.
5. V if SORTIN is VSAM and SORTOUT is VSAM; otherwise F.
Notes:
1. If the selected record type is not what you want DFSORT to use, specify
RECORD TYPE=F or RECORD TYPE=V as appropriate.
2. For a Conventional merge or tape work data set sort, you must specify
RECORD TYPE=F or RECORD TYPE=V as appropriate.
LENGTH= (
L1 )
, L2
L1
, , L3
L1 L2
, , , L4
L1 L2 L3
, , , , L5
L1 L2 L3 L4
, , , , , L6
L1 L2 L3 L4 L5
, , , , , , L7
L1 L2 L3 L4 L5 L6
Default: The SORTIN or SORTINnn record length. For VSAM data sets, the
maximum record size (RECSZ value).
L2
Record length after E15. For variable-length records, maximum record
length after E15.
Notes:
1. L2 is ignored if E15 is not used.
2. An accurate value for L2 must be specified if E15 changes the record
length.
3. L2 must be at least 18 bytes if tape work data sets are used.
4. L2 is ignored if there is no SORTIN or SORTINnn data set, unless L1 is
not specified.
Default: L1.
L3
Output record length. For variablelength records, maximum output record
length.
Default: The minimum length needed to contain all control fields. This
number must be at least 18 bytes if the maximum input record length is
greater than 18 bytes; otherwise, DFSORT sets L4 to 18 bytes.
L5
Average record length.
Notes:
1. L5 is not used if the Blockset technique is selected
2. L5 is overridden by the AVGRLEN parameter if both are specified
3. L5 is only used for variable-length sorts.
This example illustrates how the RECORD statement can be used to indicate that
E15 and E35 exits change the record length. The record type (F) and input record
length (200) are obtained automatically from the RECFM and LRECL of the input
data set, respectively.
LENGTH
L2 specifies that the E15 exit passes back 175 byte records. L3 specifies
that the E35 exit passes back 180 byte records.
Example 2
MODS E15=(E15ONLY,1000,EXIT)
RECORD TYPE=V,LENGTH=60
This example illustrates how the RECORD statement can be used to set the record
type and maximum input record length when an E15 exit supplies all of the input as
variable-length records.
TYPE
V specifies that the E15 exit inserts variable-length records, that is, the inserted
records contain an RDW in positions 1-4 and the data starts in position 5.
LENGTH
L1 specifies that the E15 exit inserts records with a maximum length of 60
bytes.
| ,
( E p,m, s ) , FORMAT=f
f,
COPY
(COPY)
,
, E CKPT
DYNALLOC
= d
(d)
(,n)
(d,n)
OFF
(OFF)
EQUALS
NOEQUALS
FILSZ= x
Ex
Ux
SIZE= y
Ey
Uy
SKIPREC=z
STOPAFT=n
Y2PAST= s
f
The SORT control statement must be used when a sorting application is performed;
this statement describes the control fields in the input records on which the program
sorts. A SORT statement can also be used to specify a copy application. User
labels will not be copied to the output data sets.
The way in which DFSORT processes short SORT 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 sorting short records, see the discussion of the VLSHRT
and NOVLSHRT options in OPTION Control Statement on page 142.
The options available on the SORT statement can be specified in other sources as
well. A table showing all possible sources for these options and the order of
override is given in Appendix B, Specification/Override of DFSORT Options, on
page 625.
DFSORT accepts but does not process the following SORT operands:
WORK=value and ORDER=value.
If locale processing is to be used, the active locale will only be used to process
character (CH) control fields.
FIELDS=( E p,m,f,s )
Requires four facts about each control field in the input records: the position of
the field within the record, the length of the field, the format of the data in the
field, and the sequence into which the field is to be sorted. These facts are
communicated to DFSORT by the values of the FIELDS operand, represented
by p, m, f, and s.
All control fields must be located within the first 32752 bytes of a record.
Control fields must not extend beyond the shortest record to be sorted unless
VLSHRT is in effect. The collected control fields (comprising the control word)
must not exceed 4092 bytes (or 4088 bytes when EQUALS is in effect). The
FIELDS operand can be written in two ways.
The program examines the major control field first, and it must be specified first.
The minor control fields are specified following the major control field. p, m, f,
and s describe the control fields. The text that follows gives specifications in
detail.
p specifies the first byte of a control field relative to the beginning of the input
record. 12
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. The first 4
bytes contain the record descriptor word. All control fields, except binary,
12. If INREC is specified, p must refer to the record as reformatted by INREC. If your E15 user exit reformats the record, and INREC
is not specified, p must refer to the record as reformatted by your E15 user exit.
4.0
4.
4
m specifies the length of the control field. Values for all control fields except
binary fields must be expressed in integer numbers of bytes. Binary fields
can be expressed in the notation bytes.bits. The length of a binary control
field that is an integer value (d) can be expressed in one of three ways:
d.0
d.
d
The number of bits specified must not exceed 7. A control field 2 bits long
would be represented as 0.2.
The total number of bytes occupied by all control fields must not exceed
4092 (or, when the EQUALS option is in operation, 4088 bytes). When you
determine the total, count a binary field as occupying an entire byte if it
occupies any part of it. For example, a binary field that begins on byte 2.6
and is 3 bits long occupies two bytes. All fields must be completely
contained within the first 32752 bytes of the record.
f specifies the format of the data in the control field. Acceptable control field
lengths (in bytes) and available formats are shown in Table 45.
Table 45. Control Field Formats and Lengths
Format Length Description
13
CH 1 to 4092 bytes Character
AQ 1 to 4092 bytes Character with alternate
collating sequence
ZD 1 to 32 bytes Signed zoned decimal
PD 1 to 32 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 bit to 4092 bytes Unsigned binary
FL 1 to 256 bytes Signed floating-point
AC 1 to 4092 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
D1 1 to 4092 bytes User-defined data type
(requires an EFS program)
Y2T 3 to 6 bytes Character or zoned yyx...x full
date format with special
indicators
Y2U 2 or 3 bytes Packed decimal yyx and
yyxxx full date format with
special indicators
Y2V 3 or 4 bytes Packed decimal yyxx and
yyxxxx full date format with
special indicators
CSF/FS, Y2 and PD0 format fields can only be used if Blockset is selected.
For Y2 format fields, real dates are collated using the century window
established by the Y2PAST option in effect, but the century window is not used
for special indicators. Thus the Y2 formats will collate real dates and special
indicators as follows:
v Y2T and Y2W:
Ascending:
BI zeros, blanks, CH/ZD zeros, lower century dates (for example,
19yy), upper century dates (for example, 20yy), CH/ZD nines, BI
ones.
Descending:
BI ones, CH/ZD nines, upper century dates (for example, 20yy),
lower century dates (for example, 19yy), CH/ZD zeros, blanks, BI
zeros.
v Y2U, Y2V, Y2X and Y2Y:
Ascending:
PD zeros, lower century dates (for example, 19yy), upper century
dates (for example, 20yy), PD nines.
Descending:
PD nines, upper century dates (for example, 20yy), lower century
dates (for example, 19yy), PD zeros.
v Y2C, Y2Z, Y2P, Y2D and Y2B:
Ascending:
Lower century years (for example, 19yy), upper century years (for
example, 20yy).
Descending:
Upper century years (for example, 20yy), lower century years (for
example, 19yy).
v Y2S:
Ascending:
BI zeros, blanks, lower century years (for example, 19yy), upper
century years (for example, 20yy), BI ones.
Descending:
BI ones, upper century years (for example, 20yy), lower century
years (for example, 19yy), blanks, BI zeros.
| You can use p,m,s rather than p,m,f,s if you use FORMAT=f to supply the
| format for the field, as described later in this section.
All floating-point data must be normalized before the program can collate it
properly. You can use an E15 or E61 user exit to do this during processing. If
you use E61, specify the E option for the value of s in the FIELDS operand for
each control field you are going to modify with this user exit.
s specifies how the control field is to be ordered. The valid codes are:
A ascending order
D descending order
E control fields to be modified
Specify E if you include an E61 user exit to modify control fields before the
program sorts them. After an E61 user exit modifies the control fields,
DFSORT collates the records in ascending order using the formats
specified. 14
For information on how to add a user exit, see Chapter 4, Using Your Own
User Exit Routines, on page 313.
FORMAT=f
| FORMAT=f can be used to specify a particular format for one or more control
| fields. f from FORMAT=f is used for p,m,s fields. f from FORMAT=f is ignored
| for p,m,f,s fields. For example, the following are all equivalent:
14. With a conventional merge or a tape work data set sort, control fields for which E is specified are treated as binary byte format
regardless of the actual format(s) specified.
| SORT FIELDS=(5,5,ZD,A,12,6,PD,D,21,3,PD,A,35,7,ZD,A)
|
| SORT FORMAT=ZD,FIELDS=(5,5,A,12,6,PD,D,21,3,PD,A,35,7,A)
|
| SORT FIELDS=(5,5,ZD,A,12,6,D,21,3,A,35,7,ZD,A),FORMAT=PD
| The permissible field formats are shown under the description of 'f' for fields.
FIELDS= COPY
(COPY)
CKPT
DYNALLOC
= d
(d)
(,n)
(d,n)
OFF
(OFF)
See the discussion of this option in OPTION Control Statement on page 142.
EQUALS or NOEQUALS
EQUALS
NOEQUALS
FILSZ or SIZE
FILSZ= x
Ex
Ux
SIZE= y
Ey
Uy
SKIPREC=z
See the discussion of this option in OPTION Control Statement on page 142.
STOPAFT
STOPAFT=n
See the discussion of this option in OPTION Control Statement on page 142.
Y2PAST
Y2PAST= s
f
See the discussion of this option in OPTION Control Statement on page 142.
FIELDS
The control field begins on the second byte of each record in the input data set,
is five bytes long, and contains floating sign data. It is to be sorted in ascending
order.
FILSZ
The data set to be sorted contains exactly 29483 records.
Example 2
SORT FIELDS=(7,3,CH,D,1,5,FI,A,398.4,7.6,BI,D,99.0,230.2,
BI,A,452,8,FL,A),DYNALLOC=(3390,4)
FIELDS
The first four values describe the major control field. It begins on byte 7 of each
record, is 3 bytes long, and contains character (EBCDIC) data. It is to be sorted
in descending order.
The next four values describe the second control field. It begins on byte 1, is 5
bytes long, contains fixed-point data, and is to be sorted in ascending order.
The third control field begins on the fifth bit (bits are numbered 0 through 7) of
byte 398. The field is 7 bytes and 6 bits long (occupies 9 bytes), and contains
binary data to be placed in descending order.
The fourth control field begins on byte 99, is 230 bytes and 2 bits long, and
contains binary data. It is to be sorted in ascending order.
The fifth control field begins on byte 452, is 8 bytes long, contains normalized
floating-point data, which is to be sorted in ascending order. If the data in this
field were not normalized, you could specify E instead of A and include your
own E61 user exit routine to normalize the field before the program examined it.
DYNALLOC
Four work data sets are allocated on 3390. The space on each data set is
calculated using the FILSZ value.
Example 3
SORT FIELDS=(3,8,ZD,E,40,6,CH,D)
FIELDS
The first four values describe the major control field. It begins on byte 3 of each
record, is 8 bytes long, and contains zoned decimal data that is modified by
your routine before sort examines the field.
The second field begins on byte 40, is 6 bytes long, contains character
(EBCDIC) data, and is sorted in descending sequence.
Example 4
SORT FIELDS=(7025,4,A,5048,8,A),FORMAT=ZD,EQUALS
FIELDS
The major control field begins on byte 7025 of each record, is 4 bytes long,
contains zoned decimal data (FORMAT=ZD), and is to be sorted in ascending
sequence.
The second control field begins on byte 5048, is 8 bytes long, has the same
data format as the first field, and is also to be sorted in ascending order.
FORMAT
| FORMAT=ZD is used to supply ZD format for the p,m,s fields and is equivalent
| to specifying p,m,ZD,s for these fields.
| With FORMAT=f, you can mix p,m,s and p,m,f,s 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,s for all fields and not use FORMAT=f, if you prefer). For
| example, the following are also valid uses of the FORMAT=f parameter:
| SORT FORMAT=BI,FIELDS=(21,4,A,5,4,PD,A,31.3,1.4,A,52,20,A)
|
| SORT FIELDS=(16,4,A,22,8,BI,D,3,2,A),FORMAT=FI
EQUALS
specifies that the sequence of equal collating records is to be preserved from
input to output.
Example 5
SORT FIELDS=COPY
FIELDS
The input data set is copied to the output data set without sorting or merging.
Example 6
OPTION Y2PAST=1950
SORT FIELDS=(21,6,Y2T,A,13,3,Y2X,D)
Y2PAST
Sets a century window of 19502049.
FIELDS
Sorts on a Cyymmdd (or Zyymmdd) date in positions 21-26 in ascending
order, and on a Pdddyy date in positions 13-15 in descending order. Real
dates are sorted using the century window of 1950-2049. Special indicators are
sorted correctly relative to the real dates.
| ,
( E p,m ) , FORMAT=f
,f
NONE
(NONE)
The SUM control statement specifies that, whenever two records are found with
equal sort or merge control fields, the contents of their summary fields are to be
added, the sum is to be placed in one of the records, and the other record is to be
deleted. If the EQUALS option is in effect the first record of summed records is
kept. If the NOEQUALS option is in effect, the record to be kept is unpredictable.
For further details, see SUM Statement Notes on page 309.
If the ZDPRINT option is in effect, positive summed ZD values are printable. If the
NZDPRINT option is in effect, positive summed ZD values are not printable. For
further details, see SUM Statement Notes on page 309.
The way in which DFSORT processes short SUM summary fields depends on
whether the VLSHRT or NOVLSHRT option is in effect. 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 sorting, merging and summing short
records, see the discussion of the VLSHRT and NOVLSHRT options in OPTION
Control Statement on page 142.
FIELDS
FIELDS= ( E p,m,f )
15. If INREC is specified, p must refer to the record as reformatted by INREC. If your E15 user exit reformats the record, and INREC
is not specified, p must refer to the record as reformatted by your E15 user exit.
FORMAT=f
| FORMAT=f can be used to specify a particular format for one or more summary
| 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:
| SUM FIELDS=(5,5,ZD,12,6,PD,21,3,PD,35,7,ZD)
|
| SUM FORMAT=ZD,FIELDS=(5,5,12,6,PD,21,3,PD,35,7)
|
| SUM FIELDS=(5,5,ZD,12,6,21,3,35,7,ZD),FORMAT=PD
| The permissible field formats are shown under the description of 'f' for fields.
Thus, ZDPRINT must be in effect to ensure that positive summed ZD results are
printable.
//SORTXSUM DD DSN=...
//SYSIN DD *
SORT FIELDS=(5,4,CH,A)
SUM FIELDS=NONE,XSUM
/*
| Tip: You can also perform additional functions with ICETOOLs SELECT operator
| that are not available with XSUM. See Chapter 6, Using ICETOOL, on page
| 381 for complete details of ICETOOLs SELECT operator.
This statement designates an 8-byte packed decimal field at byte 21, and a 4-byte
fixed-integer field at byte 11, as summary fields.
Example 2
SUM FIELDS=NONE
Example 3
SUM FIELDS=(41,8,49,4),FORMAT=ZD
OPTION ZDPRINT
These statements illustrate the use of the FORMAT operand and the ZDPRINT
option. The SUM statement designates two zoned decimal fields, one 8 bytes long
starting at byte 41, and the other 4 bytes long starting at byte 49. As a result of the
ZDPRINT option, the positive summed ZD values will be printable. Note, however,
that the ZDPRINT option does not affect ZD values which are not summed due to
overflow or unique keys. The next example shows how to use OUTFIL to make all
summary fields printable.
Example 4
SUM FIELDS=(41,8,49,4),FORMAT=ZD
OUTFIL OUTREC=(1,40,41,8,ZD,M11,49,4,ZD,M11,53,28)
These statements illustrate the use of the OUTFIL statement to ensure that all
positive ZD summary fields in the output data set are printable. Whereas the
ZDPRINT option affects only positive summed ZD fields, OUTFIL can be used to
edit positive or negative BI, FI, PD, or ZD values, whether they are summed or not.
OUTFIL can also be used to produce multiple output data sets, reports, and so on.
See OUTFIL Control Statements on page 194 for complete details about OUTFIL
processing.
Note: For purposes of illustration, this example assumes that the input records are
80 bytes long.
If you need to perform these tasks, you should be aware that DFSORT already
provides extensive facilities for working with your data in the various DFSORT
program control statements. See the discussions of the INCLUDE, OMIT, INREC,
OUTFIL, OUTREC, and SUM program control statements in Chapter 3, Using
DFSORT Program Control Statements, on page 79. You might decide that using a
program control statement to work with your records is more appropriate to your
needs.
Although this chapter discusses only routines written in assembler or COBOL, you
can write your exit routines in any language that can:
v Pass and accept the address into general register 1 of a:
Record
Full word of zeros
Parameter list.
v Pass a return code in register 15.
You can easily activate user exit routines at run-time with the MODS program
control statement (see MODS Control Statement on page 135). Alternatively,
under certain circumstances you can also activate a user exit routine by passing the
address of your exit routine in the invocation parameter list. See Chapter 5,
Invoking DFSORT from a Program, on page 363 for details.
Parameters that affect the way user exit routines are handled include:
v The MODS statement, explained in MODS Control Statement on page 135
v The E15=COB and E35=COB PARM options of the EXEC statement, explained
in Specifying EXEC/DFSPARM PARM Options on page 29
v The COBEXIT option of the OPTION statement, explained in OPTION Control
Statement on page 142
v The EXITCK option of the OPTION statement, explained in OPTION Control
Statement on page 142.
Note: To avoid ambiguity in this chapter, it is assumed that the IBM default,
EXITCK=STRONG, was selected at your site.
Certain user exit routines can be written in COBOL, using a special interface. If you
write your exit routines in PL/I, you must use the PL/I subroutine facilities.
You might need to reserve space to be used by your exits. See Use Main Storage
Efficiently on page 571 for more information about storage.
A A
INPUT/ OUPUT READ RECORD
INPUT OUTPUT
READ RECORD READ RECORD PHASE FROM EACH
PHASE PHASE
FROM SORTIN FROM SORTIN SORTINnn
A
E15 E15
CHOOSE A
RECORD
YES
MORE INPUT
A E35
RECORDS?
NO E35
E15
WRITE
RECORD WRITE
TO SORTOUT RECORD
AND/OR TO SORTOUT
RETURNS
OUTFIL AND/OR
RC=8
DATA SETS OUTFIL
DATA SETS
SORT THE
RECORDS YES
MORE INPUT A YES
MORE INPUT READ
RECORDS? RECORDS? RECORD
B NO FROM
NO SORTINnn
OUTPUT E15
PHASE GET SORTED E35
RECORD
A
RETURNS
E35 RC=8 RETURNS
RC=8
WRITE E35
RECORD EXIT
TO SORTOUT
AND/OR
OUTFIL
RETURNS
DATA SETS
RC=8
E35
RETURNS
RC=8
EXIT
Figure 16 on page 316, Table 47, and Table 48 on page 318 summarize the
functions of user exit routines and the exits and phases with which they can be
associated.
Note: For a merge application, records deleted during an E35 user exit routine
are not sequence-checked. If you use an E35 user 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.
Table 47. Functions of Routines at Program User Exits (Sort)
Functions Sort Input Phase Sort Output Phase
Open/Initialize E11, E15 user exits E31 user exit
Modify control fields E61 user exit N/A
Insert, Delete/Alter E15 user exit E35 user exit
Sum records E35 user exit1
QSAM/BSAM and VSAM SORTIN E18 user exit E38 user exit2
QSAM/BSAM SORTOUT E19 user exit2 E39 user exit3
VSAM SORTOUT N/A E39 user exit3
Determine action when intermediate storage E16 user exit4 N/A
is insufficient
Close/housekeeping E15, E17 user exits E35, E37 user exits
Terminate DFSORT E15 user exit E35 user exit
Notes:
1. The SUM control statement can be used instead of your own routine to sum records.
2. Applies only to a tape work data set sort.
3. E39 can be used for SORTOUT, but not for OUTFIL data sets.
4. Applies only to a tape work data set sort or a Peerage/Vale sort without work data sets.
Table 48. Functions of Routines at Program User Exits (Copy and Merge)
Functions Copy Merge
Open/Initialize E15, E31 user exits E31 user exit
Modify control fields N/A E61 user exit
Insert E15, E35 user exits E32, E35 user exits
Delete/alter E15, E35 user exits E35 user exit
Sum records E35 user exit E35 user exit1
Handle special I/O conditions:
QSAM/BSAM and VSAM SORTIN(nn) E38 user exit E38 user exit
QSAM/BSAM and VSAM SORTOUT E39 user exit E39 user exit
Close/housekeeping E35, E37 user exits E35, E37 user exits
Terminate DFSORT E15, E35 user exits E32, E35 user exits
Note:
1. The SUM control statement can be used instead of your own routine to sum records.
To check labels on input files, use the E18 and E38 user exits.
When an E61 user exit is used, the subsequent comparisons always arrange the
modified control fields in ascending order.
Note: Although you are altering control fields before a compare, your original
records are not altered.
Note: DFSORT also provides INCLUDE and OMIT statements, and OUTFIL
INCLUDE and OMIT parameters that automatically include or delete records
based on your field criteria. For more information on these control
statements, refer to Chapter 3, Using DFSORT Program Control
Statements, on page 79.
Summing Records
You can sum records for output by using the E35 user exit. However, you can also
use DFSORTs SUM program control statement to accomplish this without a user
exit. See SUM Control Statement on page 307.
You can use these exits to incorporate your own or your sites I/O error recovery
routines into DFSORT. Your read and write error routines must reside in a
partitioned data set (library). Your library routines are brought into main storage with
their associated phases. When DFSORT encounters an uncorrectable I/O error, it
passes the same parameters as those passed by QSAM/BSAM or VSAM. If no
user routines are supplied and an uncorrectable read or write error is encountered,
DFSORT issues an error message and then terminates.
VSAM will go directly to any routine specified in the EXLST macro you passed to
DFSORT via the E18, E38, or E39 user exit, as appropriate. Your routine must
return to VSAM via register 14. For details, see z/OS DFSMS Macro Instructions for
Data Sets or z/OS DFSMS: Using Data Sets
Terminating DFSORT
You can write an exit routine to terminate DFSORT before all records have been
processed. You must associate these routines with the E15, E16, E32, and E35
user exits.
If the user exit is entered with 31-bit addressing in effect, DFSORT passes
clean 24-bit addresses to the user exit. Such a user exit must pass 31-bit
addresses or clean 24-bit addresses back to DFSORT. The only exception is
when the high-order byte is used to identify an optional address being passed
(for example, E18 SYNAD address). In this case, DFSORT cleans the 24-bit
address.
Note: For a conventional merge or tape work data set sort application, user
exits:
must reside below 16MB virtual
must use 24-bit addressing mode
must not use a user exit address constant.
E15, and E17 user exits all use the same DCB), you can request DFSORT to
dynamically link-edit them together (see MODS statement). Alternatively, you can
link-edit them together into a partitioned data set following these rules:
1. Specify RENT as a linkage editor parameter.
2. Include an ALIAS statement for each user exit using the external entry name of
the routine (for example, the CSECT name).
3. Specify the appropriate ALIAS name for each user exit on the MODS statement.
DFSORT includes the names and locations of your user exits in the list of modules
to be run during each phase. No user exit is loaded more than once in a program
phase, but the same user exit can appear in different phases. For example, you can
use the same Read Error user exit in both phases, but not twice in one phase.
The length you specify for a user exit must include storage for the user exit itself as
well as any storage used by the user exit outside of the load modules such as I/O
buffers or COBOL library subroutines. If you specify a ddname for a user exit in the
MODS statement, it must match the DD statement that defines the library
containing that user exit. For example:
You can return control to DFSORT by performing a branch to the DFSORT return
point address in register 14 or by using a RETURN macro instruction. The
RETURN instruction can also be used to set return codes when multiple actions are
available at a user exit.
Your user exit must save all the general registers it uses. You can use the SAVE
macro instruction to do this. If you save registers, you must also restore them; you
can do this with the RETURN macro instruction.
Linkage Examples
When calling your user exit, DFSORT places the return address in general register
14 and your routines entry point address in general register 15. DFSORT has
already placed the registers save area address in general register 13. DFSORT
then makes a branch to your routine.
Your routine for the E15 user exit might incorporate the following assembler
instructions:
ENTRY E15
.
.
E15 SAVE (5,9)
.
.
RETURN (5,9)
This coding saves and restores the contents of general registers 5 through 9. The
macro instructions are expanded into the following assembler language code:
ENTRY E15
.
.
E15 STM 5,9,40(13)
.
.
LM 5,9,40(13)
BR 14
If multiple actions are available at a user exit, your routine sets a return code in
general register 15 to inform DFSORT of the action it is to take. The following
macro instruction can be used to return to DFSORT with a return code of 12 in
register 15:
RETURN RC=12
Dynamic link-editing does not support AMODE 31 or RMODE 31 for the link-edit
option T. The user exits that are link-edited together by DFSORT are not loaded
above 16MB virtual and cannot be entered in 31-bit addressing mode. User exits
link-edited with the S option retain the AMODE and RMODE attributes of the object
modules and are loaded above or below 16MB virtual depending upon the load
modules RMODE; they are entered in the addressing mode of the user exit.
Notes:
1. The Blockset technique is not used for dynamic link-editing.
2. Dynamic link-editing cannot be used with copy.
When the link-edit option T is specified for a user exit routine, that routine must
contain an entry point whose name is that of the associated program user exit. This
is to accommodate special DFSORT dynamic link-edit requirements. For example,
when the link-edit option T is specified on the MODS statement for E35, the
following assembler instructions must be included in the user exit routine associated
with the E35 user exit:
ENTRY E35
E35 .
.
or
E35 CSECT
.
.
In all other circumstances, the user exit is not required to have an entry point that
has the same name as that of the associated program user exit.
Note: To avoid special linkage editor requirements (see Summary of Rules for
User Exit Routines on page 321), you can include these functions in your
E15 user exit rather than in a separate E11 user exit routine.
E15 User Exit: Passing or Changing Records for Sort and Copy
Applications
If you write your E15 user exit in COBOL, see COBOL User Exit Routines on
page 343 and COBOL E15 User Exit: Passing or Changing Records for Sort on
page 345.
The EXITCK option affects the way DFSORT interprets certain return codes from
user exit E15. To avoid ambiguity, this section assumes that the IBM default,
EXITCK=STRONG, was selected at your site. For complete information about E15
return codes in various situations with EXITCK=STRONG and EXITCK=WEAK, see
E15/E35 Return Codes and EXITCK on page 360.
DFSORT enters the E15 user exit routine each time a new record is brought into
the input phase. DFSORT continues to enter E15 (even when there are no input
records) until the user exit tells DFSORT, with a return-code of 8, not to return.
v The user exit address constant. If you invoked DFSORT with a user exit
address constant in the parameter list, the address constant is passed to your
E15 user exit the first time it is entered. This address constant can be changed
by your E15 user exit any time it is entered; the address constant is passed
along on subsequent entries to your E15 user exit and also on the first entry to
your E35 user exit. For example, you can obtain a dynamic storage area, use it
in your E15 user exit, and pass its address to your E35 user exit.
Note: The user exit address constant must not be used for a tape work data set
sort application.
In general register 1, DFSORT places the address of a parameter list that contains
the record address and the user address constant. The list is two fullwords long and
begins on a fullword boundary. The format of the parameter list is:
Table 49. E15 User Exit Parameter List
Bytes 1 through 4 Address of the new record
Bytes 5 through 8 User exit address constant
See E15/E35 Return Codes and EXITCK on page 360 for complete details of the
meanings of return codes in various situations.
If you need to obtain storage for use by your E15 user exit routine, such as to pass
altered records to DFSORT, you can use the following strategy:
1. The first time your exit is called, obtain the storage you need
2. Use the storage you obtained each time your exit is called
3. Free the storage before you pass back return code 8 to DFSORT
Note: When you obtain your storage you can save its address in the user exit
address constant and restore it on each subsequent call to your exit.
Note: When using magnetic tape, remember that the system uses an assumed
tape length of 2400 feet. If you use tapes of a different length, the Nmax
figure is not accurate; for shorter tapes, capacity can be exceeded before
NMAX EXCEEDED is indicated.
contains the number of records with which sort is continuing. You can sort the
remainder of the data set on one or more subsequent runs, using SKIPREC to
skip over the records already sorted. Then you can merge the sort outputs to
complete the operation.
4: Try to Sort Additional Records
If you want DFSORT to continue with all of the input data set, return with a
return code of 4. If tapes are used, enough space might be available for
DFSORT to complete processing. If enough space is not available, DFSORT
generates a message and terminates. Refer to Exceeding Tape Work Space
Capacity on page 623.
8: Terminate DFSORT
If you want DFSORT to terminate, return with a return code of 8. DFSORT then
returns to its calling program or to the system with a return code of 16.
Note: To avoid special linkage editor requirements (see Summary of Rules for
User Exit Routines on page 321), you can include these functions in your
E15 user exits rather than in a separate E17 user exit routine.
Note: If you are using a disk sorting technique, the EROPT option is ignored.
Your routines are entered at the beginning of each phase so that DFSORT can
obtain the parameter lists. The routines are entered again during processing of the
phase at the points indicated in the parameter lists. For example, if you choose the
EXLST option, DFSORT enters your E18 user exit routine early in the sort (input)
phase. DFSORT picks up the parameter list including the EXLST address. Later in
the phase, DFSORT enters your routine again at the EXLST address when the data
set is opened.
SYNAD
Contains the location of yourread synchronous error routine. This routine is
entered only after the operating system has tried unsuccessfully to correct the
error. The routine must be assembled as part of your E18 user exit routine.
When the routine receives control, it must not store registers in the save area
pointed to by register 13.
EXLST
Contains the location of a list of pointers to routines that you want used to
check labels and accomplish other tasks not handled by data management. The
list, and the routines to which it points, must be included in your read error
routine. This parameter can only be used for EXLST routines associated with
opening the first SORTIN data set.
EROPT
Indicates what action DFSORT must take when it encounters an uncorrectable
read error. The three possible actions and the codes associated with them are:
X'80' Accept the record (block) as is
X'40' Skip the record (block)
X'20' Terminate the program.
If you include this parameter in the DCB field list, you must place one of the
above codes in byte 4 of the word. Bytes 2 and 3 of the word must contain
zeros.
When you use the EROPT option, the SYNAD field and the EODAD field must
contain the appropriate address in bytes 2 through 4. Or, if no routine is
available, bytes 2 and 3 must contain zeros, and byte 4 must contain X'01'. You
can use the assembler instruction DC AL3(1) to set up bytes 2 through 4.
EODAD
Contains the address of your end-of-file routine. If you specify EODAD, you
must include the end-of-file routine in your own routine.
E18 User Exit Restrictions: If passwords are to be entered through a user exit
and Blockset is not selected, the data set cannot be opened during the initialization
phase. This means that MAINSIZE|SIZE=MAX must not be used because the
program cannot make the necessary calculations.
Information Your Routine Passes to DFSORT at E18 User Exit: When you
return to DFSORT, you must place the address of a parameter list in general
register 1:
If QSAM parameters are passed instead, they are accepted but ignored.
Either address entry can be omitted; if they both are included, they can be in any
order.
E18 Password List: A password list included in your routine must have the
following format:
8 bytes: ddname
8 bytes: Password
The last byte of the ddname field is destroyed by DFSORT. This list must not be
altered at any time during the program. MAINSIZE|SIZE=MAX must not be used if
this function is used.
E18 User Exit List: The VSAM user exit list must be built using the VSAM EXLST
macro instruction giving the addresses of your routines handling VSAM user exit
functions. VSAM branches directly to your routines which must return to VSAM via
register 14.
Any VSAM user exit function available for input data sets can be used except
EODAD. If you need to do EODAD processing, write a LERAD user exit and check
for X'04' in the FDBK field of the RPL. This will indicate input EOD. This field must
not be altered when returning to VSAM because it is also needed by DFSORT.
For details, see z/OS DFSMS Macro Instructions for Data Sets.
Figure 17 shows an example of code your program can use to return control to
DFSORT.
ENTRY E18
.
.
E18 LA 1,PARMLST
RETURN
CNOP 0,4
PARMLST DC X01
DC AL3(SER)
DC X02
DC AL3(LST)
DC X03
DC X000080 EROPT CODE
DC A(0)
DC X04
DC AL3(QSAMEOD)
DC X05
DC AL3(VSAMEXL)
DC X06
DC AL3(PWDLST)
DC A(0)
.
.
VSAMEXL EXLST SYNAD=USYNAD,LERAD=ULERAD
PWDLST DC H1
DC CL8SORTIN SORTIN DDNAME
DC CL8INPASS SORTIN PASSWORD
USYNAD ... VSAM SYNCH ERROR RTN
ULERAD ... VSAM LOGIC ERROR RTN
SER ... QSAM ERROR RTN
LST DC X85,AL3(RTN) EXLST ADDRESS LIST1
RTN ... EXLST ROUTINE
QSAMEOD ... QSAM END OF FILE ROUTINE
each word must contain a character code that identifies the parameter. Either word
can be omitted. A word of all zeros indicates the end of the list.
SYNAD
This field contains the location of your write synchronous errorroutine. This
routine is entered only after the operating system has unsuccessfully tried to
correct the error. It must be assembled as part of your own routine.
EXLST
The EXLST field contains the location of a list of pointers. These pointers point
to routines that are used to process labels and accomplish other tasks not
handled by data management. This list, and the routines to which it points, must
be included as part of your own routine.
A full description of these DCB fields can be found in z/OS DFSMS Macro
Instructions for Data Sets.
If you want to modify the collating sequence of EBCDIC data, for example, to permit
the alphabetic collating of national characters, you can do so without the need for
16. With a conventional merge or a tape work data set sort, control fields for which E is specified are treated as binary byte format
regardless of the actual format(s) specified.
an E61 user exit routine by using the ALTSEQ control statement (as described in
ALTSEQ Control Statement on page 88).
The control field length allows you to write a more generalized modification routine.
To alter the control field, change the control field image at the indicated address
(changing the address itself will have no effect).
The control field number is relative to all fields in the SORT or MERGE statement.
For example, if you specify:
SORT FIELDS=(4,2,CH,A,8,10,CH,E,25,2,BI,E)
For all fields except binary, the total number of bytes DFSORT passes to your
routine is equal to the length specified in the m parameter of the SORT or MERGE
statement.
All binary fields passed to your routine contain a whole number of bytes; all bytes
that contain any bits of the control field are passed. If the control field is longer than
256 bytes, DFSORT splits it into fields of 256 bytes each and passes them one at a
time to your routine.
Your routine cannot physically change the length of the control field. If you must
increase the length for collating purposes, you must previously specify that length in
the m parameter of the SORT or MERGE statement. If you must shorten the control
field, you must pad it to the specified length before returning it to DFSORT. Your
routine must return the field to DFSORT with the same number of bytes that it
contained when your routine was entered.
When user exit E61 is used, records are always ordered into ascending sequence.
If you need some other sequence, you can modify the fields further; for example, if
after carrying out your planned modification for a binary control field, and before
handing back control to DFSORT, you reverse all bits, the field is, in effect, collated
in descending order as illustrated by the E61 example in Figure 23 on page 343.
Note that if E61 is used to resolve ISCII/ASCII collating for special alphabetic
characters, substituted characters must be in EBCDIC, but the sequencing depends
upon the byte value of the ISCII/ASCII translation for the substituted character.
Note: To avoid special linkage editor requirements (see Summary of Rules for
User Exit Routines on page 321), you can include these functions in your
E35 user exit rather than in a separate E31 routine.
You must indicate the number of input files you want to merge using either (1) the
FILES=n option on the MERGE control statement, or (2) the X'04' entry in the 24-bit
parameter list. Your E32 user exit routine must insert records for these files as
DFSORT requests them.
If input is variable-length records, you must be sure the beginning of each record
contains a 4-byte RDW before merged. The format of an RDW is described in z/OS
DFSMS Macro Instructions for Data Sets (Alternatively, you can declare the records
as fixed-length and pad them to the maximum length.)
example, you can obtain a dynamic storage area, use it in your E32 user exit,
and pass its address to your E35 user exit.
Note: The user exit address constant must not be used for a Conventional merge
application.
In general register 1, DFSORT places the address of a parameter list that contains
the file increment, the record address and the user address constant. The list is
three fullwords long and begins on a fullword boundary. The format of the
parameter list is:
Table 50. E32 User Exit Parameter List
Bytes 1 through 4 Increment of next file to be used for input
Bytes 5 through 8 Address of next input record
Bytes 9 through 12 User exit address constant
The EXITCK option affects the way DFSORT interprets certain return codes from
user exit E35. To avoid ambiguity, this section assumes that the IBM default,
EXITCK=STRONG, was selected at your site. For complete details of the meaning
of E35 return codes in various situations with EXITCK=STRONG and
EXITCK=WEAK, see E15/E35 Return Codes and EXITCK on page 360.
DFSORT enters the E35 user exit routine each time it prepares to place a record in
the output area.
After end of input is reached, DFSORT continues to enter your user exit routine
until a return code of 8 is passed back.
Your E35 user exit must not change the address of the record leaving DFSORT.
v The address of a record in the output area is zero the first time your routine is
entered because there is no record in the output area at that time. It remains
zero provided you pass a return code of 4 (delete record) to DFSORT.
Note: If the record pointed to is variable-length, it has an RDW at this point even
if output is to a VSAM data set.
v The user exit address constant is passed to your user exit exactly as it was set
by your E15 or E32 user exit or invoking programs parameter list.
Note: The user exit address constant must not be used for a Conventional merge
or tape work data set sort application.
In general register 1, DFSORT places the address of a parameter list that contains
the two record addresses and the user address constant. The list is three fullwords
long and begins on a fullword boundary. The format of the parameter list is:
Table 51. E35 User Exit Parameter List
Bytes 1 through 4 Address of record leaving DFSORT
Bytes 5 through 8 Address of record in output area
Bytes 9 through 12 User exit address constant
must pass a return code of 8 when DFSORT indicates the end of the data set.
This is done by passing a zero as the address of the record leaving DFSORT.
If you do not have an output data set and would usually return with a return
code of 8 before EOF, you can avoid getting the ICE025A message by
specifying NOCHECK on the OPTION control statement (if CHECK=NO had not
already been specified at installation time).
If your user exit routine passes a return code of 8 to DFSORT when input
records still remain to be processed, the remaining records are processed by
DFSORT, but are not passed to your user exit.
12: Insert Record
To add an output record ahead of the record leaving DFSORT, place the
address of the new record in general register 1 and return to DFSORT with a
return code of 12. DFSORT returns to your routine with the same address as
passed on the previous call to the user exit for the record leaving DFSORT.
DFSORT places the address of the inserted record into the output area. You
can make more insertions at that point, or delete the record leaving DFSORT.
DFSORT does not perform sequence checking for disk work data set sorts. For
tape work data set sorts, DFSORT does not perform sequence checking on
records that you insert unless you delete the record leaving DFSORT and insert
a record to replace it. DFSORT keeps returning to your routine until you pass a
return code of 8.
16: Terminate DFSORT
If you want to terminate DFSORT, return with a code of 16. DFSORT then
returns to its calling program or to the system with a return code of 16.
See E15/E35 Return Codes and EXITCK on page 360 for complete details of the
meanings of return codes in various situations.
Summing Records at E35 User Exit: You can use the SUM control statement to
sum records. However, you can sum records for output by changing the record in
the output area and then, if you want, by deleting the record leaving DFSORT.
DFSORT returns to your routine with the address of a new record leaving DFSORT,
and the same record remains in the output area, so that you can continue
summing. If you do not delete the record leaving DFSORT, that record is added to
the output area, and its address replaces the address of the previous record in the
output area. DFSORT returns with the address of a new record leaving DFSORT.
If you need to obtain storage for use by your E35 user exit routine, such as to pass
altered records to DFSORT, you can use the following strategy:
1. The first time your exit is called, obtain the storage you need
2. Use the storage you obtained each time your exit is called
3. Free the storage before you pass back return code 8 to DFSORT.
Note: When you obtain your storage you can save its address in the user exit
address constant and restore it on each subsequent call to your exit.
Note: To avoid special linkage editor requirements (see Summary of Rules for
User Exit Routines on page 321), you can include these functions in your
E35 user exit rather than in a separate E37 user exit.
ENTRY E38
.
.
E38 LA 1,PARMLST
RETURN
CNOP 0,4
PARMLST DS 0H
DC X05
DC AL3(VSAMEXL)
DC X06
DC AL3(PWDLST)
DC A(0)
.
.
VSAMEXL EXLST SYNAD=USYNAD,LERAD=ULERAD
PWDLST DC H2
DC CL8SORTIN01 SORTIN01 DDNAME
DC CL8INPASS1 SORTIN01 PASSWORD
DC CL8SORTIN02 SORTIN02 DDNAME
DC CL8INPASS2 SORTIN02 PASSWORD
USYNAD ... VSAM SYNCH ERROR RTN
ULERAD ... VSAM LOGIC ERROR RTN
ENTRY E39
.
.
E39 LA 1,PARMLST
RETURN
CNOP 0,4
PARMLST DS 0H
DC X05
DC AL3(VSAMEXL)
DC X06
DC AL3(PWDLST)
DC A(0)
.
.
VSAMEXL EXLST SYNAD=USYNAD,LERAD=ULERAD
PWDLST DC H1
DC CL8SORTOUT SORTOUT DDNAME
DC CL8OUTPASS SORTOUT PASSWORD
USYNAD ... VSAM SYNCH ERROR RTN
ULERAD ... VSAM LOGIC ERROR RTN
E15 CSECT
* IF A RECORD IS GREATER THAN 204 BYTES, TRUNCATE IT TO 204 BYTES.
* IF A RECORD IS LESS THAN 204 BYTES, PAD IT OUT TO 204 BYTES.
* ALL OF THE RESULTING RECORDS WILL BE 204 BYTES LONG
* (4 BYTES FOR THE RDW AND 200 BYTES OF DATA).
USING E15,12 SHOW BASE REG
STM 14,12,12(13) SAVE ALL REGS EXCEPT 13
LA 12,0(0,15) SET BASE REG
ST 13,SAVE15+4 SAVE BACKWARD POINTER
LA 14,SAVE15 SET FORWARD POINTER
ST 14,8(13) IN SAVE AREA
LR 13,14 SET OUR SAVE AREA
LR 2,1 SAVE PARM LIST POINTER
L 3,0(,2) LOAD ADDR OF RECORD
LTR 3,3 EOF
BZ EOF YES - DO NOT RETURN
LH 4,0(,3) GET RDW
CH 4,CON204 IS RDW EQ 204
BE ACCEPT YES-ACCEPT IT
BL PAD LESS THAN 204-PAD
LH 4,CON204 LIMIT LENGTH TO 204
B TRUNC MORE THAN 204-TRUNCATE
PAD DS 0H PAD OR TRUNCATE
MVI DATA,X00 ZERO OUT THE BUFFER
MVC DATA+1(199),DATA
TRUNC DS 0H PAD OR TRUNCATE
BCTR 4,0 DECREASE RDW FOR EXECUTE
EX 4,MVPAD MOVE RECORD INTO PAD/TRUNCATE BUFFER
MVC NEWRDW(2),CON204 SET NEW RDW TO 204
LA 3,BUFFER POINT TO PADDED/TRUNCATED RECORD
ACCEPT DS 0H
SR 15,15 SET RC=0
LR 1,3 SET RECORD POINTER
B GOBACK
EOF LA 15,8 EOF - SET RC=8
GOBACK L 13,4(,13)
L 14,12(,13)
LM 2,12,28(13) RESTORE REGS
BR 14 RETURN
MVPAD MVC BUFFER(*-*),0(3) FOR EXECUTE
SAVE15 DS 18F
CON204 DC H204
BUFFER DS 0H
NEWRDW DS H NEW RDW OF 204
DC H0
DATA DC XL20000 BUFFER FOR PADDING/TRUNCATING
END
E16 CSECT
LA 15,0 SET RETURN CODE
BR 14
END
E35 CSECT
* IF A RECORD IS GREATER THAN 204 BYTES, TRUNCATE IT TO 204 BYTES.
* IF A RECORD IS LESS THAN 204 BYTES, PAD IT OUT TO 204 BYTES.
* ALL OF THE RESULTING RECORDS WILL BE 204 BYTES LONG
* (4 BYTES FOR THE RDW AND 200 BYTES OF DATA).
USING E35,12 SHOW BASE REG
STM 14,12,12(13) SAVE ALL REGS EXCEPT 13
LA 12,0(0,15) SET BASE REG
ST 13,SAVE15+4 SAVE BACKWARD POINTER
LA 14,SAVE15 SET FORWARD POINTER
ST 14,8(13) IN SAVE AREA
LR 13,14 SET OUR SAVE AREA
LR 2,1 SAVE PARM LIST POINTER
L 3,0(,2) LOAD ADDR OF RECORD
LTR 3,3 EOF
BZ EOF YES - DO NOT RETURN
LH 4,0(,3) GET RDW
CH 4,CON204 IS RDW EQ 204
BE ACCEPT YES-ACCEPT IT
BL PAD LESS THAN 204-PAD
LH 4,CON204 LIMIT LENGTH TO 204
B TRUNC MORE THAN 204-TRUNCATE
PAD DS 0H PAD OR TRUNCATE
MVI DATA,X00 ZERO OUT THE BUFFER
MVC DATA+1(199),DATA
TRUNC DS 0H PAD OR TRUNCATE
BCTR 4,0 DECREASE RDW FOR EXECUTE
EX 4,MVPAD MOVE RECORD INTO PAD/TRUNCATE BUFFER
MVC NEWRDW(2),CON204 SET NEW RDW TO 204
LA 3,BUFFER POINT TO PADDED/TRUNCATED RECORD
ACCEPT DS 0H
SR 15,15 SET RC=0
LR 1,3 SET RECORD POINTER
B GOBACK
EOF LA 15,8 EOF - SET RC=8
GOBACK L 13,4(,13)
L 14,12(,13)
LM 2,12,28(13) RESTORE REGS
BR 14 RETURN
MVPAD MVC BUFFER(*-*),0(3) FOR EXECUTE
SAVE15 DS 18F
CON204 DC H204
BUFFER DS 0H
NEWRDW DS H NEW RDW OF 204
DC H0
DATA DC XL20000 BUFFER FOR PADDING/TRUNCATING
END
| If separately compiled E15 and E35 user exits are found together, DFSORT copy
| processing terminates. Message ICE161A is issued.
| Besides the minimum DFSORT main storage requirements, you need an additional
| 1200KB of storage in your REGION to run Language Environment.
Under certain conditions, DFSORT can use all the storage in your REGION below
16MB virtual, thus leaving no room to load the COBOL library subroutines required
during processing of your user exit.
| During processing, the actual amount of storage required for the COBOL library
| subroutines depends on the functions performed in the COBOL user exit. You must
| add a minimum of 20KB to the size of the user exit. If the user exit does I/O,
| additional storage must be reserved for the I/O buffers. Additional storage for
| buffers is specified by the m parameter on the MODS statement.
Note: You might need to release an additional 70KB of storage when you are:
v Calling both E15 and E35 user exits
| v Running with nonresident library subroutines
v Performing a sort with DFSORT residing above 16MB virtual.
DFSORT enters the E15 user exit routine each time a new record is brought into
the input phase. DFSORT continues to enter E15 (even when there are no input
records) until the user exit tells DFSORT, with a return code of 8, not to return.
v New record
v Length of the new record (for variable-length records)
v Length of user exit area
v User exit area.
When E15 returns to DFSORT, the E15 user exit provides to DFSORT some or all
of the fields mentioned below. The first field is required; the others can be modified
as appropriate.
v RETURN-CODE (assigned by the user exit by setting the COBOL special register
RETURN-CODE)
v Return record
v Length of the return record (for VLR)
v Length of user exit area
v User Exit area.
For more information on how these fields are used in a COBOL E15 user exit, see
E15 LINKAGE SECTION Fields for Fixed-Length and Variable-Length Records on
page 348.
Figure 24 on page 347 details the interface to COBOL for the E15 user exit.
| LINKAGE SECTION.
01 RECORD-FLAGS PIC 9(8) BINARY.
88 FIRST-REC VALUE 00.
88 MIDDLE-REC VALUE 04.
88 END-REC VALUE 08.
01 NEW-REC PIC X(100).
01 RETURN-REC PIC X(100).
01 UNUSED1 PIC 9(8) BINARY.
01 UNUSED2 PIC 9(8) BINARY.
01 UNUSED3 PIC 9(8) BINARY.
01 UNUSED4 PIC 9(8) BINARY.
01 UNUSED5 PIC 9(8) BINARY.
01 EXITAREA-LEN PIC 9(4) BINARY.
01 EXITAREA.
05 EAREA OCCURS 1 TO 256 TIMES
DEPENDING ON EXITAREA-LEN PIC X.
Figure 25. LINKAGE SECTION Code Example for E15 (Fixed-Length Records)
| LINKAGE SECTION.
01 RECORD-FLAGS PIC 9(8) BINARY.
88 FIRST-REC VALUE 00.
88 MIDDLE-REC VALUE 04.
88 END-REC VALUE 08.
01 NEW-REC.
05 NREC OCCURS 1 TO 200 TIMES
DEPENDING ON NEW-REC-LEN PIC X.
01 RETURN-REC.
05 RREC OCCURS 1 TO 200 TIMES
DEPENDING ON RETURN-REC-LEN PIC X.
01 UNUSED1 PIC 9(8) BINARY.
01 UNUSED2 PIC 9(8) BINARY.
01 NEW-REC-LEN PIC 9(8) BINARY.
01 RETURN-REC-LEN PIC 9(8) BINARY.
01 UNUSED3 PIC 9(8) BINARY.
01 EXITAREA-LEN PIC 9(4) BINARY.
01 EXITAREA.
05 EAREA OCCURS 1 TO 256 TIMES
DEPENDING ON EXITAREA-LEN PIC X.
Figure 26. LINKAGE SECTION Code Example for E15 (Variable-Length Record)
v DFSORT places the next input record in the new record field (NEW-REC). A VLR
does not contain an RDW, but DFSORT places the length of this VLR in the new
record length field (NEW-REC-LEN). The value in the NEW-REC-LEN field is the
length of the record only and does not include the 4 bytes for the RDW.
v When your routine places an insertion/replacement record in the return record
field (RETURN-REC), the VLR must not contain an RDW; your routine must
place the length of this record in the return record length field
(RETURN-REC-LEN). The value of the RETURN-REC-LEN field is the length of
the record only and must not include the 4 bytes for the RDW.
v Each time DFSORT calls your COBOL E15 or COBOL E35 user exit, it passes
the user exit a 256-byte user exit area field (EXITAREA). The first time the user
exit area field is passed to your COBOL E15 user exit, it contains 256 blanks,
and the user exit area length field (EXITAREA-LEN) contains 256.
Any changes you make to the user exit area field or user exit area length fields
are passed back both to your COBOL E15 user exit and your COBOL E35 user
exit.
Notes:
1. Do not set the user exit area length field to more than 256 bytes.
2. If the data used for input was not created by a COBOL run, you need to
know the LRECL defined for your data set. For a VLR, the maximum length
of the record defined in your COBOL user exit is 4 bytes less than the
LRECL value, because COBOL does not include the RDW as part of the
record. (Each VLR begins with an RDW field of 4 bytes. The RDW is not
included in the record passed to your COBOL user exit.)
3. You need to code only up to the last field that your routine actually uses (for
example, up to RETURN-REC if you do not use the user exit area).
4. DFSORT uses the specified or defaulted value for L2 in the RECORD
statement to determine the length of the records your E15 user exit passes
back to DFSORT. For fixed-length records, be sure that each record your E15
user exit changes or inserts has a length that is equal to the specified or
defaulted L2 value. For variable-length records, be sure that each record your
E15 user exit changes or inserts has a length that is less than or equal to the
specified or defaulted L2 value. Unwanted truncation or abends may occur if
DFSORT uses the wrong length for the records passed to it by your E15 user
exit.
For details of the L2 value, see RECORD Control Statement on page 293.
4: Delete Record
If you want DFSORT to delete the record, return with RETURN-CODE set to 4.
8: Do Not Return
DFSORT continues to enter your routine until you return with RETURN-CODE
set to 8. After that, the user exit is not used again during the DFSORT
application. Unless you are inserting records after the end of the data set, you
must set RETURN-CODE to 8 when DFSORT indicates the end of the data set,
which it does by entering your routine with the record flags field set to 8.
If your user exit routine passes a return code of 8 to DFSORT when input
records still remain to be processed, the remaining records are processed by
DFSORT but are not passed to your user exit.
12: Insert Record
If you want DFSORT to add a record before the new record in the input data
set:
v Move the insert record to the return record field
v For VLR, move the length to the return record length field (Do not include the
4-byte RDW in this length.)
v Return with RETURN-CODE set to 12.
DFSORT returns to your routine with the same record as before in the new
record field, allowing your routine to insert more records or handle the new
record.
You can also insert records after the end of the data set. DFSORT keeps
returning to your routine as long as you pass it a RETURN-CODE of 12 and
until you return with a RETURN-CODE set to 8.
16: Terminate DFSORT
If you want to terminate DFSORT, return with RETURN-CODE set to 16.
DFSORT then returns to its calling program or to the system with a return code
of 16.
20: Alter Record
If you want to change the new record:
v Move the new record to the return record field.
v Change the record in the return record field.
v For VLR records, move the length to the return record length field.
v Return with RETURN-CODE set to 20.
Note: If your routine changes record size, you must indicate the new size on
the RECORD statement.
20: Replace Record
If you want to replace the new record:
v Move the replacement record to the return record field.
v For VLR records, move the length to the return record length field. (Do not
include the 4-byte RDW in this length.)
v Return with RETURN-CODE set to 20.
See E15/E35 Return Codes and EXITCK on page 360 for complete details of the
meanings of return codes in various situations.
For the VLR example, Figure 26 on page 348, you would code:
PROCEDURE DIVISION USING RECORD-FLAGS, NEW-REC,
RETURN-REC, UNUSED1, UNUSED2,
NEW-REC-LEN, RETURN-REC-LEN,
UNUSED3, EXITAREA-LEN, EXITAREA.
DFSORT enters the E35 user exit routine each time it prepares to place a record in
the output area.
When DFSORT indicates the end of the data set (record flags field set to 8), you
must set RETURN-CODE to 8 (unless you are inserting records after the end of the
data set); otherwise, DFSORT continues to enter E35.
Notes:
1. If both E15 and E35 user exits are used, they must be in the same version of
COBOL.
2. If you use the E35 user exit to dispose of all your output records, you can omit
the SORTOUT DD statement.
3. If you omit the SORTOUT DD statement and you do not specify any OUTFIL
data sets, your E35 user exit routine must dispose of each output record and
return to DFSORT with a return code of 4. When DFSORT returns to your
routine after you have disposed of the last record, return to DFSORT with a
return code of 8 to indicate do not return.
4. You cannot use dynamic link-editing with a COBOL E35 user exit.
When your E35 user exit returns to DFSORT, the E35 user exit provides to
DFSORT some or all of the fields mentioned below. The first field is required; the
others can be modified as appropriate.
v RETURN-CODE (assigned by the user exit by setting the COBOL special register
RETURN-CODE)
v Return record
v Length of return record (for variable-length records)
v Length of user exit area
v User exit area.
For more information on how these fields are used in a COBOL E35 user exit, see
E35 LINKAGE SECTION Fields for Fixed-Length and Variable-Length Records on
page 354.
Figure 27 on page 353 details the interface to COBOL for the E35 user exit.
| LINKAGE SECTION.
01 RECORD-FLAGS PIC 9(8) BINARY.
88 FIRST-REC VALUE 00.
88 MIDDLE-REC VALUE 04.
88 END-REC VALUE 08.
01 LEAVING-REC PIC X(100).
01 RETURN-REC PIC X(100).
01 OUTPUT-REC PIC X(100).
01 UNUSED1 PIC 9(8) BINARY.
01 UNUSED2 PIC 9(8) BINARY.
01 UNUSED3 PIC 9(8) BINARY.
01 UNUSED4 PIC 9(8) BINARY.
01 EXITAREA-LEN PIC 9(4) BINARY.
01 EXITAREA.
05 EAREA OCCURS 1 TO 256 TIMES
DEPENDING ON EXITAREA-LEN PIC X.
Figure 28. LINKAGE SECTION Code Example for E35 (Fixed-Length Records)
| LINKAGE SECTION.
01 RECORD-FLAGS PIC 9(8) BINARY.
88 FIRST-REC VALUE 00.
88 MIDDLE-REC VALUE 04.
88 END-REC VALUE 08.
01 LEAVING-REC.
05 LREC OCCURS 1 TO 200 TIMES
DEPENDING ON LEAVING-REC-LEN PIC X.
01 RETURN-REC.
05 RREC OCCURS 1 TO 200 TIMES
DEPENDING ON RETURN-REC-LEN PIC X.
01 OUTPUT-REC.
05 OREC OCCURS 1 TO 200 TIMES
DEPENDING ON OUTPUT-REC-LEN PIC X.
01 UNUSED1 PIC 9(8) BINARY.
01 LEAVING-REC-LEN PIC 9(8) BINARY.
01 RETURN-REC-LEN PIC 9(8) BINARY.
01 OUTPUT-REC-LEN PIC 9(8) BINARY.
01 EXITAREA-LEN PIC 9(4) BINARY.
01 EXITAREA.
05 EAREA OCCURS 1 TO 256 TIMES
DEPENDING ON EXITAREA-LEN PIC X.
Figure 29. LINKAGE SECTION Code Example for E35 (Variable-Length Records)
v DFSORT places the next output record, which usually follows the record in the
output area, in the record leaving field (LEAVING-REC). A VLR does not contain
an RDW; DFSORT places the length of this VLR in the record-leaving length field
(LEAVING-REC-LEN). The value in the LEAVING-REC-LEN field is the length of
the record only and does not include the 4 bytes for the RDW.
v When your routine places an insertion or replacement record in the return record
field (RETURN-REC), the VLR must not contain an RDW; your routine must
place the length of this record in the return record length field
(RETURN-REC-LEN). The value in the RETURN-REC-LEN field is the length of
the record only and does not include the 4 bytes for the RDW.
v DFSORT places the record already in the output area in the record in output area
field (OUTPUT-REC). A VLR does not contain an RDW. DFSORT places the
length, not including the 4 bytes for RDW, of this VLR in the record in output
area length field (OUTPUT-REC-LEN).
v DFSORT passes your COBOL E35 routine a 256-byte user exit area field
(EXITAREA) that can contain information passed by your COBOL E15 routine. If
no information is passed in the EXITAREA field by your COBOL E15 routine the
first time the field is passed to your COBOL E35 routine, EXITAREA contains 256
blanks, and the user exit area length field (EXITAREA-LEN) contains 256.
Any changes you make to the user exit area field or user exit area length field
are passed back to your COBOL E35 routine each time it is called by DFSORT.
Notes:
1. Do not set the user exit area length field to more than 256 bytes.
2. VLR records have a 4-byte RDW field at the beginning of each record. The
maximum record length plus the RDW will be the length defined for the
LRECL attribute of your output data set. COBOL programs do not use the
RDW and, therefore, the maximum length defined in your COBOL user exit is
4 bytes less than the LRECL value.
3. You need to code only up to the last field your routine actually uses (for
example, up to OUTPUT-REC-LEN if you do not use the user exit area).
4. DFSORT uses the specified or defaulted value for L3 in the RECORD
statement to determine the length of the records your E35 user exit passes
back to DFSORT. For fixed-length records, be sure that each record your E35
user exit changes or inserts has a length that is equal to the specified or
defaulted L3 value. For variable-length records, be sure that each record your
E35 user exit changes or inserts has a length that is less than or equal to the
specified or defaulted L3 value. Unwanted truncation or abends may occur if
DFSORT uses the wrong length for the records passed to it by your E35 user
exit.
For details of the L3 value, see RECORD Control Statement on page 293.
0: No Action
If you want DFSORT to retain the record leaving DFSORT unchanged, return
with RETURN-CODE set to 0.
4: Delete Record
If you want DFSORT to delete the record leaving DFSORT, return with
RETURN-CODE set to 4.
8: Do Not Return
DFSORT keeps returning to your routine until you pass a RETURN-CODE set
to 8. After that, the user exit is not used again during the DFSORT application.
Unless you are inserting records after the end of the data set, you must set
RETURN-CODE to 8 when DFSORT indicates the end of the data set. This is
done by entering your routine with the record flags field set to 8.
If your user exit routine passes a return code of 8 to DFSORT when input
records still remain to be processed, the remaining records are processed by
DFSORT but are not passed to your user exit.
If you do not have an output data set and would usually return with a return
code of 8 before EOF, you can avoid getting the ICE025A message by
specifying NOCHECK on the OPTION control statement (if CHECK=NO had not
already been specified at installation time).
12: Insert Record
If you want DFSORT to add an output record before the record leaving
DFSORT:
v Move the insert record to the return record field
v For VLR records, move the length to the return record length field
v Return with RETURN-CODE set to 12.
DFSORT returns to your routine with the inserted record in the record output
area field and with the same record as before in the record leaving DFSORT
field. In this way, your routine can insert more records or handle the record
leaving DFSORT.
You can also insert records after the end of the data set. DFSORT keeps
returning to your routine as long as you pass it a RETURN-CODE 12 and until
you return with RETURN-CODE set to 8.
DFSORT does not perform sequence checking for disk work data set sorts. For
tape work data set sorts, DFSORT does not perform sequence checking on
inserted records unless you delete the record leaving DFSORT and then
replace it.
16: Terminate DFSORT
If you want to terminate DFSORT, return with RETURN-CODE set to 16.
DFSORT then returns to its calling program or to the system with a return code
of 16.
20: Alter Record
If you want to change the record leaving DFSORT:
v Move the record leaving DFSORT to the return record field
v Change the record in the return record field
v For VLR records, move the length to the return record length field
v Return with RETURN-CODE set to 20.
Note: If your routine changes record size, you must indicate the new size on
the RECORD statement.
See E15/E35 Return Codes and EXITCK on page 360 for complete details of the
meanings of return codes in various situations.
For the VLR example, Figure 29 on page 354, you would code:
PROCEDURE DIVISION USING RECORD-FLAGS, LEAVING-REC,
RETURN-REC, OUTPUT-REC, UNUSED1,
LEAVING-REC-LEN, RETURN-REC-LEN,
OUTPUT-REC-LEN, EXITAREA-LEN, EXITAREA.
| IDENTIFICATION DIVISION.
PROGRAM-ID.
CE15.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
01 RECORD-FLAGS PIC 9(8) BINARY.
88 FIRST-REC VALUE 00.
88 MIDDLE-REC VALUE 04.
88 END-REC VALUE 08.
01 NEW-REC.
05 NFILL1 PIC X(10).
05 NEW-DEPT PIC X(3).
05 NFILL2 PIC X(87).
01 RETURN-REC.
05 RFILL1 PIC X(10).
05 RETURN-DEPT PIC X(3).
05 RFILL2 PIC X(87).
IF END-REC
MOVE 8 TO RETURN-CODE
ELSE
IF NEW-DEPT EQUAL TO "D29"
MOVE NEW-REC TO RETURN-REC
MOVE "J99" TO RETURN-DEPT
MOVE 20 TO RETURN-CODE
ELSE
MOVE 0 TO RETURN-CODE
ENDIF
ENDIF
GOBACK.
| IDENTIFICATION DIVISION.
PROGRAM-ID.
CE35.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INSERT-DONE PIC 9(1) VALUE 0.
01 K22-REC.
05 K22-MANAGER PIC X(20) VALUE "J. DOE".
05 K22-DEPT PIC X(3) VALUE "K22".
05 K22-FUNC PIC X(20) VALUE "ACCOUNTING".
05 K22-LATER PIC X(30) VALUE SPACES.
01 LEAVING-VAR-LEN PIC 9(8) BINARY.
LINKAGE SECTION.
01 RECORD-FLAGS PIC 9(8) BINARY.
88 FIRST-REC VALUE 00.
88 MIDDLE-REC VALUE 04.
88 END-REC VALUE 08.
01 LEAVING-REC.
05 LREC-MANAGER PIC X(20).
05 LREC-DEPT PIC X(3).
05 LREC-FUNC PIC X(20).
05 LREC-LATER OCCURS 1 TO 157 TIMES
DEPENDING ON LEAVING-VAR-LEN PIC X.
01 RETURN-REC.
05 RREC OCCURS 1 TO 200 TIMES
DEPENDING ON RETURN-REC-LEN PIC X.
01 OUTPUT-REC.
05 OREC OCCURS 1 TO 200 TIMES
DEPENDING ON OUTPUT-REC-LEN PIC X.
01 UNUSED1 PIC 9(8) BINARY.
01 LEAVING-REC-LEN PIC 9(8) BINARY.
01 RETURN-REC-LEN PIC 9(8) BINARY.
01 OUTPUT-REC-LEN PIC 9(8) BINARY.
IF END-REC
MOVE 8 TO RETURN-CODE
ELSE
IF INSERT-DONE EQUAL TO 1
MOVE 0 TO RETURN-CODE
ELSE
SUBTRACT 43 FROM LEAVING-REC-LEN
GIVING LEAVING-VAR-LEN.
IF LREC-DEPT GREATER THAN K22-DEPT
MOVE 1 TO INSERT-DONE
MOVE 43 TO RETURN-REC-LEN
MOVE K22-REC TO RETURN-REC
MOVE 12 TO RETURN-CODE
ELSE
MOVE 0 TO RETURN-CODE
ENDIF
ENDIF
GOBACK.
Table 53. E15 With a SORTIN Data Set Before End of Input
Meaning with EXITCK=STRONG or
E15 Return Code EXITCK=WEAK
0 No action/record altered
4 Delete record
8 Do not return
12 Insert record
16 Terminate DFSORT
20 (COBOL only) Alter/replace record
All others Invalid
Table 54. E15 With a SORTIN Data Set After End of Input
Meaning with Meaning with
E15 Return Code EXITCK=STRONG EXITCK=WEAK
0 Invalid Do not return
4 Invalid Do not return
8 Do not return Do not return
12 Insert record Insert record
16 Terminate DFSORT Terminate DFSORT
20 (COBOL only) Invalid Do not return
All others Invalid Invalid
Table 55. E35 With a SORTOUT or OUTFIL Data Set Before End of Input
Meaning with EXITCK=STRONG or
E35 Return Code EXITCK=WEAK
0 No action/record altered
4 Delete record
8 Do not return
12 Insert record
16 Terminate DFSORT
20 (COBOL only) Alter/replace record
All others Invalid
Table 56. E35 Without a SORTOUT or OUTFIL Data Set Before End of Input
Meaning with Meaning with
E35 Return Code EXITCK=STRONG EXITCK=WEAK
0 Invalid Delete record
4 Delete record Delete record
8 Do not return Do not return
12 Invalid Delete record
16 Terminate DFSORT Terminate DFSORT
20 (COBOL only) Invalid Delete record
All others Invalid Invalid
Table 57. E35 With a SORTOUT or OUTFIL Data Set After End of Input
Meaning with Meaning with
E35 Return Code EXITCK=STRONG EXITCK=WEAK
0 Invalid Do not return
4 Invalid Do not return
8 Do not return Do not return
12 Insert record Insert record
16 Terminate DFSORT Terminate DFSORT
20 (COBOL only) Invalid Do not return
All others Invalid Invalid
Table 58. E35 without a SORTOUT or OUTFIL Data Set After End of Input
Meaning with Meaning with
E35 Return Code EXITCK=STRONG EXITCK=WEAK
0 Invalid Do not return
4 Invalid Do not return
8 Do not return Do not return
12 Invalid Do not return
16 Terminate DFSORT Terminate DFSORT
20 (COBOL only) Invalid Do not return
All others Invalid Invalid
This section explains what you need to know to initiate DFSORT from within your
assembler program using a system macro instruction instead of an EXEC job
control statement in the input stream. Specific restrictions on invoking DFSORT
from PL/I and COBOL are listed in Restrictions for Dynamic Invocation on page
379.
You can specify one of three system macro instructions to pass control to the
program: LINK, ATTACH, or XCTL.
When you issue one of these instructions, the first load module of DFSORT is
brought into main storage. The linkage relationship between your program and
DFSORT differs according to which of the instructions you have used. For a
complete description of the macro instructions and how to use them, refer to z/OS
DCE Application Development Guide: Core Components and z/OS DCE Application
Development Reference
Note: DFSORT can also be called using the systems EXEC PARM parameter
list, provided that the rules for passing it are followed (for example, the
parameter list must reside below 16MB virtual). DFSORT interprets a call
using the EXEC PARM parameter list as a direct invocation rather than a
program invocation.
v Prepare the macro instruction specifying one of the following as the entry point
name: ICEMAN, SORT, IERRCO00, or IGHRCO00.
Note: The save area passed to DFSORT must begin on a fullword boundary.
For example, you could use the following to override the SORT statement
generated by a COBOL SORT verb in order to use DFSORTs Year 2000 features:
//DFSPARM DD *
OPTION Y2PAST=1956 * set fixed CW of 1956-2055
SORT FIELDS=(11,6,Y2T,A, * sort Cyymmdd using CW
31,10,CH,A) * sort other key
/*
You can also use DFSPARM to provide different DFSORT control statements for
multiple invocations of DFSORT from a program. However, the control statements
must be located in temporary or permanent data sets and FREE=CLOSE must be
used. Heres an example of using DFSPARM to override the control statements for
a COBOL program with three SORT verbs:
//DFSPARM DD DSN=DP1,DISP=SHR,FREE=CLOSE
//DFSPARM DD DSN=DP2,DISP=SHR,FREE=CLOSE
//DFSPARM DD DSN=DP3,DISP=SHR,FREE=CLOSE
DP1, DP2, and DP3 can contain any DFSORT control statements you like. The
statements in DP1 will be used for the first call to DFSORT, the statements in DP2
for the second and the statements in DP3 for the third.
| COBOL also offers additional methods for overriding DFSORT parameters and
| control statements such as SORT special registers and the IGZSRTCD data set.
| See your COBOL publications for details.
This form, with a trailing blank separately defined, allows you to refer to the last
byte of the statement (SORT statement end address) by the name SORTEND.
Register 1
1. Required entry. Must appear in the relative position shown. The offset
shown is the actual offset of this entry.
2. Optional entry. Can appear anywhere after the required entries. The
displayed offset is for identification purposes onlythe actual offset of this
entry can vary. Optional entries must be consecutive but can appear in any
order.
3. A specific control statement. Shown for illustrative purposes only. SORT or
MERGE, RECORD, ALTSEQ, DEBUG, MODS, SUM, INREC, OUTREC,
INCLUDE or OMIT, and OUTFIL can be passed using any of the following
hex entry codes: X00 (see Note 1), X02, X05 through X0B, X10, X16,
X18 and X20 through X29.
4. Required entry if the MERGE statement is present and input is supplied
through an E32 user exit. This entry is not required if the FILES option of
the MERGE statement is specified.
5. Required entry. Contains the ending address for a control statement and
must immediately follow the entry containing the starting address for that
same control statement.
34-37 Main storage value. The first byte must contain X'00'. The next three bytes
contain either the characters MAX or a hexadecimal value. You can use this
option to temporarily override the SIZE installation option. For full override
and applicability details, see Appendix B, Specification/Override of
DFSORT Options, on page 625. For an explanation of this value, see the
discussion of the MAINSIZE parameter in OPTION Control Statement on
page 142.
38-41 A reserved main storage value. The first byte must contain X'01'. The next
three bytes contain a hexadecimal value that specifies a number of bytes to
be reserved, where the minimum is 4K. For an explanation of this value,
see the explanation of the RESINV parameter in OPTION Control
Statement on page 142.
You can use this option to temporarily override the RESINV installation
option. For full override and applicability details, see Appendix B,
Specification/Override of DFSORT Options, on page 625.
42-45 Message ddname. The first byte must contain X03. The next three bytes
contain the address of an 8-byte DD statement name for the message data
set, padded with blanks on the right if necessary. The name can be any
valid DD statement name, but must be unique.
You can use this option to temporarily override the MSGDDN installation
option. For full override details, see Appendix B, Specification/Override of
DFSORT Options, on page 625. For details on the use of the message
data set, see z/OS DFSORT Messages, Codes and Diagnosis Guide.
46-49 Number of input files to a merge. This entry is needed only if the MERGE
statement is present without the FILES option and input to the merge is
supplied through the E32 user exit. The first byte must contain X'04'. The
next three bytes contain the number of files in hexadecimal. For full
override and applicability details, see Appendix B, Specification/Override of
DFSORT Options, on page 625.
50-53 The starting address of the DEBUG statement image. Must be in the last
three bytes. The first byte must contain X'05'.
54-57 The ending address of the DEBUG statement image. Must be in the last
three bytes. The first byte must contain X'00'.
58-61 The starting address of the ALTSEQ statement image. Must be in the last
three bytes. The first byte must contain X'06'.
62-65 The ending address of the ALTSEQ statement image. Must be in the last
three bytes. The first byte must contain X'00'.
66-69 The address of a 256-byte translate table supplied instead of an ALTSEQ
statement. The first byte must contain X'F6'. If this parameter is present, the
X'06' parameter is ignored. For full override and applicability details, see
Appendix B, Specification/Override of DFSORT Options, on page 625.
70-73 User exit address constant. These 4 bytes are passed to E15 (at offset 4 in
the E15 parameter list), to E32 (at offset 8 in the E32 parameter list) or to
E35 (at offset 8 in the E35 parameter list) after DFSORT replaces the X'F7'
with X'00'.
Note: The user exit address constant must not be used for a Conventional
merge or tape work data set sort application.
74-77 X'FD' in the first byte (the VLSHRT option) specifies that DFSORT is to
continue processing if it finds a variable-length input record too short to
contain all specified control fields, compare fields, or summary fields. For
full details of this option, see the discussion of the VLSHRT parameter in
OPTION Control Statement on page 142. You can use this option to
temporarily override the VLSHRT installation option. For full override and
applicability details, see Appendix B, Specification/Override of DFSORT
Options, on page 625.
78-81 If the first byte contains X'FE', you can use the next three bytes to pass an
address of a 104-byte field save area where ESTAE information is saved.
These bytes must contain zeros if the ESTAE information is not saved.
If a system or user exit abend occurs, the DFSORT ESTAE recovery
routine will copy the first 104 bytes of the SDWA into this area before
returning to any higher level ESTAE recovery routines.
For more information on the DFSORT ESTAE recovery routine, see
Appendix E, DFSORT Abend Processing, on page 673
82-85 The message option. The first byte must contain X'FF'. The following three
bytes contain the characters NOF, (I), or (U). You can use this option to
temporarily override the MSGPRT installation option.
NOF Messages and control statements are not printed. Critical messages are
written to the master console.
(I) All messages except diagnostic messages (ICE800I to ICE999I) are printed.
Critical messages are also written to the master console. Control
statements are printed only if LIST is in effect.
(U) Only critical messages are printed. They are also written to the master
console. Control statements are not printed (NOLIST is forced).
All messages are written to the message data set. For details on use of the
message data set, see z/OS DFSORT Messages, Codes and Diagnosis Guide For
full override and applicability details, see Appendix B, Specification/Override of
DFSORT Options, on page 625.
For compatibility reasons, the forms (NO, (AB, (AP, (AC, (CB, (CC, (CP, (PC, (SC,
and (SP are also accepted.
The following list shows the equivalent specifications for these aliases:
Table 59. Aliases for Message Option
Option MSGPRT MSGCON
(NO 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
86-89 Four characters, which replace SORT in the following ddnames: SORTIN,
The first parameter must be specified. A 4-byte field containing X'FFFFFFFF' must
be used to indicate the end of the parameter list. It can be coded anywhere after
the first parameter.
If a parameter is specified, it must appear in the indicated position and must contain
a 31-bit address or a clean (the first 8 bits containing zeros) 24-bit address. If a
parameter is not specified, it is treated as if it were specified as zeros. For full
override and applicability details, see Appendix B, Specification/Override of
DFSORT Options, on page 625.
Detailed specifications for each of the entries in the parameter list follow:
Byte Explanation
0-3 Required. The address of the area containing the DFSORT control
statements, if any; otherwise, all zeros. The high order bit must be 0 to
identify this as an extended parameter list.
Refer to the previous section for the format of the control statement area.
| Attention: The area must start with a two-byte length field.
If you specify this parameter as zeros, you must supply all the required
control statements in DFSPARM or SORTCNTL.
4-7 Optional. The address of the E15 or E32 user exit routine that your program
has placed in main storage (for example, via LOAD), if any; otherwise, all
zeros.
f (bit 0) has the following meaning:
0 = Enter the user exit with 24-bit addressing in effect (AMODE 24).
1 = Enter the user exit with 31-bit addressing in effect (AMODE 31).
12-15 Optional. This field will be passed to the E15, E32 or E35 user exit routines.
Note: The user exit address constant must not be used for a Conventional
merge or tape work data set sort application.
16-19 Optional. The address of a 256-byte ALTSEQ translation table supplied
instead of an ALTSEQ statement, if any; otherwise, all zeros. You can use
this option to override any ALTSEQ translation table specified at installation.
For full override and applicability details, see Appendix B,
Specification/Override of DFSORT Options, on page 625.
20-23 Optional. The address of a 4-byte field containing the address of a 112-byte
work area where ESTAE information is saved, or all zeros if the ESTAE
information is not saved.
If a system or user exit abend occurs, the DFSORT recovery routine will
copy the first 112 bytes of the software diagnostic work area (SDWA) into
this area before returning to your ESTAE recovery routine.
24-27 Optional. The address of the E18 user exit routine that your program has
placed in main storage (for example, via LOAD), if any; otherwise, all zeros.
Note: This parameter is ignored for a merge application and for a tape
work data set sort application.
Note: The list can be ended after any parameter. The last parameter in the list
must be followed by X'FFFFFFFF'.
Note: If you are using ATTACH, you might also need the ECB parameter.
If you provide an E15 user exit routine address in the parameter list, DFSORT
ignores the SORTIN data set; your E15 routine must pass all input records to
DFSORT. The same applies to a merge if you specify an E32 routine address. This
means that your routine must issue a return code of 12 (insert record) until the input
data set is complete, and then a return code of 8 (do not return).
DFSORT ignores the SORTOUT data set if you provide an E35 routine address in
the parameter list. Unless you use OUTFIL processing, your routine is then
responsible for disposing of all output records. It must issue a return code of 4
(delete record) for each record in the output data set. When the program has
deleted all the records, your routine issues a return code of 8 (do not return).
When DFSORT is done, it passes control to the routine that invoked it.
When a single task attaches two or more program applications, you must modify
the standard ddnames so that they are unique. For ways of doing this, and for the
rules of override, see Appendix B, Specification/Override of DFSORT Options, on
page 625.
If you ATTACH more than one DFSORT application from the same program, you
must wait for each to complete before attaching the next unless DFSORT and your
user exits are installed re-entrant.
When you initiate DFSORT via XCTL, you must give special consideration to the
area where the parameter list, address list, optional parameters, and modification
routines (if any) are stored. This information must not reside in the module that
issues the XCTL because the module is overlaid by DFSORT.
There are two ways to overcome this problem. First, the control information can
reside in a task that attaches the module that issues the XCTL. Second, the module
issuing the XCTL can first issue a GETMAIN macro instruction and place the control
information in the main storage area it obtains. This area is not overlaid when the
XCTL is issued. The address of the control information in the area must be passed
to DFSORT in general register 1.
Figure 34 on page 376 shows the format of the 24-bit parameter list you would use
to specify the main storage option for a sort application.
-2 -2 Unused X '001C'
Figure 34. Specifying the Main Storage Option (24-Bit Parameter List)
Figure 35 shows the format of the 24-bit parameter list that you would use for a
merge application when you want to supply input through an E32 routine and give
control to the ESTAE routine if the program fails.
-2 -2 Unused X '001C'
Figure 35. Specifying E32 and ESTAE Routine (24-Bit Parameter List)
Figure 36 on page 377 shows how a 24-bit parameter list might appear in main
storage. General register 1 contains a pointer to the address of the parameter list
which is at location 1000. The address points to the parameter list which begins at
location 1006. The first 2-byte field of the parameter list contains, right-justified in
hexadecimal, the number of bytes in the list (36 decimal).
1004 00 00 00 24 1036
1008 00 00 10 36 # S O R T # F I E L D S =
( 1 0 , 1 5 , C H , A ) ,
100C 00 00 10 5B
F I L S Z = 4 7 8 0 6 #
1010 00 00 10 5C 105B
1014 00 00 10 75
1018 00 00 20 00 105C
101C 00 00 30 00 # R E C ORD # L E N G T H
= 1 0 0 , T Y PE = F #
1020 A B C #
1075
1024 00 00 65 90 Optional
102C FF ( U )
Parameter List
The first two fullwords in the parameter list point to the beginning (location 1036)
and end (location 105B) of the SORT control statement. The next two fullwords
point to the beginning (location 105C) and end (location 1075) of the RECORD
statement.
The fifth and sixth fullwords in the list contain the entry point addresses for the E15
user exit (location 2000) and E35 user exit (location 3000).
The next fullword in the list contains four characters to replace the letters 'SORT' in
the ddnames of standard DD statements.
The next two fullwords in the list specify a main storage value for this application
and a message option.
The example in Figure 37 on page 378 shows, in assembler language, how to code
the parameters and statement images needed for the 24-bit parameter list in
Figure 36. It also shows how to pass control to DFSORT.
The example in Figure 38 on page 379 shows, in assembler language, how to use
an extended parameter list to code parameters and statement images and how to
pass control to DFSORT.
.
.
.
LA R1,PL1 SET ADDRESS OF PARAMETER LIST
* TO BE PASSED TO SORT/MERGE
ST R2,PL4 SET ADDRESS OF GETMAINED AREA
* TO BE PASSED TO E15
LINK EP=SORT INVOKE SORT/MERGE
.
.
.
PL1 DC A(CTLST) ADDRESS OF CONTROL STATEMENTS
PL2 DC A(E15) ADDRESS OF E15 ROUTINE
PL3 DC A(0) NO E35 ROUTINE
PL4 DS A USER EXIT ADDRESS CONSTANT
PL5 DC F-1 INDICATE END OF LIST
CTLST DS 0H CONTROL STATEMENTS AREA
DC AL2(CTL2-CTL1) LENGTH OF CHARACTER STRING
CTL1 DC C SORT FIELDS=(4,5,CH,A)
DC C OPTION
DC CRESINV=2048,FILSZ=E25000,MSGDDN=MSGOUT
DC C OMIT COND=(5,8,EQ,13,8),FORMAT=FI
DC C RECORD TYPE=F,LENGTH=80
CTL2 EQU *
OUT DCB DDNAME=SYSOUT,... MYSORT USES SYSOUT
E15 DS 0H E15 ROUTINE
.
.
.
BR R14 RETURN TO SORT/MERGE
* MAPPING OF PARAMETER LIST PASSED TO E15 FROM SORT/MERGE
SRTLST DS A ADDRESS OF RECORD
GMA DS A ADDRESS OF AREA GETMAINED BY
* MYSORT
.
.
.
Merge Restriction
Merge applications cannot be done when DFSORT is invoked from a PL/I program.
Copy Restrictions
Copy applications cannot be done when DFSORT is invoked from a PL/I program.
If you invoke DFSORT from a COBOL program, the following restrictions apply:
| v The OPTION COPY statement can be placed in either the COBOL IGZSRTCD
| data set or the DFSORT SORTCNTL or DFSPARM data set.
| v If using the FASTSRT compiler option for any part or all of the COBOL SORT
| statement, a copy application can be done.
v If using the COBOL MERGE statement, a copy application cannot be done.
See COBOL Requirements for Copy Processing on page 344 for user exit
requirements.
Overview
This chapter describes ICETOOL, a multi-purpose DFSORT utility. ICETOOL uses
the capabilities of DFSORT to perform multiple operations on one or more data sets
in a single job step. These operations include the following:
v Creating multiple copies of sorted, edited, or unedited input data sets
v Creating output data sets containing subsets of input data sets based on various
criteria for character and numeric field values or the number of times unique
values occur
v Creating output data sets containing different field arrangements of input data
sets
v Creating list data sets showing character and numeric fields in a variety of
simple, tailored, and sectioned report formats, allowing control of title, date, time,
page numbers, headings, lines per page, field formats, and total, maximum,
minimum and average values for the columns of numeric data
v Printing messages that give statistical information for selected numeric fields
such as minimum, maximum, average, total, count of values, and count of unique
values
v Printing messages that identify invalid decimal values
v Printing messages that give record counts
v Setting RC=12 or RC=0 based on record counts
v Creating a list data set showing the DFSORT installation defaults in use
v Creating list data sets showing unique values for selected character and numeric
fields and the number of times each occurs, in a variety of simple and tailored
report formats
v Creating list and output data sets for records with: duplicate values, non-duplicate
values, or values that occur n times, less than n times or more than n times
| v Creating output data sets with information spliced together from two or more
| input records with duplicate values. The information in the input records can
| originate from different data sets, helping you to perform various file join and
| match operations.
v Using three different modes (stop, continue, and scan) to control error checking
and actions after error detection for groups of operators.
Restriction: You can use ICETOOL for SORT and COPY operations, but you
cannot use ICETOOL for MERGE operations.
ICETOOL/DFSORT Relationship
ICETOOL is a batch front-end utility that uses the capabilities of DFSORT to
perform the operations you request.
| ICETOOL includes thirteen operators that perform sort, copy, statistical, report,
| selection, and splice operations. Most of the operations performed by ICETOOL
require only simple JCL and operator statements. Some ICETOOL operations
require or allow you to specify complete DFSORT control statements (such as
SORT, INCLUDE, and OUTFIL) to take full advantage of DFSORTs capabilities.
ICETOOL also produces messages and return codes describing the results of each
operation and any errors detected. Although you generally do not need to look at
the DFSORT messages produced as a result of an ICETOOL run, they are
available in a separate data set if you need them.
UNIQUE
Prints a message containing the count of unique values for a specified numeric
or character field.
VERIFY
Examines specified decimal fields in a data set and prints a message identifying
each invalid value found for each field.
Using Symbols
You can define and use a symbol for any field or constant in the following ICETOOL
| operators: COUNT, DISPLAY, OCCUR, RANGE, SELECT, SPLICE, STATS,
| UNIQUE, and VERIFY. You can also use symbols in the DFSORT control
statements you specify for an ICETOOL run. 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.
Invoking ICETOOL
ICETOOL can be invoked in the following three ways:
v Directly (that is, not from a program) using the TOOLIN Interface
v From a program using the TOOLIN Interface
v From a program using the Parameter List Interface.
With the TOOLIN Interface, you supply ICETOOL statements in a data set defined
by the TOOLIN DD statement. ICETOOL prints messages in the data set defined by
the TOOLMSG DD statement.
With the Parameter List Interface, your program supplies ICETOOL statements in a
parameter list. ICETOOL prints messages in the data set defined by the TOOLMSG
DD statement and also puts information in the parameter list for use by your
program.
MODE STOP
VERIFY FROM(DATA1) ON(22,7,PD)
DISPLAY FROM(DATA1) LIST(SALARIES) -
TITLE(Employee Salaries) DATE TIME -
HEADER(Employee Name) HEADER(Salary) -
ON(1,20,CH) ON(22,7,PD) BLANK -
AVERAGE(Average Salary)
STATS FROM(DATA1) ON(22,7,PD)
RANGE FROM(DATA1) ON(22,7,PD) LOWER(20000)
RANGE FROM(DATA1) ON(22,7,PD) HIGHER(19999) LOWER(40000)
RANGE FROM(DATA1) ON(22,7,PD) HIGHER(40000)
OCCUR FROM(DATA1) LIST(SALARIES) -
TITLE(Employees Receiving Each Salary) DATE TIME -
HEADER(Salary) HEADER(Employee Count) -
ON(22,7,PD) ON(VALCNT) BLANK
Assume that you specify DD statements with the following ddnames for the
indicated data sets:
DATA1
A data set containing the name, salary, department, location and so on, of
each of your employees. The name field is in positions 1 through 20 in
character format and the salary field is in positions 22 through 28 in packed
decimal format.
SALARIES
A SYSOUT data set.
STATS
Prints messages in the TOOLMSG data set showing the minimum,
maximum, average, and total of the individual salaries.
RANGE
The three RANGE operators print messages in the TOOLMSG data set
showing the number of salaries below $20,000, from $20,000 to $39,999,
and above $40,000.
OCCUR
Prints a report with each unique salary and the number of employees who
receive it in the SALARIES list data set.
* GROUP 1
MODE CONTINUE
COPY FROM(DATA1) TO(DATA2)
COPY FROM(MSTR1) TO(MSTR2)
SELECT FROM(DATA1) TO(SMALLDPT) ON(30,4,CH) LOWER(10)
UNIQUE FROM(MSTR1) ON(30,4,CH)
* GROUP 2
MODE STOP
COPY FROM(DATA1) TO(TEMP1) USING(NEW1)
COPY FROM(DATA1) TO(TEMP2) USING(NEW2)
COPY FROM(DATA1) TO(TEMP3) USING(NEW3)
SORT FROM(CONCAT) TO(FINALD,FINALP) USING(FINL)
Assume that you specify DD statements with the following ddnames for the
indicated data sets:
DATA1
A data set containing the name, salary, department, location, and so on, of each
of your employees. The department field is in positions 30 through 33 in
character format.
MSTR1
Master data set containing only the name and department of each of your
employees. The department field is in positions 30 through 33 in character
format.
DATA2, MSTR2, and SMALLDPT
Permanent data sets.
NEW1CNTL
A data set containing DFSORT control statements to INCLUDE employees in
department X100 and change the records to match the format of MSTR1.
NEW2CNTL
Same as NEW1CNTL but for department X200.
NEW3CNTL
Same as NEW1CNTL but for department X300.
TEMP1, TEMP2, and TEMP3
Temporary data sets.
FINLCNTL
A data set containing a DFSORT control statement to sort by department and
employee name.
CONCAT
A concatenation of the TEMP1, TEMP2, TEMP3, and MSTR1 data sets.
FINALD
A permanent data set.
FINALP
A SYSOUT data set.
You can combine both of these examples into a single ICETOOL job step.
TOOLMSG DD Statement
Defines the ICETOOL message data set for all operations. ICETOOL messages
and statements appear in this data set. ICETOOL uses RECFM=FBA,
LRECL=121 and the specified BLKSIZE for the TOOLMSG data set. If the
BLKSIZE you specify is not a multiple of 121, ICETOOL uses BLKSIZE=121. If
you do not specify the BLKSIZE, ICETOOL selects the block size as directed by
the SDBMSG installation option (see z/OS DFSORT Installation and
Customization).
The TOOLMSG DD statement must be present.
DFSMSG DD Statement
Defines the DFSORT message data set for all operations. The DFSORT
messages and control statements from all ICETOOL calls to DFSORT appear in
this data set. Refer to the discussion of SYSOUT in System DD Statements
on page 63 for details.
The DFSMSG DD statement must be present.
Note: A SYSOUT data set should be used for DFSMSG. If you define
DFSMSG as a temporary or permanent data set, you will only see the
DFSORT messages from the last call to DFSORT unless you allocate a
new data set using a disposition of MOD.
//SYMNAMES DD
Defines the SYMNAMES data set containing statements to be used for symbol
processing. See Chapter 7, Using Symbols for Fields and Constants, on page
507 for complete details.
//SYMNOUT DD
Defines the data set in which SYMNAMES statements and the symbol table are
to be listed. See Chapter 7, Using Symbols for Fields and Constants, on page
507 for complete details.
TOOLIN DD statement
Defines the ICETOOL statement data set which must have the following
attributes: RECFM=F or RECFM=FB and LRECL=80.
If the TOOLIN Interface is used, the TOOLIN DD statement must be present. If
the Parameter List Interface is used, the TOOLIN DD statement is not required
and is ignored if present.
indd DD Statement
Defines the input data set for an operation. Refer to SORTIN DD Statement
on page 67 for details. ICETOOL imposes the additional restriction that the
LRECL of this data must be at least 4.
An indd DD statement must be present for each unique indd name specified in
each FROM operand.
outdd DD Statement
| Defines an output data set for a COPY, SELECT, SORT, or SPLICE operation.
Refer to SORTOUT and OUTFIL DD Statements on page 72 for details.
An outdd DD statement must be present for each unique outdd name specified
in each TO operand.
savedd DD Statement
Defines an output data set for a SELECT operation. Refer to SORTOUT and
OUTFIL DD Statements on page 72 for details.
A savedd DD statement must be present for each unique savedd name
specified in each DISCARD operand.
listdd DD Statement
Defines the list data set for a DEFAULTS, DISPLAY, or OCCUR operation. For
each listdd data set, ICETOOL uses RECFM=FBA, LRECL=121 (for
DEFAULTS) or the LRECL specified in the WIDTH operand or calculated as
needed if WIDTH is not specified (DISPLAY and OCCUR), and the specified
block size. If the BLKSIZE you specify is not a multiple of the LRECL,
ICETOOL uses BLKSIZE=LRECL. If you do not specify BLKSIZE, ICETOOL
| selects the block size as directed by the LISTSDB or LISTNOSDB option if
| specified, or otherwise as directed by the SDBMSG installation option (see
z/OS DFSORT Installation and Customization).
A listdd DD statement must be present for each unique listdd name specified in
each LIST operand.
xxxxCNTL DD Statement
| Defines the DFSORT control statement data set for a COPY, COUNT, SELECT,
| SORT, or SPLICE operation. Refer to SORTCNTL DD Statement on page 74
for more details.
An xxxxCNTL DD statement must be present for each unique xxxx specified in
each USING operand.
JCL Restrictions
You should avoid using ddnames reserved for ICETOOL and DFSORT in ICETOOL
operands (FROM, TO, LIST,DISCARD). In general, you should also avoid supplying
DD statements with ddnames reserved for DFSORT when using ICETOOL because
doing so can cause unpredictable results. Specifically:
v SORTCNTL should not be used as a ddname in ICETOOL operators nor should
it be supplied as a DD statement. A xxxxCNTL DD statement should only be
supplied when you specify a USING(xxxx) operand. xxxx must be four characters
which are valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
v SYSIN, SORTCNTL, SORTIN, SORTOUT, SORTINnn, and xxxxINnn (where xxxx
is specified in a USING operand) should not be used as ddnames in ICETOOL
operators nor supplied as DD statements.
v TOOLMSG, DFSMSG, SYMNAMES, SYMNOUT, TOOLIN, SYSUDUMP, and
SYSABEND should not be used as ddnames in ICETOOL operators.
| v In general, xxxxWKdd ddnames should not be used as ddnames in ICETOOL
| operators nor supplied as DD statements. However, if you want to override
| dynamic allocation of work data sets for ICETOOL operators OCCUR and
| UNIQUE, you can use SORTWKdd DD statements for that purpose. If you want
| to override dynamic allocation of work data sets for ICETOOL operators SELECT,
| SORT, and SPLICE, you can use xxxxWKdd DD statements for that purpose in
| conjunction with the USING operand.
v DFSPARM (or the ddname specified for ICEMAC option PARMDDN) should not
be used as a ddname in ICETOOL operators. It should only be used as a DD
statement to override DFSORT options for all operators, if appropriate. Refer to
DFSPARM DD Statement on page 75 for details.
v xxxxOFdd (where xxxx is specified in a USING operand) is required as the
ddname when an OUTFIL statement in the xxxxCNTL data set specifies
FILES=dd. To avoid this requirement, use the FNAMES=ddname operand rather
than the FILES=dd operand in OUTFIL statements, and include a DD statement
for the specified ddname. See OUTFIL Control Statements on page 194 for
details of the FNAMES operand.
ICETOOL Statements
Each operation must be described to ICETOOL using an operator statement.
Additionally, ICETOOL allows comment statements and blank statements. An
explanation of the general rules for coding ICETOOL statements is given below
followed by a detailed discussion of each operator.
SORT FROM(INDD) -
USING(ABCD) -
TO(OUTPUT1,OUTPUT2,OUTPUT3)
Any characters specified after the hyphen are ignored. Each operand must be
completely specified on one line.
COPY Operator
LOCALE(name) SERIAL
LOCALE(CURRENT)
LOCALE(NONE)
DFSORT is called to copy the indd data set to the outdd data sets; the DFSORT
control statements in xxxxCNTL are used if USING(xxxx) is specified. You can use
DFSORT control statements and options in the xxxxCNTL data set to copy a subset
of the input records (INCLUDE or OMIT statement; SKIPREC and STOPAFT
| options; OUTFIL INCLUDE, OMIT, SAVE, STARTREC, ENDREC, SAMPLE, SPLIT,
| and SPLITBY operands; user exit routines), reformat records for output (INREC and
OUTREC statements, OUTFIL OUTREC operand, user exit routines), and so on.
Operand Descriptions
The operands described below can be specified in any order.
FROM(indd)
Specifies the ddname of the input data set to be read by DFSORT for this
operation. An indd DD statement must be present and must define an input
data set that conforms to the rules for DFSORTs SORTIN data set.
Refer to JCL Restrictions on page 392 for more information regarding the
selection of ddnames.
TO(outdd,...)
Specifies the ddnames of the output data sets to be written by DFSORT for this
operation. From 1 to 10 outdd names can be specified. An outdd DD statement
must be present for each outdd name specified. If a single outdd data set is
specified, DFSORT is called once to copy the indd data set to the outdd data
set, using SORTOUT processing; the outdd data set must conform to the rules
for DFSORTs SORTOUT data set. If multiple outdd data sets are specified and
SERIAL is not specified, DFSORT is called once to copy the indd data set to
the outdd data sets, using OUTFIL processing; the outdd data sets must
conform to the rules for DFSORTs OUTFIL data sets.
TO and USING can both be specified. If USING is not specified, TO must be
specified. If TO is not specified, USING must be specified.
A ddname specified in the FROM operand must not also be specified in the TO
operand.
Refer to JCL Restrictions on page 392 for more information regarding the
selection of ddnames.
USING(xxxx)
Specifies the first 4 characters of the ddname for the control statement data set
to be used by DFSORT for this operation. xxxx must be four characters which
are valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
If USING is specified, an xxxxCNTL DD statement must be present and the
control statements in it must conform to the rules for DFSORTs SORTCNTL
data set.
TO and USING can both be specified. If USING is not specified, TO must be
specified. If TO is not specified, USING must be specified and the xxxxCNTL
data set must contain either one or more OUTFIL statements or a MODS
statement for an E35 routine that disposes of all records. Other statements are
optional.
Refer to JCL Restrictions on page 392 for more information regarding the
selection of ddnames.
VSAMTYPE(x)
Specifies the record type for a VSAM input data set. x must be either F for
fixed-length record processing or V for variable-length record processing.
If VSAMTYPE(x) is specified, ICETOOL will pass a RECORD TYPE=x control
statement to DFSORT. (If you specify a RECORD TYPE=x statement in the
xxxxCNTL data set, it will override the one passed by ICETOOL.)
For complete information on record type processing for VSAM input, see
RECORD Control Statement on page 293.
LOCALE(name)
Specifies that locale processing is to be used and designates the name of the
locale to be made active during DFSORT processing. LOCALE(name) can be
used to override the LOCALE installation option. For complete details on
LOCALE(name), see the discussion of the LOCALE operand in OPTION
Control Statement on page 142.
LOCALE(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. LOCALE(CURRENT) can be used to override the LOCALE
installation option. For complete details on LOCALE(CURRENT), see the
discussion of the LOCALE operand in OPTION Control Statement on page
142.
LOCALE(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.
LOCALE(NONE) can be used to override the LOCALE installation option. For
complete details on LOCALE(NONE), see the discussion of the LOCALE
operand in OPTION Control Statement on page 142.
SERIAL
Specifies that OUTFIL processing is not to be used when multiple outdd data
sets are specified. DFSORT is called multiple times and uses SORTOUT
processing; the outdd data sets must conform to the rules for DFSORTs
SORTOUT data set. SERIAL is not recommended because the use of serial
processing (that is, multiple calls to DFSORT) instead of OUTFIL processing
can degrade performance and imposes certain restrictions as detailed below.
SERIAL is ignored if a single outdd data set is specified.
DFSORT is called to copy the indd data set to the first outdd data set using the
DFSORT control statements in the xxxxCNTL data set if USING(xxxx) is
specified. If the first copy is successful, DFSORT is called as many times as
necessary to copy the first outdd data set to the second and subsequent outdd
data sets. Therefore, for maximum efficiency, use a disk data set as the first in
a list of outdd data sets on both disk and tape. If more than one outdd data set
is specified, DFSORT must be able to read the first outdd data set after it is
written in order to copy it to the other outdd data sets. Do not use a SYSOUT
or DUMMY data set as the first in a list of outdd data sets because:
v if the first data set is SYSOUT, DFSORT abends when it tries to copy the
SYSOUT data set to the second outdd data set.
v if the first data set is DUMMY, DFSORT copies the empty DUMMY data set
to the other outdd data sets, with the result that all outdd data sets are then
empty.
COPY Examples
Although the COPY operators in the examples below could all be contained in a
single ICETOOL job step, they are shown and discussed separately for clarity.
Example 1
* Method 1
COPY FROM(MASTER) TO(PRINT,TAPE,DISK)
* Method 2
COPY FROM(MASTER) TO(DISK,TAPE,PRINT) SERIAL
This example shows two different methods for creating multiple output data sets.
Method 1 requires one call to DFSORT, one pass over the input data set, and
allows the output data sets to be specified in any order. The COPY operator copies
all records from the MASTER data set to the PRINT (SYSOUT), TAPE, and DISK
data sets, using OUTFIL processing.
Method 2 requires three calls to DFSORT, three passes over the input data set, and
imposes the restriction that the SYSOUT data set must not be the first TO data set.
The COPY operator copies all records from the MASTER data set to the DISK data
set and then copies the resulting DISK data set to the TAPE and PRINT (SYSOUT)
data sets. Since the first TO data set is processed three times (written, read, read),
placing the DISK data set first is more efficient than placing the TAPE data set first.
PRINT must not be the first in the TO list because a SYSOUT data set cannot be
read.
Example 2
* Method 1
COPY FROM(IN) TO(DEPT1) USING(DPT1)
COPY FROM(IN) TO(DEPT2) USING(DPT2)
COPY FROM(IN) TO(DEPT3) USING(DPT3)
* Method 2
COPY FROM(IN) USING(ALL3)
This example shows two different methods for creating subsets of an input data set.
Assume that:
v The DPT1CNTL data set contains:
INCLUDE COND=(5,3,CH,EQ,CD01)
v The DPT2CNTL data set contains:
INCLUDE COND=(5,3,CH,EQ,CD02)
v The DPT3CNTL data set contains:
INCLUDE COND=(5,3,CH,EQ,CD03)
v The ALL3CNTL data set contains:
OUTFIL FNAMES=DEPT1,INCLUDE=(5,3,CH,EQ,CD01)
OUTFIL FNAMES=DEPT2,INCLUDE=(5,3,CH,EQ,CD02)
OUTFIL FNAMES=DEPT3,INCLUDE=(5,3,CH,EQ,CD03)
Method 1 requires three calls to DFSORT and three passes over the input data set:
v The first COPY operator copies the records from the IN data set that contain D01
in positions 5-7 to the DEPT1 data set.
v The second COPY operator copies the records from the IN data set that contain
D02 in positions 5-7 to the DEPT2 data set.
v The third COPY operator copies the records from the IN data set that contain
D03 in positions 5-7 to the DEPT3 data set.
Method 2 accomplishes the same result as method 1, but because it uses OUTFIL
statements instead of TO operands, requires only one call to DFSORT and one
pass over the input data set.
Example 3
COPY FROM(VSAMIN) TO(VSAMOUT) VSAMTYPE(V)
The COPY operator copies all records from the VSAMIN data set to the VSAMOUT
data set. The VSAM records are treated as variable-length.
COUNT Operator
COUNT FROM(indd)
USING(xxxx) VSAMTYPE(x) LOCALE(name)
LOCALE(CURRENT)
LOCALE(NONE)
EMPTY
NOTEMPTY
HIGHER(x)
LOWER(y)
EQUAL(v)
NOTEQUAL(w)
Prints a message containing the count of records in a data set. Can also be used to
set RC=12 or RC=0 based on meeting criteria for the number of records in a data
set.
DFSORT is called to copy the indd data set to ICETOOLs E35 user exit. The
DFSORT control statements in xxxxCNTL are used if USING(xxxx) is specified. You
can use a DFSORT INCLUDE or OMIT statement in the xxxxCNTL data set to
count a subset of the input records.
If an INCLUDE or OMIT statement is specified in the xxxxCNTL data set, the active
locales collating rules affect INCLUDE and OMIT processing as explained in the
Cultural Environment Considerations discussion in INCLUDE Control Statement
on page 96.
Note: Be sure to check the messages in TOOLMSG when you initially set up any
COUNT operators with criteria to make sure that RC=12 is not issued
because of syntax errors.
You must not supply your own DFSORT MODS statement because it would
override the MODS statement passed by ICETOOL for this operator.
Note: The record count is also printed for the DISPLAY, OCCUR, RANGE,
SELECT, STATS, UNIQUE, and VERIFY operators.
Operand Descriptions
The operands described below can be specified in any order.
FROM(indd)
See the discussion of this operand on the COPY statement in COPY Operator
on page 393.
USING(xxxx)
Specifies the first 4 characters of the ddname for the control statement data set
to be used by DFSORT for this operation. xxxx must be four characters which
are valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
If USING is specified, an xxxxCNTL DD statement must be present and the
control statements in it:
1. Must conform to the rules for DFSORTs SORTCNTL data set.
2. Should generally be used only for an INCLUDE or OMIT statement or
comments statements.
Refer to JCL Restrictions on page 392 for more information regarding the
selection of ddnames.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY Operator
on page 393.
LOCALE(name)
See the discussion of this operand on the COPY statement in COPY Operator
on page 393.
LOCALE(CURRENT)
See the discussion of this operand on the COPY statement in COPY Operator
on page 393.
LOCALE(NONE)
See the discussion of this operand on the COPY statement in COPY Operator
on page 393.
EMPTY
Sets RC=12 for this COUNT operator if the input data set or subset is empty, or
sets RC=0 for this COUNT operator if the input data set or subset is not empty.
EMPTY is equivalent to EQUAL(0).
NOTEMPTY
Sets RC=12 for this COUNT operator if the input data set or subset is not
empty, or sets RC=0 for this COUNT operator if the input data set or subset is
empty.
EMPTY is equivalent to NOTEQUAL(0).
HIGHER(x)
Sets RC=12 for this COUNT operator if the record count is higher than x, or
sets RC=0 for this COUNT operator if the record count is equal to or lower than
x.
x must be specified as n or +n where n can be 0 to 562949953421310.
LOWER(y)
Sets RC=12 for this COUNT operator if the record count is lower than y, or sets
RC=0 for this COUNT operator if the record count is equal to or higher than y.
y must be specified as n or +n where n can be 0 to 562949953421310.
EQUAL(v)
Sets RC=12 for this COUNT operator if the record count is equal to v, or sets
RC=0 for this COUNT operator if the record count is not equal to v.
v must be specified as n or +n where n can be 0 to 562949953421310.
NOTEQUAL(w)
Sets RC=12 for this COUNT operator if the record count is not equal to w, or
sets RC=0 for this COUNT operator if the record count is equal to w.
w must be specified as n or +n where n can be 0 to 562949953421310.
COUNT Examples
Example 1
For this example, assume that the CTL1CNTL data set contains a DFSORT
INCLUDE statement.
COUNT FROM(IN1)
COUNT FROM(IN2) USING(CTL1)
The first COUNT operator prints a message containing the count of records in the
IN1 data set.
The second COUNT operator prints a message containing the count of records
included from the IN2 data set.
Example 2
COUNT FROM(INPUT1) EMPTY
Sets RC=12 if INPUT1 is empty (that is, INPUT1 has no records), or sets RC=0 if
INPUT1 is not empty (that is, INPUT1 has at least one record).
Example 3
For this example, assume that the CTL2CNTL data set contains a DFSORT
INCLUDE statement.
Sets RC=12 if more than 50000 records are included from INPUT2, or sets RC=0 if
50000 or less records are included from INPUT2.
DEFAULTS Operator
| DEFAULTS LIST(listdd)
LISTSDB
LISTNOSDB
DFSORT enables you to maintain eight separate sets of installation defaults using
eight installation modules as follows:
v Environment installation modules
JCL (ICEAM1 module) - batch JCL directly invoked installation module
INV (ICEAM2 module) - batch program invoked installation module
TSO (ICEAM3 module) - TSO directly invoked installation module
TSOINV (ICEAM4 module) - TSO program invoked installation module
v Time-of-day installation modules
TD1 (ICETD1 module) - first time-of-day installation module
TD2 (ICETD2 module) - second time-of-day installation module
TD3 (ICETD3 module) - third time-of-day installation module
TD4 (ICETD4 module) - fourth time-of-day installation module
Each installation default has two or more possible values; DFSORT is shipped with
a set of IBM-supplied defaults that can be modified using the ICEMAC macro. The
DEFAULTS operator provides an easy way to determine the installation defaults
selected for each of the installation modules when DFSORT was installed. See
z/OS DFSORT Installation and Customization for a complete discussion of
ICEMAC, the eight installation modules and the installation defaults and their
values.
The value for each item (for each of the eight installation environments) is shown as
it is set in the ICEAM1-4 and ICETD1-4 installation modules loaded from the
STEPLIB, JOBLIB, or link library. For any value that is different from the
IBM-supplied value, the IBM-supplied value is shown below it.
The value for each item (for each of the eight installation environments) is shown as
it is set in the ICEAM1-4 and ICETD1-4 installation modules loaded from the
STEPLIB, JOBLIB, or link library. For any value that is different from the
IBM-supplied value, the IBM-supplied value is shown below it.
The control character occupies the first byte of each record. The title and headings
are always printed; p is the page number. The item name column occupies 10
bytes, each of the item value columns occupies 20 bytes, and 5 blanks appear
between columns.
Operand Descriptions
LIST(listdd)
Specifies the ddname of the list data set to be produced by ICETOOL for this
operation. A listdd DD statement must be present. ICETOOL uses
RECFM=FBA, LRECL=121 and the specified BLKSIZE for the list data set. If
the BLKSIZE you specify is not a multiple of 121, ICETOOL uses
BLKSIZE=121. If you do not specify the BLKSIZE, ICETOOL selects the block
| size as directed by LISTSDB or LISTNOSDB if specified, or otherwise as
directed by the SDBMSG installation option from ICEAM2 or ICEAM4 (see z/OS
DFSORT Installation and Customization).
Refer to JCL Restrictions on page 392 for more information regarding the
selection of ddnames.
| LISTSDB or LISTNOSDB
| Can be used to override the SDBMSG value for this LIST data set. LISTSDB
| directs ICETOOL to select the system-determined optimum block size for the
| LIST data set in the same way as for installation option SDBMSG=YES.
| LISTNOSDB directs ICETOOL to select the block size for the LIST data set in
| the same way as for installation option SDBMSG=NO. See the discussion of
| the LIST(listdd) operand above for more information on how LISTSDB or
| LISTNOSDB affects the LIST data set block size.
| Attention: LISTSDB has no effect for SYSOUT data sets (for example, //RPT1
| DD SYSOUT=*), since the system-determined optimum block size is not used
| for spool or dummy data sets.
DEFAULTS Example
DEFAULTS LIST(OPTIONS)
Prints, in the OPTIONS data set, the DFSORT installation defaults. The OPTIONS
output starts on a new page and might look as follows (the first few items are
shown with illustrative values for the ICEAM1-4 report and for the ICETD1-4 report):
The title and appropriate heading lines appear at the top of each page. The
specified and IBM-supplied ALTSEQ tables are printed separately after the other
items.
DISPLAY Operator
TITLE(string) PAGE DATE TIME BLANK
DATE(abcd) TIME(abc) PLUS
DATENS(abc) TIMENS(ab)
E
HEADER(string) LINES(n) INDENT(n) BETWEEN(n)
HEADER(NONE)
NOHEADER
TOTAL(string) MAXIMUM(string) MINIMUM(string)
AVERAGE(string) LIMIT(n) VSAMTYPE(x) WIDTH(n)
BREAK(p,m,f) BTITLE(string) BTOTAL(string)
BREAK(p,m,f,formatting)
BMAXIMUM(string) BMINIMUM(string) BAVERAGE(string)
STATLEFT UZERO LISTSDB
LISTNOSDB
Prints the values or characters of specified numeric fields (including SMF date/time)
or character fields in a separate list data set. Simple, tailored, and sectioned reports
can be produced. From 1 to 20 fields can be specified, but the resulting list data set
line length must not exceed the limit specified by the WIDTH operand or 2048 bytes
if WIDTH is not specified. The record number can be printed as a special field.
DFSORT is called to copy the indd data set to ICETOOLs E35 user exit. ICETOOL
uses its E35 user exit to print appropriate titles, headings and data in the list data
set.
You must not supply your own DFSORT MODS, INREC, or OUTREC statement
since they would override the DFSORT statements passed by ICETOOL for this
operator.
Simple Report
You can produce a simple report by specifying just the required operands. For
example, if you specify FROM and LIST operands, and ON operands for 10-byte
character and 7-byte zoned decimal fields, the output in the list data set can be
represented as follows:
(p,m,f) (p,m,f)
characters sddddddddddddddd
. .
. .
. .
A control character occupies the first byte of each list data set record. Left-justified
standard headings are printed at the top of each page to indicate the contents of
each column, followed by a line for each record showing the characters and
numbers in the fields of that record.
The fields are printed in columns in the same order in which they are specified in
the DISPLAY statement. All fields are left-justified. For numeric fields, leading zeros
are printed, a is used for the minus sign, and a + is used for the plus sign.
By default, the first column of data starts immediately after the control character,
and three blanks appear between columns. The INDENT operand can be used to
change the number of blanks before the first column of data. The BETWEEN
operand can be used to change the number of blanks between columns.
The NOHEADER operand can be used to create list data sets containing only data
records. Data sets created in this way can be processed further by other operators
(for example, STATS or UNIQUE) using CH format for character values or CSF/FS
format for numeric values.
TOTAL, MAXIMUM, MINIMUM, and AVERAGE can be used to print statistics for
numeric fields after the columns of data. Formatting items can be used to suppress
the statistics for selected numeric fields.
Tailored Report
You can tailor the output in the list data set using various operands that control title,
date, time, page number, headings, lines per page, field formats, and total,
maximum, minimum, and average values for the columns of numeric data. The
optional operands can be used in many different combinations to produce a wide
variety of report formats. For example, if you specify FROM, LIST, BLANK, TITLE,
PAGE, DATE, TIME, HEADER and AVERAGE operands, and ON operands for
10-byte character and 7-byte zoned decimal fields, the output in the list data set
can be represented as follows:
title - p - mm/dd/yy hh:mm:ss
header header
---------- --------
characters sd
. .
. .
. .
average sd
A control character occupies the first byte of each list data set record. The title line
is printed at the top of each page of the list data set. It contains the elements you
specify (title string, page number, date and time) in the order in which you specify
them. Eight blanks appear between title elements. A blank line is printed after the
title line.
Your specified headings (underlined) are printed after the title line on each page to
indicate the contents of each column, followed by a line for each record showing
the characters and numbers in the fields of that record. Headings for character
fields are left-justified and headings for numeric fields are right-justified.
Your specified statistical lines (total, maximum, minimum, and average, and their
associated strings) are printed for selected numeric fields after the columns of data.
The associated strings can be printed in the first column or to the left of it.
The fields are printed in columns in the same order in which they are specified in
the DISPLAY statement. Character fields are left-justified and numeric fields are
right-justified. For numeric fields, leading zeros are suppressed, a is used for the
minus sign, and a blank is used for the plus sign (you can specify PLUS rather than
BLANK if you want a + to be used for the plus sign).
Formatting items can be used to change the appearance of individual numeric fields
in the report with respect to separators, number of digits, decimal point, decimal
places, signs, leading zeros, division by 10, 100, 1000, 10000, 100000, 1000000,
1000000000, 1024, 1048576 (1024*1024), or 1073741824 (1024*1024*1024),
leading strings, floating strings, and trailing strings. Formatting items can also be
used to insert leading or trailing strings for character fields.
The column widths are dynamically adjusted according to the length of the headings
and the maximum number of bytes needed for the character or numeric data.
Sectioned Report
You can produce a sectioned report (simple or tailored) by including a BREAK
operand to indicate the break field used to divide the report into sections. Each set
of sequential input records (which you have previously sorted on the break field and
other fields, as appropriate), with the same value for the specified break field,
results in a corresponding set of data lines that is treated as a section in the report.
The break field is printed at the beginning of each section. Formatting items can be
used to change the appearance of numeric break fields, and to insert a string
before or after character or numeric break fields.
Optional break operands can be used to modify the break title for each section (the
break value is always printed as part of the break title) and to print statistics for
selected numeric fields in each section. For example, if you add BTITLE, BREAK,
BMAXIMUM, and BMINIMUM to the operands for the tailored report discussed
above, each section of the output in the list data set starts on a new page and can
be represented as follows:
title - p - mm/dd/yy hh:mm:ss
btitle bvalue
header header
---------- --------
characters sd
. .
. .
. .
bmaximum sd
bminimum sd
The final page showing the overall statistics starts on a new page and can be
represented as follows:
title - p - mm/dd/yy hh:mm:ss
header header
---------- --------
average sd
Operand Descriptions
The operands described below can be specified in any order.
FROM(indd)
Specifies the ddname of the input data set to be read by DFSORT for this
operation. An indd DD statement must be present and must define an input
data set that conforms to the rules for DFSORTs SORTIN data set. In addition,
the LRECL of the data set must be at least 4.
ON(p,m,f)
Specifies the position, length, and format of a numeric or character field to be
used for this operation. (p,m,f) is used for the standard column heading (see
HEADER(string), HEADER(NONE) and NOHEADER for alternative heading
options).
p specifies the first byte of the field relative to the beginning of the input record. p is
1 for the first data byte of a fixed-length record and 5 for the first data byte of a
variable-length record as illustrated below (RRRR represents the 4-byte record
descriptor word):
m specifies the length of the field in bytes. A field must not extend beyond position
32752 or beyond the end of a record. The maximum length for a field depends on
its format.
E mask
E'pattern'
L'string'
F'string'
T'string'
LZ
NOST
Ndd
/x
specifies formatting items that indicate how the data for this field is to be
formatted for printing. Formatting items can be specified in any order, but each
item can only be specified once. Any formatting item can be specified for a
numeric field, but only L'string' and T'string' can be specified for a character
field.
The table below describes the available masks and shows how the values
12345678 and -1234567 would be printed for each mask. In the pattern:
v d is used to represent a decimal digit (0-9)
v w is used to represent a leading sign that will be blank for a positive value or
for a negative value
v x is used to represent a trailing sign that will be blank for a positive value or
for a negative value
v y is used to represent a leading sign that will be blank for a positive value or
( for a negative value
v z is used to represent a trailing sign that will be blank for a positive value or )
for a negative value
Table 65. Edit Mask Patterns
Mask Pattern 12345678 1234567
A0 wddddddddddddddd 12345678 1234567
A1 wddd,ddd,ddd,ddd,ddd 12,345,678 1,234,567
A2 wddd.ddd.ddd.ddd.ddd 12.345.678 1.234.567
A3 wddd ddd ddd ddd ddd 12 345 678 1 234 567
A4 wddddddddddddddd 12345678 1234567
A5 ddd ddd ddd ddd dddx 12 345 678 1 234 567
B1 wdd,ddd,ddd,ddd,ddd.d 1,234,567.8 123,456.7
B2 wdd.ddd.ddd.ddd.ddd,d 1.234.567,8 123.456,7
B3 wdd ddd ddd ddd ddd,d 1 234 567,8 123 456,7
B4 wdddddddddddddd.d 1234567.8 123456.7
B5 wdddddddddddddd,d 1234567,8 123456,7
B6 dd ddd ddd ddd ddd,dx 1 234 567,8 123 456,7
C1 wd,ddd,ddd,ddd,ddd.dd 123,456.78 12,345.67
C2 wd.ddd.ddd.ddd.ddd,dd 123.456,78 12.345,67
C3 wd ddd ddd ddd ddd,dd 123 456,78 12 345,67
C4 wddddddddddddd.dd 123456.78 12345.67
C5 wddddddddddddd,dd 123456,78 12345,67
C6 d ddd ddd ddd ddd,ddx 123 456,78 12 345,67
D1 wddd,ddd,ddd,ddd.ddd 12,345.678 1,234.567
The leading sign (blank for a positive value or for a negative value) appears
to the left of the first non-suppressed digit of the formatted value. For example,
1 is shown as 1 with ON(21,6,FS,A2), as 000.001 with ON(21,6,FS,A2,LZ)
and as 0.01 with ON(21,6,FS,C2).
E'pattern'
specifies an edit pattern to be applied to the numeric data for this field.
E'pattern' is useful for formatting unsigned numeric data such as telephone
numbers, dates, time-of-day, social security numbers, and so on. For example,
0123456789 is shown as (012)-345-6789 with ON(21,10,ZD,E'(999)-999-9999').
The pattern (1 to 24 characters) must be enclosed in single apostrophes. Each
9 in the pattern (up to 15) is replaced by a corresponding digit from the numeric
value. Characters other than 9 in the pattern appear as specified. To include a
single apostrophe (') in the pattern, specify two single apostrophes ('').
F'string' or a mask cannot be specified with E'pattern'.
When E'pattern' is specified for a field:
v Values are shown unsigned. For example, +120622 and 120622 are both
shown as 12:06:22 with ON(12,7,FS,E'99:99:99').
v If the number of significant digits in a value is less than the number of 9s in
the pattern, 0s are filled in on the left. For example, 1234 is shown as
0012-34 with ON(12,6,FS,E'9999-99').
v If the number of significant digits in a value is greater than the number of 9s
in the pattern, digits are truncated from the left. For example, 1234567 is
shown as *45:67* with ON(9,4,PD,E'99:99*').
Lstring
specifies a leading string to appear at the beginning of the character or numeric
data column for this field. For example, DFSORT is shown as **DFSORT
with ON(1,8,CH,L**).
The string (1 to 10 characters) must be enclosed in single apostrophes. To
include a single apostrophe () in the string, specify two single apostrophes ().
Fstring
specifies a floating string to appear to the left of the first non-blank character of
the formatted numeric data for this field. For example, 0001234 is shown as
$12.34 with ON(9,7,ZD,C1,F$).
The string (1 to 10 characters) must be enclosed in single apostrophes. To
include a single apostrophe () in the string, specify two single apostrophes ().
E'pattern' cannot be specified with F'string'.
Tstring
specifies a trailing string to appear at the end of the character or numeric data
column for this field. For example, DFSORT is shown as **DFSORT *** with
ON(1,8,CH,L**,T***).
The string (1 to 10 characters) must be enclosed in single apostrophes. To
include a single apostrophe () in the string, specify two single apostrophes ().
LZ specifies that leading zeros are to be printed when the specified edit mask is
applied to the numeric data for this field, overriding the default of suppressing
leading zeros. For example, +123 is shown as 123 with ON(21,6,FS,A0), but as
000123 with ON(21,6,FS,A0,LZ).
LZ is useful for formatting numeric data, such as account numbers, for which
leading zeros must be printed.
Leading zeros are always printed for E'pattern' regardless of whether or not LZ
is specified.
NOST
specifies that requested statistics (TOTAL, MAXIMUM, MINIMUM, AVERAGE,
BTOTAL, BMAXIMUM, BMINIMUM, BAVERAGE) are not to be printed for this
numeric field.
Ndd
specifies the number of digits to be used for the numeric field when determining
the column width. dd specifies the number of digits and must be a two-digit
number between 01 and 15.
When TOTAL or BTOTAL is specified, the default number of digits is 15. If you
know that your TOTAL or BTOTAL value requires less than 15 digits, you can
use Ndd to indicate that, thus reducing the column width if it is determined by
the number of digits.
If dd is greater than or equal to the default number of digits, dd is used. If dd is
less than the default number of digits, the default is used. For example:
If TOTAL or BTOTAL is used:
v If ON(1,5,ZD) is specified, 15 digits (default for TOTAL) is used for the
number of digits when determining the column width.
v If ON(1,5,ZD,N10) is specified, 10 digits (from N10) is used.
v If ON(1,5,ZD,N03) is specified, 5 digits (default for 5,ZD) is used.
v If ON(1,5,ZD) is specified, 5 digits (default for 5,ZD) is used for the number
of digits when determining the column width.
v If ON(1,5,ZD,N10) is specified, 10 digits (from N10) is used.
v If ON(1,5,ZD,N03) is specified, 5 digits (default for 5,ZD) is used.
If you use Ndd and a total overflows the number of digits used, ICETOOL prints
asterisks for the total and terminates the operation.
E mask
E'pattern'
L'string'
F'string'
T'string'
LZ
NOST
Ndd
/x
specifies formatting items that indicate how the data for this field is to be
formatted for printing. Formatting items can be specified in any order, but each
item can only be specified once.
E mask
E'pattern'
L'string'
F'string'
T'string'
LZ
Ndd
DATENS(abc)
Specifies printing of the date in the title line. The date is printed in the
form 'abc' according to the specified values for abc. For example, on
March 29, 2002, DATENS(4MD) would produce '20020329' and
DATENS(MDY) would produce '032902'.
abc can be any combination of M, D, and Y or 4 (each specified once)
where M represents the month (01-12), D represents the day (01-31), Y
represents the last two digits of the year (for example, 02), and 4
represents the four digits of the year (for example, 2002).
The title line is printed at the top of each page of the list data set. It
contains the elements you specify (title string, page number, date and
time) in the order in which you specify them. Eight blanks appear
between title elements. A blank line is printed after the title line.
TIME Specifies printing of the time in the title line. The time is printed in the
form hh:mm:ss where hh is hours, mm is minutes and ss is seconds.
TIME is equivalent to specifying TIME(24:).
The title line is printed at the top of each page of the list data set. It
contains the elements you specify (title string, page number, date and
time) in the order in which you specify them. Eight blanks appear
between title elements. A blank line is printed after the title line.
TIME(abc)
Specifies printing of the time in the title line. The time is printed in the
form hhcmmcss xx according to the specified value for ab and c. For
example, at 08:25:13 pm, TIME=(24:) would produce 20:25:13 and
TIME=(12.) would produce 08.25.13 pm.
ab can be:
v 12 to indicate 12-hour time. hh (hours) is 01-12, mm (minutes) is
00-59, ss (seconds) is 00-59 and xx is am or pm.
v 24 to indicate 24-hour time. hh (hours) is 00-23, mm (minutes) is
00-59, ss (seconds) is 00-59 and xx is not included.
c can be any character and is used to separate the hours, minutes, and
seconds. The title line is printed at the top of each page of the list data
set. It contains the elements you specify (title string, page number, date
and time) in the order in which you specify them. Eight blanks appear
between title elements. A blank line is printed after the title line.
TIMENS(ab)
Specifies printing of the time in the title line. The time is printed in the
form 'hhmmss xx' according to the specified value for ab. For example,
at 08:25:13 pm, TIMENS=(24) would produce '202513' and
TIMENS=(12) would produce '082513 pm'.
ab can be:
v 12 to indicate 12-hour time. hh (hours) is 01-12, mm (minutes) is
00-59, ss (seconds) is 00-59 and xx is am or pm.
v 24 to indicate 24-hour time. hh (hours) is 00-23, mm (minutes) is
00-59, ss (seconds) is 00-59 and xx is not included.
The title line is printed at the top of each page of the list data set. It
contains the elements you specify (title string, page number, date and
time) in the order in which you specify them. Eight blanks appear
between title elements. A blank line is printed after the title line.
BLANK
Specifies an alternate format for printing character and numeric data as
follows:
v Numeric values for which formatting is not specified are printed with
blank for plus sign, for minus sign and no leading zeros (overriding
the default of + for plus sign and leading zeros).
Numeric values are thus displayed as:
d...d for positive values (blank sign immediately to the left of the
digits and no leading zeros)
d...d for negative values ( sign immediately to the left of the
digits and no leading zeros)
v Column widths are dynamically adjusted according to the length of
the headings and the maximum number of bytes needed for the
character or numeric data
v Headings and data for numeric fields are right-justified (overriding the
default of left-justified headings and data for numeric fields)
PLUS Specifies an alternate format for printing character and numeric data as
follows:
v Numeric values for which formatting is not specified are printed with
+ for plus sign, for minus sign and no leading zeros (overriding the
default of leading zeros).
Numeric values are thus displayed as:
+d...d for positive values ( sign immediately to the left of the
digits and no leading zeros)
d...d for negative values ( sign immediately to the left of the
digits and no leading zeros)
v Column widths are dynamically adjusted according to the length of
the headings and the maximum number of bytes needed for the
character or numeric data
v Headings and data for numeric fields are right-justified (overriding the
default of left-justified headings and data for numeric fields)
Blanks at the start or end of a heading string may alter the justification
of the heading or the width of the column.
If HEADER(string) is used for any ON field, HEADER(string) or
HEADER(NONE) must be used for each ON field.
HEADER(NONE)
Specifies that a heading is not to be printed for the corresponding ON
field. The standard column heading for the corresponding ON field is
suppressed.
If HEADER(string) is used for any ON field, HEADER(string) or
HEADER(NONE) must be used for each ON field. Specifying
HEADER(NONE) for every ON field is equivalent to specifying
NOHEADER.
NOHEADER
Specifies that headings for ON fields are not to be printed (overriding
the default of printing standard headings for ON fields).
If NOHEADER is used, it must be specified only once and
HEADER(string) or HEADER(NONE) must not be used.
If NOHEADER is specified without any TITLE, DATE, TIME, or PAGE
operands, the resulting list data set contains only data records. Data
sets created in this way can be processed further by other operators
(for example, STATS or UNIQUE) using CH for character values or
CSF/FS for numeric values.
LINES(n)
Specifies the number of lines per page for the list data set (overriding
the default of 58). n must be greater than 9, but less than 1000.
INDENT(n)
Specifies the number of blanks to be used to indent the report
(overriding the default of 0). n can be from 0 to 50. For example, if
INDENT(n) is not specified, the report starts in column 2 (after the
control character), whereas if INDENT(10) is specified, the report starts
in column 12 (after the control character and 10 blanks).
BETWEEN(n)
Specifies the number of blanks to be used between the columns of data
(overriding the default of 3). n can be from 0 to 50. For example, if
BETWEEN(n) is not specified, three blanks appear between columns,
whereas if BETWEEN(7) is specified, seven blanks appear between
columns.
TOTAL(string)
Specifies an overall TOTAL line is to be printed after the rows of data
for the report. The specified string is printed starting at the indent
column of the overall TOTAL line, followed by the overall total for each
numeric data column. If STATLEFT is specified, the string is printed to
the left of the first column of data with the totals on the same line as the
string. If STATLEFT is not specified, the string is printed in the first
column of data with the totals on the same line as the string, or on the
next line, as appropriate. A blank line is printed before the overall
TOTAL line.
ICETOOL always calculates the line length required to print all titles,
headings, data, and statistics and uses it as follows:
v If WIDTH(n) is specified and the calculated line length is less than or
equal to n, ICETOOL sets the line length and LRECL to n.
v If WIDTH(n) is specified and the calculated line length is greater than
n, ICETOOL issues an error message and terminates the operation.
v If WIDTH(n) is not specified and the calculated line length is less
than or equal to 121, ICETOOL sets the line length and LRECL to
121.
v If WIDTH(n) is not specified and the calculated line length is between
122 and 2048, ICETOOL sets the line length and LRECL to the
calculated line length.
v If WIDTH(n) is not specified and the calculated line length is greater
than 2048, ICETOOL issues an error message and terminates the
operation.
E mask
E'pattern'
L'string'
F'string'
T'string'
LZ
BTITLE(string)
Specifies a string to appear in the break title line printed for each page
of a section. BTITLE can only be specified if BREAK is specified. The
break value and break title string appear in the order in which you
specify BREAK and BTITLE. Two blanks appear between break title
elements. A blank line is printed after the break title line.
The string (1 to 50 characters) must be enclosed in single apostrophes.
To include a single apostrophe () in the string, specify two single
apostrophes (). Blanks at the start of the string move the text to the
right. Blanks at the end of the string increase the spacing between the
string and the break value if BTITLE is specified before BREAK.
BTOTAL(string)
Specifies a break TOTAL line is to be printed after the rows of data for
each section. BTOTAL can only be specified if BREAK is specified. The
specified string is printed starting at the indent column of the break
TOTAL line, followed by the break total for each numeric data column.If
STATLEFT is specified, the string is printed to the left of the first column
of data with the totals on the same line as the string. If STATLEFT is
not specified, the string is printed in the first column of data with the
totals on the same line as the string, or on the next line, as appropriate.
A blank line is printed before the break TOTAL line.
The string (1 to 50 characters) must be enclosed in single apostrophes.
To include a single apostrophe () in the string, specify two single
apostrophes (). To suppress printing of a string, specify BTOTAL()
using two single apostrophes.
The break total for each numeric ON field is printed in the format
(formatting, PLUS, BLANK, or standard) you specify. The total for a
specific numeric field is suppressed if the NOST formatting item is
specified for that field. Totals are printed for ON(VLEN) fields, but not
for ON(NUM) fields.
By default, column widths are adjusted to allow for a maximum of a
sign and 15 digits for the totals. If the break total for an ON field
overflows 15 digits, ICETOOL prints asterisks for the break total for that
field and terminates the operation.
You can use the Ndd formatting item to decrease the number of digits
used for a total. If the break total for an ON field overflows the number
of digits used, ICETOOL prints asterisks for the break total for that field
and terminates the operation.
The BTOTAL, BMAXIMUM, BMINIMUM, and BAVERAGE lines are
printed in the order in which you specify them.
BMAXIMUM(string)
Specifies a break MAXIMUM line is to be printed after the rows of data
for each section. BMAXIMUM can only be specified if BREAK is
specified. The specified string is printed starting at the indent column of
the break MAXIMUM line, followed by the break maximum for each
numeric data column. If STATLEFT is specified, the string is printed to
the left of the first column of data with the maximums on the same line
as the string. If STATLEFT is not specified, the string is printed in the
first column of data with the maximums on the same line as the string,
or on the next line, as appropriate. A blank line is printed before the
break MAXIMUM line.
The break average for each numeric ON field is printed in the format
(formatting, PLUS, BLANK, or standard) you specify. The average for a
specific numeric field is suppressed if the NOST formatting item is
specified for that field. Averages are printed for ON(VLEN) fields, but
not for ON(NUM) fields.
If the break total for an ON field overflows 15 digits, ICETOOL prints
asterisks for the break average for that field and terminates the
operation.
The BTOTAL, BMAXIMUM, BMINIMUM, and BAVERAGE lines are
printed in the order in which you specify them.
STATLEFT
Specifies that the strings for statistics (TOTAL, MAXIMUM, MINIMUM,
AVERAGE, BTOTAL, BMAXIMUM, BMINIMUM, BAVERAGE) are to be
placed to the left of the first column of data (overriding the default of
placing the strings in the first column). STATLEFT ensures that each
statistic appears on the same line as its string while making the
statistics lines stand out from the columns of data.
UZERO
Specifies that 0 and +0 are to be treated as unsigned zero values, that
is, as the same value. With UZERO, 0 and +0 are treated as positive
for ON, MINIMUM, MAXIMUM, BREAK, BMINIMUM and BMAXIMUM
processing.
UZERO overrides the default of treating 0 and +0 as signed zero
values, that is, as different values. Without UZERO, 0 is treated as
negative and +0 is treated as positive for ON, MINIMUM, MAXIMUM,
BREAK, BMINIMUM and BMAXIMUM processing.
| LISTSDB OR LISTNOSDB
| Can be used to override the SDBMSG value for this LIST data set.
| LISTSDB directs ICETOOL to select the system-determined optimum
| block size for the LIST data set in the same way as for installation
| option SDBMSG=YES. LISTNOSDB directs ICETOOL to select the
| block size for the LIST data set in the same way as for installation
| option SDBMSG=NO. See the discussion of the LIST(listdd) operand
| above for more information on how LISTSDB or LISTNOSDB affects
| the LIST data set block size.
| Attention: LISTSDB has no effect for SYSOUT data sets (for example,
| //RPT1 DD SYSOUT=*), since the system-determined optimum block
| size is not used for spool or dummy data sets.
DISPLAY Examples
Although the DISPLAY operators in the examples below could all be contained in a
single ICETOOL job step, they are shown and discussed separately for clarity. See
OCCUR Operator on page 443 for additional examples of tailoring the report
format.
Example 1
DISPLAY FROM(SOURCE) LIST(FIELDS) ON(NUM) ON(40,12,CH) -
ON(20,8,PD)
The FIELDS output starts on a new page and looks as follows (the first 2 records
are shown with illustrative values):
RECORD NUMBER (40,12,CH) (20,8,PD)
000000000000001 SAN JOSE 000000000003745
000000000000002 MORGAN HILL 000000000016502
. . .
. . .
. . .
Example 2
DISPLAY FROM(IN) LIST(LIST1) -
TITLE(National Accounting Report) -
PAGE DATE TIME -
HEADER(Division) HEADER(Revenue) HEADER(Profit/Loss) -
ON(1,25,CH) ON(45,10,ZD) ON(35,10,ZD) -
BLANK -
TOTAL(Company Totals) -
AVERAGE(Company Averages)
The LIST1 output starts on a new page and looks as follows (the first 2 records are
shown with illustrative values):
The title line and underlined heading line appear at the top of each page.
Example 3
DISPLAY FROM(DATA) LIST(JUSTDATA) -
NOHEADER -
ON(17,5,PD) ON(1,2,FI)
The JUSTDATA output contains no page ejects or heading lines and looks as
follows (the first 2 records are shown with illustrative values):
-0000000000273216 +0000000000000027
+0000000000993112 +0000000000000321
. .
. .
. .
Example 4
COPY FROM(INPUT) TO(TEMP) USING(TREG)
DISPLAY FROM(TEMP) LIST(REGULAR) -
TITLE(Report on Regular Tools ) PAGE -
HEADER(NONE) ON(1,18,CH) -
HEADER(Item) ON(35,5,CH) -
HEADER(Percent Change) ON(28,4,FS,B1) -
LINES(66)
COPY FROM(INPUT) TO(TEMP) USING(TPOW)
DISPLAY FROM(TEMP) LIST(POWER) -
TITLE(Report on Power Tools ) PAGE -
HEADER(NONE) ON(1,18,CH) -
HEADER(Item) ON(35,5,CH) -
HEADER(Percent Change) ON(28,4,FS,B1) -
LINES(66)
This example shows how reports for different subsets of data can be produced.
Assume that:
v The TREGCNTL data set contains:
INCLUDE COND=(44,8,CH,EQ,CRegular)
v The TPOWCNTL data set contains:
INCLUDE COND=(44,8,CH,EQ,CPower)
The first COPY operator copies the records from the INPUT data set that contain
Regular in positions 44-51 to the TEMP (temporary) data set
The first DISPLAY operator uses the first subset of records in the TEMP data set to
print, in the REGULAR data set:
v A title line containing the specified title and the page number; the page number is
moved to the right as a result of the extra blanks at the end of the TITLE string
and the 8 blanks between the title string and the page number
v A heading line containing the specified underlined headings (with no heading for
the first ON field)
v Data lines for the first subset of records containing:
The characters from positions 1-18
The characters from positions 35-39
The floating sign values from positions 28-31 formatted with one decimal
place and a period as the decimal point
The second COPY operator copies the records from the INPUT data set that
contain Power in positions 44-51 to the TEMP (temporary) data set
The second DISPLAY operator uses the second subset of records in the TEMP
data set to print, in the POWER data set:
v A title line containing the specified title and the page number; the page number is
moved to the right as a result of the extra blanks at the end of the TITLE string
and the 8 blanks between the title string and the page number
v A heading line containing the specified underlined headings (with no heading for
the first ON field)
v Data lines for the second subset of records containing:
The characters from positions 1-18
The characters from positions 35-39
The floating sign values from positions 28-31 formatted with one decimal
place and a period as the decimal point
The REGULAR output starts on a new page and looks as follows (the first 2
records are shown with illustrative values):
Report on Regular Tools - 1 -
The title line and underlined heading line appear at the top of each page. The
number of lines per page is 66, overriding the default of 58.
The POWER output starts on a new page and looks as follows (the first 2 records
are shown with illustrative values):
The title line and underlined heading line appear at the top of each page. The
number of lines per page is 66, overriding the default of 58.
Example 5
DISPLAY FROM(INV) LIST(RDWLIST1) -
TITLE(No Frills RDW Report) -
ON(NUM) -
ON(VLEN) -
ON(1,4,HEX) -
MINIMUM(Smallest) -
MAXIMUM(Largest)
The RDWLIST1 output starts on a new page and looks as follows (the first 2
records are shown with illustrative values):
No Frills RDW Report
Smallest +000000000000058
Largest +000000000000078
The title line and heading line appear at the top of each page.
Example 6
DISPLAY FROM(INV) LIST(RDWLIST2) -
DATE(DMY.) -
TITLE( Fancy RDW Report ) -
TIME(12:) -
HEADER(Relative Record) ON(NUM) -
HEADER( RDW (length)) ON(VLEN) -
HEADER(RDW (Hex)) ON(1,4,HEX) -
BLANK -
MINIMUM(Smallest Record in Variable Data Set:) -
MAXIMUM(Largest Record in Variable Data Set:)
RDWLIST2 output starts on a new page and looks as follows (the first 2 records are
shown with illustrative values):
21.09.92 Fancy RDW Report 01:52:28 pm
The title line and underlined heading line appear at the top of each page.
Example 7
SORT FROM(PARTS) TO(TEMP) USING(SRT1)
DISPLAY FROM(TEMP) LIST(USA) -
TITLE(Parts Completion Report for USA) DATE -
HEADER(Part) HEADER(Completed) HEADER(Value ($)) -
ON(15,6,CH) ON(3,4,ZD,A1) ON(38,8,ZD,C1) -
TOTAL(Total:)
DISPLAY FROM(TEMP) LIST(FRANCE) -
TITLE(Parts Completion Report for France) DATE(DM4/) -
HEADER(Part) HEADER(Completed) HEADER(Value (F)) -
ON(15,6,CH) ON(3,4,ZD,A3) ON(38,8,ZD,C3) -
TOTAL(Total:)
DISPLAY FROM(TEMP) LIST(DENMARK) -
TITLE(Parts Completion Report for Denmark) DATE(DMY-) -
HEADER(Part) HEADER(Completed) HEADER(Value (kr)) -
ON(15,6,CH) ON(3,4,ZD,A2) ON(38,8,ZD,C2) -
TOTAL(Total:)
This example shows how reports for three different countries can be produced. The
reports differ only in the way that date and numeric values are displayed.
The SORT operator sorts the PARTS data set to the TEMP data set using the
SORT statement in SRT1CNTL.
The first DISPLAY operator uses the sorted records in the TEMP data set to print,
in the USA data set:
v A title line containing the specified title and the date in the format commonly used
in the United States
v A heading line containing the specified underlined headings
v Data lines containing:
The characters from positions 15-20
The zoned decimal values from positions 3-6 formatted with the separators
commonly used in the United States
The zoned decimal values from positions 38-45 formatted with two decimal
places and the separators and decimal point commonly used in the United
States.
v A TOTAL line containing the specified string and the total for each of the two
zoned decimal fields formatted in the same way as the data values.
The second DISPLAY operator uses the sorted records in the TEMP data set to
print, in the FRANCE data set:
v A title line containing the specified title and the date in the format commonly used
in France
v A heading line containing the specified underlined headings
v Data lines containing:
The characters from positions 15-20
The zoned decimal values from positions 3-6 formatted with the separators
commonly used in France
The zoned decimal values from positions 38-45 formatted with two decimal
places and the separators and decimal point commonly used in France.
v A TOTAL line containing the specified string and the total for each of the two
zoned decimal fields formatted in the same way as the data values.
The third DISPLAY operator uses the sorted records in the TEMP data set to print,
in the DENMARK data set:
v A title line containing the specified title and the date in the format commonly used
in Denmark
v A heading line containing the specified underlined headings
v Data lines containing:
The characters from positions 15-20
The zoned decimal values from positions 3-6 formatted with the separators
commonly used in Denmark
The zoned decimal values from positions 38-45 formatted with two decimal
places and the separators and decimal point commonly used in Denmark.
v A TOTAL line containing the specified string and the total for each of the two
zoned decimal fields formatted in the same way as the data values.
The USA output starts on a new page and looks as follows (several records are
shown with illustrative values):
Parts Completion Report for USA 01/14/95
The title line and underlined heading line appear at the top of each page.
The FRANCE output starts on a new page and looks as follows (several record are
shown with illustrative values):
Parts Completion Report for France 14/01/1995
The title line and underlined heading line appear at the top of each page.
The DENMARK output starts on a new page and looks as follows (several records
are shown with illustrative values):
The title line and underlined heading line appear at the top of each page.
Example 8
SORT FROM(DATA) TO(TEMP) USING(SRTX)
DISPLAY FROM(TEMP) LIST(WEST) -
DATE TITLE(Western Region Profit/Loss Report) PAGE -
BTITLE(Division:) BREAK(3,10,CH) -
HEADER(Branch Office) ON(16,13,CH) -
HEADER(Profit/Loss (K)) ON(41,4,PD,/K,E1) -
BMINIMUM(Lowest Profit/Loss in this Division:) -
BMAXIMUM(Highest Profit/Loss in this Division:) -
BAVERAGE(Average Profit/Loss for this Division:) -
MINIMUM(Lowest Profit/Loss for all Divisions:) -
MAXIMUM(Highest Profit/Loss for all Divisions:) -
AVERAGE(Average Profit/Loss for all Divisions:)
The SORT operator sorts the DATA data set to the TEMP data set using the SORT
statement in SRTXCNTL.
The DISPLAY operator uses the sorted records in the TEMP data set to print, in the
WEST data set, sections with:
v A title line containing the date, the specified title string, and the page number
v A break title containing the specified break title string, and the break field
characters from positions 3-12
v A heading line containing the specified underlined headings
v Data lines containing:
The characters from positions 16-28
The packed decimal values from positions 41-44 divided by 1000 and
formatted with separators and signs as specified.
v Break MINIMUM, MAXIMUM, and AVERAGE lines containing the specified
strings and statistics for the packed decimal field values in this section, formatted
in the same way as the data values.
The first section of the WEST output starts on a new page and looks as follows
(several records are shown with illustrative values):
01/14/95 Western Region Profit/Loss Report - 1 -
Division: Chips
The title line, break title line, and underlined heading line appear at the top of each
page of the section.
The second section of the WEST output starts on a new page and looks as follows
(several records are shown with illustrative values):
01/14/95 Western Region Profit/Loss Report - 2 -
The title line, break title line, and underlined heading line appear at the top of each
page of the section.
The last page of the WEST output starts on a new page and looks as follows:
Example 9
MODE CONTINUE
VERIFY FROM(CHECK) ON(2,3,PD) LIMIT(500)
DISPLAY FROM(CHECK) LIST(PDREPORT) BLANK LIMIT(500) -
HEADER(Relative Record) ON(NUM) -
HEADER(Numeric) ON(2,3,PD) -
HEADER(Hexadecimal) ON(2,3,HEX) -
HEADER(Associated Field) ON(21,20,CH)
This example shows how each record containing an invalid decimal value can be
identified either by its relative record number or an associated field in the record.
The MODE operator ensures that the DISPLAY operator is processed if the VERIFY
operator identifies an invalid decimal value.
The VERIFY operator checks for invalid digits (A-F) and invalid signs (0-9) in the
packed decimal values from positions 2-4 of the CHECK data set. Message
ICE618A is printed in the TOOLMSG data set for each value (if any) that contains
an invalid digit or sign. If 500 invalid values are found, the operation is terminated.
The DISPLAY operator checks for invalid digits (A-F) in the packed decimal values
from positions 2-4 of the CHECK data set. Message ICE618A is printed in the
TOOLMSG data set for each value (if any) that contains an invalid digit. If 500
invalid values are found, the operation is terminated. If a check for invalid signs is
required, the VERIFY operator must be used, since the DISPLAY operator only
checks for invalid digits. The VERIFY operator is not required if signs need not be
checked.
Example 10
COPY FROM(IN) USING(OUTF)
DISPLAY FROM(TEMP) LIST(EMPCT) BLANK -
TITLE(Employees by Function) -
DATE -
HEADER(Function) HEADER(Employees) -
ON(1,25,CH) ON(30,4,ZD)
This example shows how the OUTFIL table lookup feature can be used to substitute
meaningful phrases for cryptic values in ICETOOL reports. Assume that:
v The OUTFCNTL data set contains:
Chapter 6. Using ICETOOL 437
DISPLAY Operator
OUTFIL FNAMES=TEMP,
OUTREC=(1:9,2,CHANGE=(25,
CMN,CManufacturing,
CRD,CResearch and Development,
CFN,CFinance,
CMR,CMarketing,
CIS,CInformation Systems),
30:4,4)
The COPY operator uses the OUTFIL statement in OUTFCNTL to reformat the IN
data set records to the TEMP (temporary) data set. Two fields are extracted for use
by the DISPLAY operator:
v The 2-character department code in positions 9-10 is changed to a 25-character
name in positions 1-25 using the table lookup feature.
v The zoned decimal value in positions 4-7 is moved to positions 30-33.
The DISPLAY operator uses the reformatted fields in the TEMP data set to print, in
the EMPCT data set:
v A title line containing the specified title and the date
v A heading line containing the specified underlined headings
v Data lines in the BLANK format containing:
The names from positions 1-25 that were substituted for the department
codes
The zoned decimal values from positions 30-33.
Function Employees
------------------------- ---------
Manufacturing 486
Marketing 21
Research and Development 55
Information Systems 123
Finance 33
Example 11
DISPLAY FROM(ACCTS) LIST(PLAIN) -
TITLE(Accounts Report for First Quarter) -
DATE(MD4/) BLANK -
HEADER(Amount) ON(12,6,ZD) -
HEADER(Id) ON(NUM) -
HEADER(Acct#) ON(31,3,PD) -
HEADER(Date) ON(1,4,ZD) -
TOTAL(Total for Q1) -
AVERAGE(Average for Q1)
This example shows some options you can use to improve the appearance of a
DISPLAY report. The first DISPLAY operator produces a plain report, and the
second DISPLAY operator uses the options shown in bold to produce a fancy
report.
Total for Q1
1493703 50328 1287
Average for Q1
248950 8388 214
Here is an explanation of the extra options used for the fancy report:
v First ON field: In the PLAIN report, BLANK causes ICETOOL to print the 6-byte
ZD values as unedited digits with leading zeros suppressed. But for this example,
we know the digits really represent dollars and cents. So in the FANCY report,
we use the C1 formatting item (one of thirty-three available masks) to print the
values with a comma (,) as the thousands separator and a period (.) as the
decimal point.
In the PLAIN report, TOTAL causes ICETOOL to allow 15 digits for the values
because it does not know how many digits are needed. But for this example, we
know the total amount will not exceed 8 digits. So in the FANCY report, we use
the N08 formatting item to set the number of digits to 8. This decreases the
column width for the field.
v Second ON field: In the PLAIN report, NUM causes ICETOOL to allow 15 digits
for the record number because it does not know how many digits are needed.
But for this example, we know the number of records will not exceed 99. So in
the FANCY report, we use the N02 formatting item to set the number of digits to
2. This decreases the column width for the record number.
v Third ON field: In the PLAIN report, TOTAL and AVERAGE cause ICETOOL to
print the total and average for this 3-byte PD field. But for this example, we know
we do not want statistics for the field because it is an account number. So in the
FANCY report, we use the NOST formatting item to suppress the statistics for
this field.
In the PLAIN report, the default mask of A0 causes ICETOOL to suppress
leading zeros for this 3-byte PD field. But for this example, we know that we want
to show leading zeros for the field because it is an account number. So in the
FANCY report, we use the LZ formatting item to print leading zeros for this field.
v Fourth ON field: In the PLAIN report, BLANK causes ICETOOL to print the 4-byte
ZD values as unedited digits with leading zeros suppressed. But for this example,
we know the digits represent a date (month and day). So in the FANCY report,
we use the E99/99 formatting item to print the values with leading zeros and a
slash (/) between the month and day.
In the PLAIN report, TOTAL and AVERAGE cause ICETOOL to print the total and
average for this 4-byte ZD field. But for this example, we know we do not want
the total or average for this field because it is a date. So in the FANCY report,
we use the NOST formatting item to suppress the statistics for this field.
Note: In some applications, we might want the minimum and maximum for a
date displayed with Epattern, so we would not specify NOST for the date
field.
v INDENT: In the PLAIN report, ICETOOL starts the report in column 2 (after the
control character), by default. But for this example, we want to indent the report a
bit. So in the FANCY report, we use the INDENT(2) operand to indent the report
by 2 blanks so it starts in column 4.
v BETWEEN: In the PLAIN report, ICETOOL uses 3 blanks between the columns
of data, by default. But for this example, we want more space between the
columns. So in the FANCY report, we use the BETWEEN(5) operand to insert 5
blanks between the columns.
v STATLEFT: In the PLAIN report, ICETOOL prints the strings for TOTAL and
AVERAGE under the first column of data, by default, and uses two lines for each
statistic to avoid having the string overlay the value. But for this example, we
would like to have the TOTAL and AVERAGE strings stand out in the report and
also have each string on the same line as its value. So in the FANCY report, we
use the STATLEFT operand to print the TOTAL and AVERAGE strings to the left
of the first column of data.
Example 12
SORT FROM(RAWSMF) TO(SMF14) USING(SMFI)
DISPLAY FROM(SMF14) LIST(SMF14RPT) -
TITLE(SMF Type-14 Records) DATE(4MD/) -
HEADER(Date) ON(11,4,DT1,E9999/99/99) -
HEADER(Time) ON(7,4,TM1,E99:99:99) -
HEADER(Sys) ON(15,4,CH) -
HEADER(Jobname) ON(19,8,CH) -
HEADER(Datasetname) ON(69,44,CH)
This example shows how SMF date and time values can be displayed in a
meaningful way in a report on SMF type-14 records.
The SORT operator selects the type-14 records from the RAWSMF data set and
sorts them by date and time to the SMF14 data set. It uses the following control
statements in SMFICNTL:
INCLUDE COND=(6,1,BI,EQ,14)
SORT FIELDS=(11,4,PD,A,7,4,BI,A)
The DISPLAY operator uses the selected type-14 records in SMF14 to print, in the
SMF14RPT data set:
v A title line containing the specified title and the date
v A heading line containing the specified underlined headings
v Data lines containing:
The SMF date values in positions 11-14 displayed as C'yyyy/mm/dd'
The SMF time values in positions 7-10 displayed as C'hh:mm:ss'
The character values in positions 15-18
The character values in positions 19-26
The character values in positions 69-112
Note: When you use SMF date formats (DTn) or SMF time formats (TMn), the
SMF values are treated as numeric. This allows you to use numeric
formatting items such as masks and patterns to edit the SMF values. By
default, DTn and TMn headings, like other numeric headings, appear
right-aligned as shown in the SMF14RPT output example above. If you want
to center-align or left-align headings for numeric values, you can add an
appropriate number of blanks at the end of HEADER('string').
For example, if you wanted to left-align the SMF date heading, you could
use six blanks at the end of the header string like so:
HEADER(Date )
If you wanted to center-align the SMF date heading, you could use three
blanks at the end of the header string like so:
HEADER(Date )
MODE Operator
MODE STOP
CONTINUE
SCAN
Specifies one of three modes to control error checking and actions after error
detection. A MODE operator effects the processing (that is, error checking of
ICETOOL statements and calling DFSORT) of the operators which follow it, up to
the next MODE operator (if any). MODE operators allow you to do the following for
groups of operators or all operators:
1. Stop or continue processing operators after a return code of 12 or 16. A return
code of 12 or 16 can be set as the result of a statement or run-time error
detected by ICETOOL or DFSORT.
2. Check for errors in ICETOOL statements, but do not call DFSORT.
Operand Descriptions
The operands described below can be specified in any order.
STOP
Stops subsequent operations if a return code of 12 or 16 is set. If an error is
detected for an operator, SCAN mode is automatically set in effect; DFSORT is
not called for subsequent operators, although checking ICETOOL statements for
errors continues.
STOP mode can be used to group dependent operators (that is, if an operation
fails, do not process the remaining operators).
STOP MODE is set in effect automatically at the start of the ICETOOL run.
CONTINUE
Continues with subsequent operations regardless of whether or not a return
code of 12 or 16 is set. If an operator results in an error, processing continues
for subsequent operators.
CONTINUE mode can be used to group independent operators (that is, process
each operator regardless of the success or failure of the others).
SCAN
ICETOOL statements are checked for errors, but DFSORT is not called.
SCAN mode can be used to test ICETOOL statements for errors.
MODE Example
MODE SCAN
RANGE ...
UNIQUE ...
MODE STOP
VERIFY ...
DISPLAY ...
MODE CONTINUE
COPY ...
SORT ...
STATS ...
SCAN mode: RANGE and UNIQUE are checked for statement errors, but DFSORT
is not called.
STOP mode: DISPLAY is dependent on VERIFY. If the return code for VERIFY is
12 or 16, SCAN mode is entered; DISPLAY is checked for statement errors, but
DFSORT is not called.
CONTINUE mode: COPY, SORT, and STATS are independent of each other. SORT
is processed even if the return code for COPY is 12 or 16. STATS is processed
even if the return code for COPY or SORT is 12 or 16.
Note that the return codes for one group of operators does not affect the other
groups of operators.
OCCUR Operator
TITLE(string) PAGE DATE TIME BLANK
DATE(abcd) TIME(abc) PLUS
DATENS(abc) TIMENS(ab)
E
HEADER(string) LINES(n) INDENT(n) BETWEEN(n)
HEADER(NONE)
NOHEADER
ALLDUPS VSAMTYPE(x) WIDTH(n) UZERO LISTSDB
NODUPS LISTNOSDB
HIGHER(x)
LOWER(y)
EQUAL(v)
Prints each unique value for specified numeric fields (including SMF date/time) or
character fields, and how many times it occurs, in a separate list data set. Simple or
tailored reports can be produced. The values printed can be limited to those for
which the value count meets specified criteria.
From 1 to 10 fields can be specified, but the resulting list data set line length must
not exceed the limit specified by the WIDTH operand or 2048 bytes if WIDTH is not
specified. At least one ON(VLEN) or ON(p,m,f) field must be specified; all such ON
fields specified are used to determine whether a record contains a unique value. A
single list data set record is printed for each unique value. If ON(VALCNT) is
specified, the value count (that is, the number of times the ON values occur) is
printed in the list data set record along with the other ON values.
DFSORT is called to sort the indd data set to ICETOOLs E35 user exit. ICETOOL
uses its E35 exit to print appropriate titles, headings and data in the list data set.
You must not supply your own DFSORT MODS, INREC, OUTREC, SUM, or
RECORD statement since they override the DFSORT statements passed by
ICETOOL for this operator.
| OPTION DYNALLOC=(,8)
| Attention: Either of these actions affects the work data sets used for a UNIQUE
operator, or for a SELECT or SPLICE operator for which USING(xxxx) is not
specified.
Simple Report
You can produce a simple report by specifying just the required operands. For
example, if you specify FROM and LIST operands, and ON operands for 10-byte
character and 7-byte zoned decimal fields and the value count, the output in the list
data set can be represented as follows:
(p,m,f) (p,m,f) VALUE COUNT
characters sddddddddddddddd ddddddddddddddd
. . .
. . .
. . .
A control character occupies the first byte of each list data set record. Left-justified
standard headings are printed at the top of each page to indicate the contents of
each column, followed by a line for each record showing the characters and
numbers in the fields of that record, and the count of occurrences (value count) of
the specified values.
The fields are printed in columns in the same order in which they are specified in
the OCCUR statement. All fields are left-justified. For numeric fields, leading zeros
are printed, a is used for the minus sign, and a + is used for the plus sign. For
the value count, leading zeros are printed.
By default, the first column of data starts immediately after the control character,
and three blanks appear between columns. The INDENT operand can be used to
change the number of blanks before the first column of data. The BETWEEN
operand can be used to change the number of blanks between columns.
The NOHEADER operand can be used to create list data sets containing only data
records. Data sets created in this way can be processed further by other operators
(for example, STATS or UNIQUE) using CH format for character values or CSF/FS
format for numeric values (including the value count).
Tailored Report
You can tailor the output in the list data set using various operands that control title,
date, time, page number, headings, lines per page and field formats. The optional
operands can be used in many different combinations to produce a wide variety of
report formats. For example, if you specify FROM, LIST, BLANK, TITLE, PAGE,
DATE, TIME, and HEADER operands, and ON operands for 10-byte character and
7-byte zoned decimal fields and the value count, the output in the list data set looks
as follows:
title - p - mm/dd/yy hh:mm:ss
A control character occupies the first byte of each list data set record. The title line
is printed at the top of each page of the list data set. It contains the elements you
specify (title string, page number, date and time) in the order in which you specify
them. Eight blanks appear between title elements. A blank line is printed after the
title line.
Your specified headings (underlined) are printed after the title line on each page to
indicate the contents of each column, followed by a line for each record showing
the characters and numbers in the fields of that record. Headings for character
fields are left-justified and headings for numeric fields are right-justified.
The fields are printed in columns in the same order in which they are specified in
the OCCUR statement. Character fields are left-justified and numeric fields are right
justified. For numeric fields, leading zeros are suppressed, a - is used for the minus
sign, and a blank is used for the plus sign (you can specify PLUS rather than
BLANK if you want a + to be used for the plus sign). For the value count, leading
zeros are suppressed.
Formatting items can be used to change the appearance of individual numeric fields
in the report with respect to separators, number of digits, decimal point, decimal
places, signs, leading zeros, leading strings, floating strings, and trailing strings.
Formatting items can also be used to insert leading or trailing strings for character
fields.
The column widths are dynamically adjusted according to the length of the headings
and the maximum number of bytes needed for the character or numeric data.
Operand Descriptions
The operands described below can be specified in any order.
FROM(indd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
ON(p,m,f)
Specifies the position, length, and format of the numeric field to be used for this
operation.
p specifies the first byte of the field relative to the beginning of the input record.
p is 1 for the first data byte of a fixed-length record and 5 for the first data byte
of a variable-length record as illustrated below (RRRR represents the 4-byte
record descriptor word):
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. The maximum length for a field
depends on its format.
The fields of records that do not meet the specified criteria are not checked for
invalid digits (PD and ZD) or excessive digits (CSF and FS).
E mask
E'pattern'
L'string'
F'string'
T'string'
LZ
Ndd
specifies formatting items that indicate how the data for this field is to be
formatted for printing. Formatting items can be specified in any order, but each
item can only be specified once. Any formatting item can be specified for a
numeric field, but only Lstring and Tstring can be specified for a character
field.
formatting
E mask
E'pattern'
L'string'
F'string'
T'string'
LZ
Ndd
specifies formatting items that indicate how the data for this field is to be
formatted for printing. Formatting items can be specified in any order, but each
item can only be specified once.
E mask
E'pattern'
L'string'
F'string'
T'string'
LZ
Ndd
specifies formatting items that indicate how the value count is to be formatted
for printing. Formatting items can be specified in any order, but each item can
only be specified once.
TITLE(string)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
PAGE
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
DATE
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
DATE(abcd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
DATENS(abc)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
TIME
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
TIME(abc)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
TIMENS(ab)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
BLANK
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
PLUS
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
For ON(VALCNT), PLUS is treated as BLANK.
HEADER(string)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
HEADER(NONE)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
NOHEADER
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
LINES(n)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
INDENT(n)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
BETWEEN(n)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
ALLDUPS
Limits the ON values printed to those that occur more than once (that is, those
with duplicate field values). The ON values are printed when value count > 1.
ALLDUPS is equivalent to HIGHER(1).
NODUPS
Limits the ON values printed to those that occur only once (that is, those with
no duplicate field values). The ON values are printed when value count = 1.
NODUPS is equivalent to EQUAL(1) or LOWER(2).
HIGHER(x)
Limits the ON values printed to those that occur more than x times. The ON
values are printed when value count > x.
x must be specified as n or +n where n can be 1 to 15 decimal digits.
LOWER(y)
Limits the ON values printed to those that occur less than y times. The ON
values are printed when value count < y.
y must be specified as n or +n where n can be 1 to 15 decimal digits.
EQUAL(v)
Limits the ON values printed to those that occur v times. The ON values are
printed when value count = v.
v must be specified as n or +n where n can be 1 to 15 decimal digits.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY Operator
on page 393.
WIDTH(n)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
UZERO
Specifies that 0 and +0 are to be treated as unsigned zero values, that is, as
the same value. With UZERO, 0 and +0 are treated as positive for ON
processing.
UZERO overrides the default of treating 0 and +0 as signed zero values, that
is, as different values. Without UZERO, 0 is treated as negative and +0 is
treated as positive for ON processing.
| LISTSDB or LISTNOSDB
| See the discussion of these operands on the DISPLAY statement in DISPLAY
| Operator on page 404.
OCCUR Examples
Although the OCCUR operators in the examples below could all be contained in a
single ICETOOL job step, they are shown and discussed separately for clarity. See
DISPLAY Operator on page 404 for additional examples of tailoring the report
format.
Example 1
OCCUR FROM(SOURCE) LIST(VOLSERS) ON(40,6,CH) ON(VALCNT)
The VOLSERS output starts on a new page and looks as follows (the first 2 records
are shown with illustrative values):
(40,6,CH) VALUE COUNT
ABC001 000000000000025
ABC002 000000000000011
. .
. .
. .
Example 2
OCCUR FROM(IN) LIST(LIST1) -
TITLE( 3090 Distribution ) -
PAGE -
HEADER(Data Centers) ON(VALCNT) -
HEADER(State) ON(1,16,CH) -
HEADER(3090s) ON(25,3,PD) -
BLANK
The LIST1 output starts on a new page and looks as follows (the first 2 records are
shown with illustrative values):
3090 Distribution - 1 -
The title line and underlined heading line appear at the top of each page.
Example 3
OCCURS FROM(FAILURES) LIST(CHECKIT) -
DATE TITLE(Possible System Intruders) PAGE -
HEADER( Userid ) HEADER( Logon Failures ) -
ON(23,8,CH) ON(VALCNT) -
HIGHER(4) -
BLANK
The CHECKIT output starts on a new page and looks as follows (the first 2 records
are shown with illustrative values):
10/21/92 Possible System Intruders - 1 -
The title line and underlined heading line appear at the top of each page.
Example 4
OCCUR FROM(VARIN) LIST(ONCE) -
TITLE(Record lengths that occur only once) -
TIME(12:) DATE(DMY.) -
ON(VLEN) NODUPS BLANK
The ONCE output starts on a new page and looks as follows (the first 2 records are
shown with illustrative values):
RECORD LENGTH
57
61
.
.
.
The title line and heading line appear at the top of each page.
Example 5
OCCUR FROM(BRANCH) LIST(CALLRPT)-
DATENS(4MD)-
TITLE(Yearly Branch Phone Call Counts)-
HEADER(Phone Number) ON(7,10,ZD,E(999)-999-9999)-
HEADER(Calls) ON(VALCNT,A1,N05)-
INDENT(5) BETWEEN(10)
The report is indented by five blanks as specified by the INDENT(5) operand, and
ten blanks appear between the columns as specified by the BETWEEN(10)
operand.
RANGE Operator
Prints a message containing the count of values in a specified range for a specific
numeric field.
DFSORT is called to copy the indd data set to ICETOOLs E35 user exit. ICETOOL
prints a message containing the range count as determined by its E35 user exit.
The range can be specified as higher than x, lower than y, higher than x and lower
than y, equal to v, or not equal to w, where x, y, v, and w are signed or unsigned
decimal values. If the range is specified as higher than x and lower than y, it must
be a valid range (for example, higher than 5 and lower than 6 is not a valid range
since there is no integer value that satisfies the criteria).
You must not supply your own DFSORT MODS, INREC, or OUTREC statement
since they would override the DFSORT statements passed by ICETOOL for this
operator.
Operand Descriptions
The operands described below can be specified in any order.
FROM(indd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
ON(p,m,f)
Specifies the position, length, and format of the numeric field to be used for this
operation.
p specifies the first byte of the field relative to the beginning of the input record.
p is 1 for the first data byte of a fixed-length record and 5 for the first data byte
of a variable-length record as illustrated below (RRRR represents the 4-byte
record descriptor word):
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. The maximum length for a field
depends on its format.
v If a decimal value contains an invalid digit (A-F), ICETOOL identifies the bad
value in a message and terminates the operation.
v A value is treated as positive if its sign is F, E, C, A, 8, 6, 4, 2, or 0.
v A value is treated as negative if its sign is D, B, 9, 7, 5, 3, or 1.
RANGE Example
RANGE FROM(DATA1) ON(VLEN) HIGHER(10)
RANGE FROM(DATA2) ON(11,6,ZD) LOWER(+3000)
RANGE FROM(DATA3) ON(29001,4,FI) -
HIGHER(-10000) LOWER(27)
RANGE FROM(DATA2) ON(25,3,PD) EQUAL(-999)
RANGE FROM(DATA3) ON(40,1,BI) NOTEQUAL(199)
The first RANGE operator prints a message containing the count of binary values
from positions 1-2 of the DATA1 data set that are higher than 10.
The second RANGE operator prints a message containing the count of zoned
decimal values from positions 11-16 of the DATA2 data set that are lower than
3000.
The third RANGE operator prints a message containing the count of fixed-point
values from positions 29 001-29 004 of the DATA3 data set that are higher than -10
000 but lower than 27.
The fourth RANGE operator prints a message containing the count of packed
decimal values from positions 25-27 of the DATA2 data set that are equal to -999.
The fifth RANGE operator prints a message containing the count of binary values
from position 40 of the DATA3 data set that are not equal to 199. This RANGE
operator could be used to count the number of records that do not have G in
position 40, since 199 (XC7) is the EBCDIC code for G. Alternatively, the COUNT
operator could be used with OMIT COND=(40,1,CH,EQ,CG).
SELECT Operator
ALLDUPS
NODUPS VSAMTYPE(x) UZERO USING(xxxx)
HIGHER(x)
LOWER(y)
EQUAL(v)
FIRST
LAST
FIRSTDUP
LASTDUP
Selects records from an input data set based on meeting criteria for the number of
times specified numeric or character field values occur. This makes it possible to
only keep records with duplicate field values, only keep records with no duplicate
field values, only keep records with field values that occur more than, less than, or
exactly n times, or only keep the first or last record with each unique or duplicate
field value. From 1 to 10 fields can be specified. At least one ON(VLEN) or
ON(p,m,f) field must be specified; all such ON fields specified will be used to
determine the value count (that is, the number of times the ON values occur) to
be matched against the criteria.
DISCARD(savedd) can be used to save the records which do not meet the criteria
(that is, the discarded records), in the savedd data set. DISCARD(savedd) can be
used with or without TO(outdd).
| DFSORT is called to sort the indd data set. ICETOOL uses its E35 exit to determine
| which records to include in the outdd data set or savedd data set. ICETOOL passes
| the EQUALS option to DFSORT to ensure that duplicates are kept in their original
| input order.
ICETOOL requires extra storage for SELECT processing, over and above what is
normally needed by ICETOOL and DFSORT, in order to save your records until it
can determine whether or not they meet your specified criteria. In most cases, only
a small amount of storage is needed and can be obtained (above 16MB virtual).
However, for a FROM data set with a large record length and criteria requiring
many saved records, a large amount of storage is needed. For example, with a
record length of 32756 and HIGHER(99), over 3 MBs of storage is needed. If
ICETOOL cannot get the storage it needs, it issues a message and terminates the
SELECT operation. Increasing the REGION by the amount indicated in the
message may allow ICETOOL to run successfully.
| OPTION DYNALLOC=(,8)
Operand Descriptions
The operands described below can be specified in any order.
FROM(indd)
See the discussion of this operand on the COPY statement in COPY Operator
on page 393.
TO(outdd)
Specifies the ddname of the output data set to which DFSORT will write the
records it selects for the operation (that is, the records that meet the specified
criteria). Thus, the outdd data set will contain the records selected by
ALLDUPS, NODUPS, HIGHER(x), LOWER(y), EQUAL(v), FIRST, LAST,
FIRSTDUP or LASTDUP.
An outdd DD statement must be present and must define an output data set
that conforms to the rules for DFSORTs SORTOUT data set (if the DISCARD
operand is not specified) or OUTFIL data set (if the DISCARD operand is
specified).
TO and DISCARD can both be specified. If DISCARD is not specified, TO must
be specified. If TO is not specified, DISCARD must be specified.
The ddname specified in the TO operand must not be the same as the ddname
specified in the FROM or DISCARD operand.
Refer to JCL Restrictions on page 392 for more information.
DISCARD(savedd)
Specifies the ddname of the output data set to which DFSORT will write the
records it does not select for this operation (that is, the records that do not meet
the specified criteria). Thus, the savedd data set will contain the records
discarded by ALLDUPS, NODUPS, HIGHER(x), LOWER(y), EQUAL(v), FIRST,
LAST, FIRSTDUP or LASTDUP.
A savedd DD statement must be present and must define an output data set
that conforms to the rules for DFSORTs OUTFIL data set.
TO and DISCARD can both be specified. If DISCARD is not specified, TO must
be specified. If TO is not specified, DISCARD must be specified.
The ddname specified in the DISCARD operand must not be the same as the
ddname specified in the FROM or TO operand.
Refer to JCL Restrictions on page 392 for more information.
ON(p,m,f)
Specifies the position, length, and format of a numeric or character field to be
used for this operation.
p specifies the first byte of the field relative to the beginning of the input record.
p is 1 for the first data byte of a fixed-length record and 5 for the first data byte
of a variable-length record as illustrated below (RRRR represents the 4-byte
record descriptor word):
m specifies the length of the field in bytes. A field must not extend beyond
position 32752, or beyond the end of a record. The maximum length for a field
depends on its format.
LOWER(y)
Limits the records selected to those with ON values that occur less than y times
(value count < y). You can use this operand to keep just those records with field
values that occur less than y times.
y must be specified as n or +n where n can be 0 to 99.
EQUAL(v)
Limits the records selected to those with ON values that occur v times (value
count = v). You can use this operand to keep just those records with field
values that occur v times.
v must be specified as n or +n where n can be 0 to 99.
FIRST
Limits the records selected to those with ON values that occur only once (value
count = 1) and the first record of those with ON values that occur more than
once (value count > 1). You can use this operand to keep just the first record
for each unique field value.
LAST
Limits the records selected to those with ON values that occur only once (value
count = 1) and the last record of those with ON values that occur more than
once (value count > 1). You can use this operand to keep just the last record
for each unique field value.
FIRSTDUP
Limits the records selected to the first record of those with ON values that occur
more than once (value count > 1). You can use this operand to keep just the
first record of those records with duplicate field values.
LASTDUP
Limits the records selected to the last record of those with ON values that occur
more than once (value count > 1). You can use this operand to keep just the
last record of those records with duplicate field values.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY Operator
on page 393.
UZERO
See the discussion of this operand on the OCCUR statement in OCCUR
Operator on page 443.
| USING(xxxx)
| Specifies the first 4 characters of the ddname for the control statement data set
| to be used by DFSORT for this operation. xxxx must be four characters which
| are valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
| If USING is specified, an xxxxCNTL DD statement must be present and the
| control statements in it:
| 1. Must conform to the rules for DFSORTs SORTCNTL data set.
| 2. Should generally be used only for an INCLUDE or OMIT statement,
| comment statements, or appropriate OUTFIL statements as described for
| SELECT Operator on page 458.
SELECT Examples
Although the SELECT operators in the examples below could all be contained in a
single ICETOOL job step, they are shown and discussed separately for clarity.
Example 1
SELECT FROM(INPUT) TO(DUPS) ON(11,8,CH) ON(30,44,CH) ALLDUPS
Sorts the INPUT data set to the DUPS data set, selecting only the records from
INPUT with characters in positions 11-18 and characters in positions 30-73 that
occur more than once (that is, only records with duplicate ON field values).
The DUPS data set might look as follows (several records are shown for illustrative
purposes):
USR002 EISSLER 12 DOC.EXAMPLES
DFSRT2 EISSLER 5 DOC.EXAMPLES
DFSRT5 MADRID 20 MYDATA
DFSRT1 MADRID 20 MYDATA
SYS003 MADRID 20 MYDATA
DFSRT2 MADRID 20 SORTST1.TEST
USR003 MADRID 20 SORTST1.TEST
. . . .
. . . .
. . . .
Example 2
SELECT FROM(INPUT) TO(ONLYONE) ON(23,3,FS) NODUPS
Sorts the INPUT data set to the ONLYONE data set, selecting only the records from
INPUT with floating sign values in positions 23-25 that occur just once (that is, only
records with no duplicate ON field values).
The ONLYONE data set might look as follows (several records are shown for
illustrative purposes):
DFSRT2 EISSLER 5 DOC.EXAMPLES
DFSRT1 PACKER 8 ICETOOL.SMF.RUNS
USR002 EISSLER 12 DOC.EXAMPLES
SYS003 YAEGER 32 ICETOOL.TEST.CASES
DFSRT2 MCNEILL 108 FS.TEST.CASES
. . . .
. . . .
. . . .
Example 3
SELECT FROM(FAILURES) TO(CHECKOUT) ON(28,8,CH) ON(1,5,CH) -
HIGHER(3)
Sorts the FAILURES data set to the CHECKOUT data set, selecting only the
records from FAILURES with characters in positions 28-35 and characters in
positions 1-5 that occur more than three times (that is only records with four or
more duplicate ON field values).
The CHECKOUT data set might look as follows (several records are shown for
illustrative purposes):
03/12/91 08:36:59 A3275647
03/12/91 09:27:32 A3275647
03/12/91 09:03:18 A3275647
03/12/91 08:56:13 A3275647
03/06/91 15:12:01 C3275647
Example 4
SELECT FROM(BOOKS) TO(PUBLISHR) ON(29,10,CH) FIRST
Sorts the BOOKS data set to the PUBLISHR data set, selecting only the records
from BOOKS with characters in positions 29-38 that occur only once and the first
record of those with characters in positions 29-38 that occur more than once (that
is, one record for each unique ON field value).
The PUBLISHR data set might look as follows (several records are shown for
illustrative purposes):
Banana Slugs I Have Known Brent Animals
Toads on Parade Cooper Animals
Pets Around the World Davis Animals
. . .
. . .
. . .
Example 5
SELECT FROM(BOOKS) TO(PUBLISHR) ON(29,10,CH) FIRST -
DISCARD(SAVEREST)
This example creates the same PUBLISHR data set as Example 4. In addition, it
creates a SAVEREST data set which contains all of the records not written to the
PUBLISHR data set. The SAVEREST data set might look as follows (several
records are shown for illustrative purposes):
How to Talk to Your Amoeba Brent Animals
What Buzzards Want Davis Animals
Birds of Costa Rica Davis Animals
.
.
.
Example 6
SELECT FROM(MASTPULL) TO(MATCH) ON(5,8,CH) FIRSTDUP
This example shows how you can use a list of account numbers in a pull data set
to only select records with those account numbers from a master data set. The
MASTPULL DD would have the master data set and pull data set concatenated
together (in that order).
The SELECT operator sorts the concatenated data sets and selects only the first
record of those with characters in positions 5-12 that occur more than once (that is,
one record for each duplicate ON field value). Since the master data set is first in
the concatenation, the selected records will come from the master data set.
Note: This example assumes that there are not any duplicate account numbers in
either the master or pull data sets. If that is not true, you can use
SELECT with FIRST or LAST, for the appropriate data set, to make it true.
For example, if your master data set has duplicate account numbers and
you want to select the first account number from the master data set for
each account number in the pull data set, you could use the following
statements:
SELECT FROM(MASTER) TO(TEMP) ON(5,8,CH) FIRST
SELECT FROM(TEMPPULL) TO(MATCH) ON(5,8,CH) FIRSTDUP
The TEMPPULL DD would have the temporary data set and pull data set
concatenated together (in that order).
| Example 7
|
| SELECT FROM(INPUT) TO(ONLYONE) ON(23,3,FS) NODUPS USING(CTL1)
|
| This example shows how you can use USING(xxxx) to supply an OUTFIL statement
| to modify the TO data set. SELECT chooses the same output records as for
| Example 2 on page 463, but an OUTFIL statement is used to further modify those
| records for output to the ONLYONE data set.
SORT Operator
TO( E outdd )
LOCALE(name) SERIAL
LOCALE(CURRENT)
LOCALE(NONE)
DFSORT is called to sort the indd data set to the outdd data sets using the
DFSORT control statements in xxxxCNTL. You must supply a DFSORT SORT
statement in the xxxxCNTL data set to indicate the control fields for the sort. You
can use additional DFSORT statements in the xxxxCNTL data set to sort a subset
of the input records (INCLUDE or OMIT statement; SKIPREC and STOPAFT
| options; OUTFIL INCLUDE, OMIT, SAVE, STARTREC, ENDREC, SAMPLE, SPLIT,
| and SPLITBY operands; user exit routines), reformat records for output (INREC and
OUTREC statements, OUTFIL OUTREC operand, user exit routines), and so on.
The active locales collating rules affect SORT processing as explained in SORT
Control Statement on page 298. If an INCLUDE or OMIT statement or an OUTFIL
INCLUDE or OMIT operand is specified in the xxxxCNTL data set, the active
locales collating rules affect INCLUDE and OMIT processing as explained in the
Cultural Environment Considerations discussion in INCLUDE Control Statement
on page 96.
| OPTION DYNALLOC=(,8)
Operand Descriptions
The operands described below can be specified in any order.
FROM(indd)
See the discussion of this operand on the COPY statement in COPY Operator
on page 393.
USING(xxxx)
Specifies the first 4 characters of the ddname for the control statement data set
to be used by DFSORT for this operation. xxxx must be four characters which
are valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
must be able to read the first outdd data set after it is written in order to copy it
to the other outdd data sets. Do not use a SYSOUT or DUMMY data set as the
first in a list of outdd data sets because:
v If the first data set is SYSOUT, DFSORT abends when it tries to copy the
SYSOUT data set to the second outdd data set.
v If the first data set is DUMMY, DFSORT copies the empty DUMMY data set
to the other outdd data sets (that is, all of the resulting outdd data sets are
empty).
SORT Examples
Although the SORT operators in the examples below could all be contained in a
single ICETOOL job step, they are shown and discussed separately for clarity.
Example 1
* Method 1
SORT FROM(MASTER) TO(PRINT,TAPE,DISK) USING(ABCD)
* Method 2
SORT FROM(MASTER) TO(DISK,TAPE,PRINT) USING(ABCD) SERIAL
This example shows two different methods for creating multiple sorted output data
sets. Assume that the ABCDCNTL data set contains:
SORT FIELDS=(15,20,CH,A,1,5,PD,D)
Method 1 requires one call to DFSORT, one pass over the input data set, and
allows the output data sets to be specified in any order. The SORT operator sorts
all records from the MASTER data set to the PRINT (SYSOUT), TAPE, and DISK
data sets, using the SORT statement in the ABCDCNTL data set and OUTFIL
processing.
Method 2 requires three calls to DFSORT, three passes over the input data set, and
imposes the restriction that the SYSOUT data set must not be the first TO data set.
The SORT operator sorts all records from the MASTER data set to the DISK data
set, using the SORT statement in the ABCDCNTL data set, and then copies the
resulting DISK data set to the TAPE and PRINT (SYSOUT) data sets. Since the first
TO data set is processed three times (written, read, read), placing the DISK data
set first is more efficient than placing the TAPE data set first. PRINT must not be
the first in the TO list because a SYSOUT data set cannot be read.
Example 2
* Method 1
SORT FROM(IN) TO(DEPT1) USING(DPT1)
SORT FROM(IN) TO(DEPT2) USING(DPT2)
SORT FROM(IN) TO(DEPT3) USING(DPT3)
* Method 2
SORT FROM(IN) USING(ALL3)
This example shows two different methods for creating sorted subsets of an input
data set. Assume that:
Method 1 requires three calls to DFSORT and three passes over the input data set:
v The first SORT operator sorts the records from the IN data set that contain D01
in positions 5-7 to the DEPT1 data set
v The second COPY operator sorts the records from the IN data set that contain
D02 in positions 5-7 to the DEPT2 data set
v The third COPY operator sorts the records from the IN data set that contain D03
in positions 5-7 to the DEPT3 data set.
Method 2 accomplishes the same result as method 1 but, because it uses OUTFIL
statements instead of TO operands, requires only one call to DFSORT and one
pass over the input data set.
Example 3
SORT FROM(IN1) TO(FRANCE) USING(SRT1) LOCALE(FR_FR)
SORT FROM(IN1) TO(CANADA) USING(SRT1) LOCALE(FR_CA)
SORT FROM(IN1) TO(BELGIUM) USING(SRT1) LOCALE(FR_BE)
This example shows how sorted data for three different countries can be produced.
Assume that the SRT1CNTL data set contains:
SORT FIELDS=(5,20,CH,A,31,15,CH,A,1,4,FI,D,63,10,CH,D)
The first SORT operator sorts all records from the IN1 data set to the FRANCE data
set, using the SORT statement in the SRT1CNTL data set. The character (CH)
control fields are sorted according to the collating rules defined in locale FR_FR
(French language for France).
The second SORT operator sorts all records from the IN1 data set to the CANADA
data set, using the SORT statement in the SRT1CNTL data set. The character (CH)
control fields are sorted according to the collating rules defined in locale FR_CA
(French language for Canada).
The third SORT operator sorts all records from the IN1 data set to the BELGIUM
data set, using the SORT statement in the SRT1CNTL data set. The character (CH)
control fields are sorted according to the collating rules defined in locale FR_BE
(French language for Belgium).
| SPLICE Operator
KEEPNODUPS USING(xxxx) VSAMTYPE(x) UZERO
| Splices together specified fields from records with matching numeric or character
| field values (that is, duplicate values), but different information. This makes it
| possible to join fields from different types of input records to create an output record
| with information from two or more records.
| Typically, you will want to reformat the records from two or more data sets to
| temporary data sets, and concatenate those temporary data sets together as input
| to the SPLICE operator.
| SPLICE Examples on page 474 shows some techniques for splicing records from
| different data sets together in a variety of ways to perform various file join and
| match operations.
| By default (when WITHALL and WITHEACH are not specified), one spliced record
| is created for each set of duplicates. The first duplicate is spliced with specified
| fields from the last duplicate.
| The first duplicate is treated as a base record. The last duplicate is treated as an
| overlay record. Specified fields from the overlay record are overlaid on to the
| base record. Thus, the output record consists of fields from the base (first) record
| intermixed with specified fields from the overlay (last) record.
| The records to be spliced can originate from two different input data sets.
| From 1 to 10 ON fields can be used for the fields to match on. At least one
| ON(p,m,f) field must be specified; all such ON fields specified will be used to
| determine the matching records to be spliced together.
| From 1 to 50 WITH fields can be used to specify the fields to be overlaid on the
| base record from the overlay record. At least one WITH(p,m) field must be
| specified; all such WITH fields specified will be overlaid on to the base record. All
| other fields in the base record will be kept unchanged.
| To illustrate the splicing process, if we had the following two input records with the
| base fields, ON field and WITH fields as shown:
| BASE1 ON1 BASE2 BASE3 BASE4 GGGGG
| ON1 WITHA WITHB
| WITHEACH can be used to create one spliced record for each set of duplicates.
| The first duplicate is spliced with one specified field from each subsequent
| duplicate.
| The first duplicate is treated as a base record. Each subsequent duplicate is treated
| as an overlay record. The specified field from each overlay record is overlaid on to
| the base record. Thus, the output record consists of fields from the base record
| intermixed with a specified field from each overlay record. Note that the specified
| field from an overlay record can actually consist of multiple fields from the record
| that have previously been reformatted into one contiguous field.
| The records to be spliced can originate from multiple input data sets
| WITHALL can be used to create multiple spliced records for each set of duplicates.
| The first duplicate is spliced with the specified fields from the second duplicate.
| Then the first duplicate is spliced with the specified fields from the third duplicate,
| and so on.
| The first duplicate is treated as a base record. Each subsequent duplicate is treated
| as an overlay record. The specified fields from each overlay record are overlaid on
| to the base record. Thus, the output records consist of fields from the base record
| intermixed with specified fields from the overlay records.
| The records to be spliced can originate from multiple input data sets.
| To illustrate the splicing process when WITHALL is specified, if we had the following
| four records with the base fields, ON field and WITH fields as shown:
| BASE1 ON1 BASE2 BASE3 BASE4 GGGGG
| ON1 WITHA WITHB
| ON1 WITHC
| ON1 WITHE WITHF
| Note that without WITHALL, the resulting single spliced output record would be:
| BASE1 ON1 BASE2 WITHE BASE3 BASE4 WITHF
| DFSORT is called to sort the indd data set. ICETOOL uses its E35 exit to determine
| which records to splice and include in the outdd data set. ICETOOL passes the
| EQUALS option to DFSORT to ensure that duplicates are kept in their original input
| order.
| For example, with TO(OUT1) you could further modify the OUT1 records after
| they have been spliced, with a statement like this:
| OUTFIL FNAMES=OUT1,FTOV,VLTRIM=X40
| Operand Descriptions
| FROM(indd)
| See the discussion of this operand on the COPY statement in COPY Operator
| on page 393.
| TO(outdd)
| Specifies the ddname of the output data set to which DFSORT will write the
| records it produces for the operation (that is, the spliced records, and the
| non-duplicate records if KEEPNODUPS is specified).
| An outdd DD statement must be present and must define an output data set
| that conforms to the rules for DFSORTs SORTOUT data set.
| The ddname specified in the TO operand must not be the same as the ddname
| specified in the FROM operand.
| m specifies the length of the field in bytes. A field must not extend beyond
| position 32752.
| A WITH field will not be used to overlay the RDW of a variable-length base
| record, to overlay bytes beyond the end of a base record, or to overlay bytes
| from beyond the end of an overlay record on to a base record. When
| necessary, WITH fields will be adjusted to prevent these situations. For
| example, if WITH(1,6) is specified for a variable-length record, it will be treated
| as WITH(5,2) and if WITH(75,10) is specified for an 80-byte base record or
| overlay record, it will be treated as WITH(75,6).
| WITHEACH
| Specifies that the first duplicate is spliced with one specified field from each
| subsequent duplicate. One WITH field from each overlay record is overlaid on
| to the base record. The first WITH field specifies the bytes to be overlaid from
| the second duplicate record on to the first duplicate record. The second WITH
| field specifies the bytes to be overlaid from the third duplicate record on to the
| first duplicate record, and so on. For any set of duplicates, extra overlay records
| without matching WITH fields, or extra WITH fields without matching overlay
| records are ignored.
| With WITHEACH, a single spliced output record is created using the base
| record and one field from each overlay record. Note that the specified field
| from an overlay record can actually consist of multiple fields from the record
| that have previously been reformatted into one contiguous field.
| WITHEACH overrides the default of splicing the first duplicate with all of the
| specified fields from the last duplicate.
| WITHALL
| Specifies that the first duplicate is spliced with specified fields from the second
| duplicate, and then from each subsequent duplicate in turn. All of the WITH
| fields from each overlay record are overlaid on to the base record.
| With WITHALL, a spliced output record is created from each base record and
| overlay record, resulting in n1 spliced records for each set of n duplicates.
| WITHALL overrides the default of splicing the first duplicate with all of the
| specified fields from the last duplicate.
| KEEPNODUPS
| Specifies that non-duplicate records are to be kept as well as spliced records.
| The non-duplicate records will be unchanged.
| USING(xxxx)
| Specifies the first 4 characters of the ddname for the control statement data set
| to be used by DFSORT for this operation. xxxx must be four characters which
| are valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
| If USING is specified, an xxxxCNTL DD statement must be present and the
| control statements in it:
| 1. Must conform to the rules for DFSORTs SORTCNTL data set.
| 2. Should generally be used only for an INCLUDE or OMIT statement,
| comment statements, or appropriate OUTFIL statements as described for
| SPLICE Operator on page 470.
| VSAMTYPE(x)
| See the discussion of this operand on the COPY statement in COPY Operator
| on page 393.
| UZERO
| See the discussion of this operand on the OCCUR statement in OCCUR
| Operator on page 443.
| SPLICE Examples
| SPLICE normally requires reformatting the records of two or more data sets so they
| can be joined, so complete JCL examples are shown in this section to illustrate the
| suggested techniques. These techniques and others can be employed with SPLICE
| to perform a variety of tasks.
| Since SPLICE overlays the WITH fields from the overlay record to the base record
| using matching ON fields, its usually necessary to do some initial setup before
| using SPLICE, to ensure that:
| v the ON fields are in the same positions in the base and overlay records
| v the WITH fields in the overlay records are in the positions they will occupy in the
| base records
| v the base records and overlay records are the same length
| For optimum efficiency, it is also a good idea to remove any records that are not
| needed for the SPLICE operation as part of the initial setup before the SPLICE
| operation, by using appropriate INCLUDE or OMIT statements.
|
| //S1 EXEC PGM=ICETOOL
| //TOOLMSG DD SYSOUT=*
| //DFSMSG DD SYSOUT=*
| //IN1 DD *
| Y12 89503 MKT
| Y12 57301 MKT
| Z35 02316 DEV
| Y12 91073 MKT
| Z35 18693 DEV
| /*
| //IN2 DD *
| 89503 27M $9,185,354 SAN JOSE CA
| 72135 08M $317,632 BOSTON MA
| 18693 10M $8,732,105 BUFFALO NY
| 57301 50M $30,000 NEWARK NJ
| /*
| //TEMP1 DD DSN=&&TEMP1,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
| //TEMP2 DD DSN=&&TEMP2,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
| //CONCAT DD DSN=*.TEMP1,VOL=REF=*.TEMP1,DISP=(OLD,PASS)
| // DD DSN=*.TEMP2,VOL=REF=*.TEMP2,DISP=(OLD,PASS)
| //COMBINE DD SYSOUT=*
| //TOOLIN DD *
| * Reformat the File1 records for splicing
| COPY FROM(IN1) TO(TEMP1) USING(CTL1)
| * Reformat the File2 records for splicing
| COPY FROM(IN2) TO(TEMP2) USING(CTL2)
| * Splice the needed data from File1 and File2 together
| SPLICE FROM(CONCAT) TO(COMBINE) ON(5,5,ZD) WITH(15,17)
| /*
| //CTL1CNTL DD *
| OUTREC FIELDS=(1,14, file1 data
| 31:X) add blanks for spliced file2 data
| /*
| //CTL2CNTL DD *
| OUTREC FIELDS=(5:1,5, put file2 key in same place as file1 key
| 15:7,15, file2 data
| 30:33,2) file2 data
| /*
|
| The base records originate from the IN1 data set and are copied and reformatted to
| the TEMP1 data set. The reformatted TEMP1 records are 31 bytes long and look
| like this:
| Y12 89503 MKT
| Y12 57301 MKT
| Z35 02316 DEV
| Y12 91073 MKT
| Z35 18693 DEV
| The overlay records originate from the IN2 data set and are copied and reformatted
| to the TEMP2 data set. The reformatted TEMP2 records are 31 bytes long and look
| like this:
| 89503 27M $9,185,354 CA
| 72135 08M $317,632 MA
| 18693 10M $8,732,105 NY
| 57301 50M $30,000 NJ
| The base and overlay records from the TEMP1 and TEMP2 data sets are sorted
| and spliced to the COMBINE data set.
| The records look like this after they are sorted on the 5,5,ZD field, but before they
| are spliced. As a visual aid, the WITH fields in the overlay records are shown in
| bold.
Chapter 6. Using ICETOOL 475
SPLICE Operator
| The spliced COMBINE records are 31 bytes long and look like this:
| Z35 18693 DEV 10M $8,732,105 NY
| Y12 57301 MKT 50M $30,000 NJ
| Y12 89503 MKT 27M $9,185,354 CA
| Note that the base records for 18693, 57301 and 89503 have been spliced together
| with their respective overlay records.
| The first COPY operator creates reformatted TEMP1 records from the IN1 records.
| The second COPY operator creates reformatted TEMP2 records from the IN2
| records. The TEMP1 records contain the data we want from the IN1 records with
| blanks where the TEMP2 WITH fields will go. The TEMP2 records have the ON
| field from IN2 in the same place as in the TEMP1 records, and have the IN2 data
| where we want it to go in the TEMP1 records. We made the TEMP1 and TEMP2
| records the same size so we can use both TEMP1 and TEMP2 as input to the
| SPLICE operator.
| The SPLICE operator sorts the concatenated records from TEMP1 and TEMP2
| using the ON field. Concatenation is used to place the TEMP1 records before the
| TEMP2 records. The spliced records are created from the base records in TEMP1
| and the overlay records in TEMP2. Whenever two records are found with the same
| ON field, the WITH field from the second record (TEMP2 overlay record) is overlaid
| on to the first record (TEMP1 base record). The resulting spliced records are written
| to the COMBINE data set.
|
| //S2 EXEC PGM=ICETOOL
| //TOOLMSG DD SYSOUT=*
| //DFSMSG DD SYSOUT=*
| //FILE1 DD DSN=... input file1 - 300-byte records
| //FILE2 DD DSN=... input file2 - 400-byte records
| //FILE3 DD DSN=... input file3 - 150-byte records
| //FILE4 DD DSN=... input file4 - 20-byte records
| //** BE SURE TO USE MOD FOR T1
| //T1 DD DSN=&&TX,UNIT=SYSDA,SPACE=(CYL,(5,5)),
| // DISP=(MOD,PASS)
| //ALLRCDS DD DSN=... output file - 870-byte records
| //TOOLIN DD *
| * Reformat the File1 records for splicing on added sequence number
| COPY FROM(FILE1) TO(T1) USING(CTL1)
| * Reformat the File2 records for splicing on added sequence number
| COPY FROM(FILE2) TO(T1) USING(CTL2)
| * Reformat the File3 records for splicing on added sequence number
| COPY FROM(FILE3) TO(T1) USING(CTL3)
| * Reformat the File4 records for splicing on added sequence number
| COPY FROM(FILE4) TO(T1) USING(CTL4)
| * Splice record-by-record on added sequence number
| SPLICE FROM(T1) TO(ALLRCDS) ON(871,8,PD) WITHEACH -
| WITH(301,400) WITH(701,150) WITH(851,20) -
| USING(CTL5)
| /*
| //CTL1CNTL DD *
| * Reformat records to:
| * 1 301 701 851 871
| * File1bytes|400 blanks|150 blanks|20 blanks |seqno
| OUTREC FIELDS=(1,300,871:SEQNUM,8,PD)
| /*
| //CTL2CNTL DD *
| * Reformat records to:
| * 1 301 701 851 871
| * 300 blanks|File2bytes|150 blanks|20 blanks |seqno
| OUTREC FIELDS=(301:1,400,871:SEQNUM,8,PD)
| /*
| //CTL3CNTL DD *
| * Reformat records to:
| * 1 301 701 851 871
| * 300 blanks|400 blanks|File3bytes|20 blanks |seqno
| OUTREC FIELDS=(701:1,150,871:SEQNUM,8,PD)
| /*
| //CTL4CNTL DD *
| * Reformat records to:
| * 1 301 701 851 871
| * 300 blanks|400 blanks|150 blanks|File4bytes|seqno
| OUTREC FIELDS=(851:1,20,871:SEQNUM,8,PD)
| /*
| //CTL5CNTL DD *
| * Remove added sequence number from spliced records to get:
| * File1bytes|File2bytes|File3bytes|File4bytes
| OUTFIL FNAMES=ALLRCDS,OUTREC=(1,870)
| /*
|
| Since the data sets do not have a common key, we add sequence numbers to the
| records from each data set and use the sequence numbers as the ON field for
| SPLICE. Using this technique, we can splice together the 300-byte records from
| FILE1, the 400-byte records from FILE2, the 150-byte records from FILE3 and the
| 20-byte records from FILE4, to produce 870-byte records in ALLRCDS.
| Conceptually, the 870-byte records in ALLRCDS would look like this:
| File1 Record1 ... File2Record1 ... File3Record1 ... File4Record1 ...
| File1 Record2 ... File2Record2 ... File3Record2 ... File4Record2 ...
| ...
| The base records originate from the FILE1 data set and the overlay records
| originate from the FILE2, FILE3 and FILE4 data sets.
| The first COPY operator creates reformatted records in the T1 data set with the
| FILE1 records in positions 1-300, blanks in all other positions up to 870, and a
| sequence number in positions 871-878. The sequence number will be 1 for the first
| FILE1 record, 2 for the second FILE1 record, and so on.
| The second COPY operator creates reformatted records in the T1 data set with the
| FILE2 records in positions 301-700, blanks in all other positions up to 870, and a
| sequence number in positions 871-878. The sequence number will be 1 for the first
| FILE2 record, 2 for the second FILE2 record, and so on.
| The third COPY operator creates reformatted records in the T1 data set with the
| FILE3 records in positions 701-850, blanks in all other positions up to 870, and a
| sequence number in positions 871-878. The sequence number will be 1 for the first
| FILE3 record, 2 for the second FILE3 record, and so on.
| The fourth COPY operator creates reformatted records in the T1 data set with the
| FILE4 records in positions 851-870, blanks in all other positions up to 850, and a
| sequence number in positions 871-878. The sequence number will be 1 for the first
| FILE4 record, 2 for the second FILE4 record, and so on.
| Note that MOD is used for the T1 data set, so the reformatted records from FILE1,
| FILE2, FILE3 and FILE4 will be output in that order, ensuring that they are sorted
| and spliced in that order. Alternatively, you could reformat the FILE1, FILE2, FILE3
| and FILE4 data sets to separate data sets which you concatenate together in that
| order. This technique was used in Example 1.
| The SPLICE operator sorts the records from T1 using the sequence number as the
| ON field. With WITHEACH, the reformatted FILE1 records are treated as the base
| records, and the reformatted FILE2, FILE3 and FILE4 records are treated as the
| overlay records; each WITH field is associated with an overlay record in turn. So
| the first WITH field specifies the bytes to be used from the second duplicate (FILE2
| record), the second WITH field specifies the bytes to be used from the third
| duplicate (FILE3 record) and the third WITH field specifies the bytes to be used
| from the fourth duplicate (FILE4 record).
| SPLICE matches each base and overlay record by their sequence numbers, and
| creates a new combined 878-byte record. The OUTFIL statement in CTL5CNTL is
| used to remove the sequence number so that the 870-byte spliced record is written
| to the ALLRCDS data set.
|
| //S3 EXEC PGM=ICETOOL
| //TOOLMSG DD SYSOUT=*
| //DFSMSG DD SYSOUT=*
| //IN1 DD *
| Vicky
| Frank
| Carrie
| Holly
| Paul
| /*
| //IN2 DD *
| Karen
| Holly
| Carrie
| Vicky
| Mary
| /*
| //OUT12 DD SYSOUT=*
| //OUT1 DD SYSOUT=*
| //OUT2 DD SYSOUT=*
| //T1 DD DSN=&&T1,DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,(5,5))
| //T2 DD DSN=&&T2,DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,(5,5))
| //CONCT DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,DELETE)
| // DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,DELETE)
| //TOOLIN DD *
| * Add 11 identifier for FILE1 records.
| COPY FROM(IN1) TO(T1) USING(CTL1)
| * Add 22 identifier for FILE2 records.
| COPY FROM(IN2) TO(T2) USING(CTL2)
| * SPLICE to match up records and write them to their
| * appropriate output files.
| SPLICE FROM(CONCT) TO(OUT12) ON(1,10,CH) WITH(13,1) -
| USING(CTL3) KEEPNODUPS
| /*
| //CTL1CNTL DD *
| * Mark FILE1 records with 11
| OUTREC FIELDS=(1,10,12:C11)
| /*
| //CTL2CNTL DD *
| * Mark FILE2 records with 22
| OUTREC FIELDS=(1,10,12:C22)
| /*
| //CTL3CNTL DD *
| * Write matching records to OUT12 file. Remove id.
| OUTFIL FNAMES=OUT12,INCLUDE=(12,2,CH,EQ,C12),OUTREC=(1,10)
| * Write FILE1 only records to OUT1 file. Remove id.
| OUTFIL FNAMES=OUT1,INCLUDE=(12,2,CH,EQ,C11),OUTREC=(1,10)
| * Write FILE2 only records to OUT2 file. Remove id.
| OUTFIL FNAMES=OUT2,INCLUDE=(12,2,CH,EQ,C22),OUTREC=(1,10)
| /*
|
| We copy the IN1 records to the T1 data set and add an identifier of 11 to show
| they come from FILE1.
| We copy the IN2 records to the T2 data set and add an identifier of 22 to show
| they come from FILE2.
| We sort the records of T1 and T2 together on positions 1-3 and splice the second id
| byte for matching records. We use KEEPNODUPS to keep non-duplicate records.
| The records look like this after they are sorted, but before they are spliced:
| Carrie 11
| Carrie 22
| Frank 11
| Holly 11
| Holly 22
| Karen 22
| Mary 22
| Paul 11
| Vicky 11
| Vicky 22
| The records look like this after they are spliced, but before we do the OUTFIL
| processing specified by CTL3CNTL with USING(CTL3) for SPLICE:
| Carrie 12
| Frank 11
| Holly 12
| Karen 22
| Mary 22
| Paul 11
| Vicky 12
| The OUTFIL statements in CTL3CNTL write the records to their appropriate output
| data sets (without the ids) as follows:
| OUT12 contains:
| Carrie
| Holly
| Vicky
| OUT1 contains:
| Frank
| Paul
| OUT2 contains:
| Karen
| Mary
|
| //S4 EXEC PGM=ICETOOL
| //TOOLMSG DD SYSOUT=*
| //DFSMSG DD SYSOUT=*
| //MAST DD *
| A0000B0000KRSC0000D000000E0000F00G000
| A1111B1111FLYC1111D111111E1111F11G111
| /*
| //UPD DD *
| H02KRSI000002J002K002L02
| H03FLYI000003J003K003L03
| H04VQXI000004J004K004L04
| H05FLYI000005J005K005L05
| H06KHNI000006J006K006L06
| H07KRSI000007J007K007L07
| H08FLYI000008J008K008L08
| H09KHNI000009J009K009L09
| /*
| //TEMP1 DD DSN=&&TEMP1,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
| //TEMP2 DD DSN=&&TEMP2,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
| //CONCAT DD DSN=*.TEMP1,VOL=REF=*.TEMP1,DISP=(OLD,PASS)
| // DD DSN=*.TEMP2,VOL=REF=*.TEMP2,DISP=(OLD,PASS)
| //OUT DD SYSOUT=*
| //TOOLIN DD *
| * Reformat the File1 records for splicing.
| * Add B identifier for base records.
| COPY FROM(MAST) TO(TEMP1) USING(CTL1)
| * Reformat the File2 records for splicing.
| * Add V identifier for overlay records.
| COPY FROM(UPD) TO(TEMP2) USING(CTL2)
| * Splice needed base and overlay data together.
| * Do NOT splice identifier.
| SPLICE FROM(CONCAT) TO(OUT) WITH(1,7) WITH(13,4) ON(20,3,CH) -
| WITH(23,3) WITH(26,3) WITHALL USING(CTL3)
| /*
| //CTL1CNTL DD *
| * Set up fields in base records. Add B id in position 33.
| OUTREC FIELDS=(8:14,5,17:31,3,20:11,3,29:34,4,33:CB)
| /*
| //CTL2CNTL DD *
| * Set up fields in overlay records. Add V id in position 33.
| OUTREC FIELDS=(1:7,7,13:18,4,20:4,3,23:1,3,26:22,3,33:CV)
| /*
| //CTL3CNTL DD *
| * Remove duplicate overlay records without matching base record.
| * Remove base or overlay indicator.
| OUTFIL FNAMES=OUT,OMIT=(33,1,CH,EQ,CV),OUTREC=(1,32)
| /*
|
| The base records originate from the MAST data set and are copied and reformatted
| to the TEMP1 data set. The reformatted TEMP1 records are 33 bytes long and look
| like this:
| C0000 F00KRS G000B
| C1111 F11FLY G111B
| The overlay records originate from the UPD data set and are copied and
| reformatted to the TEMP2 data set. The reformatted TEMP2 records are 33 bytes
| long and look like this:
| I000002 K002 KRSH02L02 V
| I000003 K003 FLYH03L03 V
| I000004 K004 VQXH04L04 V
| I000005 K005 FLYH05L05 V
| The base and overlay records from the TEMP1 and TEMP2 data sets are sorted
| and spliced.
| The records look like this after they are sorted on the 20,3,CH field, but before
| they are spliced. As a visual aid, the WITH fields in the overlay records are shown
| in bold.
| C1111 F11FLY G111B
| I000003 K003 FLYH03L03 V
| I000005 K005 FLYH05L05 V
| I000008 K008 FLYH08L08 V
| I000006 K006 KHNH06L06 V
| I000009 K009 KHNH09L09 V
| C0000 F00KRS G000B
| I000002 K002 KRSH02L02 V
| I000007 K007 KRSH07L07 V
| I000004 K004 VQXH04L04 V
| The spliced output records are 33 bytes long and look like this:
| I000003C1111K003F11FLYH03L03G111B
| I000005C1111K005F11FLYH05L05G111B
| I000008C1111K008F11FLYH08L08G111B
| I000009 K009 KHNH09L09 V
| I000002C0000K002F00KRSH02L02G000B
| I000007C0000K007F00KRSH07L07G000B
| Note that the base record for FLY from the MAST data set has been spliced
| together with each of the three overlay records for FLY from the UPD data set.
| Likewise, the base record for KRS from the MAST data set has been spliced
| together with each of the two overlay records for KRS from the UPD data set.
| But also note that the overlay records for KHN have been spliced together. Since
| KHN does not appear in the MAST data set, we dont want the KHN records to
| appear in the OUT data set. So we will use the V we put in position 33 for the
| overlay records to identify and delete spliced overlay records without a matching
| base record. We only have to do this if we have duplicate overlay records without a
| matching base record. Single overlay records without a matching base record will
| be deleted automatically (unless you specify KEEPNODUPS).
| After we eliminate the spliced overlay records and the position 33 indicator, the
| OUT records are 32 bytes long and look like this:
| I000003C1111K003F11FLYH03L03G111
| I000005C1111K005F11FLYH05L05G111
| I000008C1111K008F11FLYH08L08G111
| I000002C0000K002F00KRSH02L02G000
| I000007C0000K007F00KRSH07L07G000
| The first COPY operator creates reformatted TEMP1 records from the MAST
| records. The second COPY operator creates reformatted TEMP2 records from the
| UPD records. The TEMP1 records contain the data we want from the MAST
| records with blanks where the TEMP2 WITH fields will go. The TEMP2 records
| have the ON field from UPD in the same place as in the TEMP1 records and have
| the UPD data where we want it to go in the TEMP1 records. We made the TEMP1
| and TEMP2 records the same size so we can use both TEMP1 and TEMP2 as
| input to the SPLICE operator. We added a B at the end of the TEMP1 records to
| identify them as base records. We added a V at the end of the TEMP2 records to
| identify them as overlay records.
| The SPLICE operator sorts the concatenated records from TEMP1 and TEMP2
| using the ON field. The spliced records are created from the base records in
| TEMP1 and the overlay records in TEMP2. Whenever an overlay record is found
| with the same ON field as a base record, the overlay record is overlaid on to the
| base record. The OUTFIL statement in CTL3CNTL is used to remove spliced
| overlay records, as well as the base/overlay indicator in position 33. The resulting
| spliced records are written to the OUT data set.
| Note that if we had not specified WITHALL, only the first and last records for each
| set of duplicates would have been spliced, producing the following output:
| I000008C1111K008F11FLYH08L08G111
| I000007C0000K007F00KRSH07L07G000
|
| //S5 EXEC PGM=ICETOOL
| //TOOLMSG DD SYSOUT=*
| //DFSMSG DD SYSOUT=*
| //PULL DD DSN=VAR.PULL.FILE,DISP=SHR
| //MASTER DD DSN=FIXED.MASTER.FILE,DISP=SHR
| //TEMP1 DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
| //TEMP2 DD DSN=&&T2,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
| //CONCAT DD DSN=*.TEMP1,VOL=REF=*.TEMP1,DISP=(OLD,PASS)
| // DD DSN=*.TEMP2,VOL=REF=*.TEMP2,DISP=(OLD,PASS)
| //OUT DD DSN=FIXED.OUTPUT.FILE,DISP=(NEW,CATLG,DELETE),
| // SPACE=(TRK,(5,5)),UNIT=SYSDA
| //TOOLIN DD *
| * Convert PULL records from VB to FB and add P identifier.
| COPY FROM(PULL) USING(CTL1)
| * Add M identifier to MASTER records.
| COPY FROM(MASTER) TO(TEMP2) USING(CTL2)
| * Splice PULL and MASTER records (do NOT splice identifier):
| * Spliced MASTER records with matching PULL records have P id.
| * Spliced MASTER records without matching PULL records
| have M id.
| * Eliminate records with M id.
| SPLICE FROM(CONCAT) TO(OUT) ON(1,20,CH) WITHALL WITH(1,40) -
| USING(CTL3)
| /*
| //CTL1CNTL DD *
| * Convert PULL records from VB to FB and add P identifier.
| OUTFIL FNAMES=TEMP1,VTOF,OUTREC=(5,20,41:CP)
| /*
| //CTL2CNTL DD *
| * Add M identifier to MASTER records.
| OUTREC FIELDS=(1,40,41:CM)
| /*
| //CTL3CNTL DD *
| * Eliminate MASTER records without matching PULL records.
| OUTFIL FNAMES=OUT,OMIT=(41,1,CH,EQ,CM),OUTREC=(1,40)
| /*
|
| The base records originate from the PULL data set (VAR.PULL.FILE). The PULL
| data set has variable-length (VB) records with the RDW in positions 1-4 and the
| variable-length City Name starting in position 5 for 1-20 bytes. Conceptually, the
| PULL records look like this:
| Length | Data
| 12 | SAN JOSE
| 12 | NEW YORK
| 11 | DENVER
| 15 | LOS ANGELES
| The overlay records originate from the MASTER data set (FIXED.MASTER.FILE).
| The MASTER data set has 40-byte fixed-length (FB) records with the City Name in
| positions 1-20.
| The PULL records are copied and reformatted to the TEMP1 data set as 41-byte
| fixed-length (FB) records with the City Name in positions 1-20 (padded on the right
| with blanks as necessary), and a P in position 41 to identify them as PULL
| records. The VTOF and OUTREC parameters of DFSORTs OUTFIL statement are
| used to convert the VB records to FB records with blank padding. The reformatted
| TEMP1 records look like this:
| SAN JOSE P
| NEW YORK P
| DENVER P
| LOS ANGELES P
| The MASTER records are copied and reformatted to the TEMP2 data set as
| 41-byte fixed-length (FB) records with an M added in position 41 to identify them
| as MASTER records. The reformatted TEMP2 records look like this:
| SAN JOSE 8630 SUSAN M
| PHOENIX 7993 PAUL M
| LOS ANGELES 9203 MICHAEL M
| SAN JOSE 0052 VICKY M
| NEW YORK 5218 CARRIE M
| SAN JOSE 3896 FRANK M
| TUCSON 1056 LISA M
| NEW YORK 6385 MICHAEL M
| PHOENIX 5831 HOLLY M
| The base and overlay records from the TEMP1 and TEMP2 data sets are sorted
| and spliced.
| The records look like this after they are sorted on the 1,20,CH field, but before
| they are spliced. As a visual aid, the WITH fields in the overlay records are shown
| in bold.
| DENVER P
| LOS ANGELES P
| LOS ANGELES 9203 MICHAEL M
| NEW YORK P
| NEW YORK 5218 CARRIE M
| NEW YORK 6385 MICHAEL M
| PHOENIX 7993 PAUL M
| PHOENIX 5831 HOLLY M
| SAN JOSE P
| SAN JOSE 8630 SUSAN M
| SAN JOSE 0052 VICKY M
| SAN JOSE 3896 FRANK M
| TUCSON 1056 LISA M
| Finally, we use the OUTFIL statement for SPLICE to remove each spliced record
| with an M in position 41, since that represents a base record without a matching
| overlay record. The OUTFIL statement also removes the P indicator in position 41
| from each record since it is not needed in the OUT data set.
| Thus, for each MASTER record that matches a PULL record, weve overlaid the
| PULL record with the MASTER record. This effectively selects all of the MASTER
| records on the PULL list. The resulting OUT data set (FIXED.OUTPUT.FILE) has
| the following 40-byte fixed-length records:
| LOS ANGELES 9203 MICHAEL
| NEW YORK 5218 CARRIE
| NEW YORK 6385 MICHAEL
| SAN JOSE 8630 SUSAN
| SAN JOSE 0052 VICKY
| SAN JOSE 3896 FRANK
| their original order instead of sorting them by the City Name field. We use
| DFSORTs SEQNUM parameter to add a sequence number to each MASTER
| record before the records are spliced, and we splice that sequence number along
| with the data. After SPLICE sorts by the City Name, we SORT again by the
| sequence number to get the resulting MASTER records back in their original order.
|
| //S6 EXEC PGM=ICETOOL
| //TOOLMSG DD SYSOUT=*
| //DFSMSG DD SYSOUT=*
| //PULL DD DSN=VAR.PULL.FILE,DISP=SHR
| //MASTER DD DSN=FIXED.MASTER.FILE,DISP=SHR
| //TEMP1 DD DSN=&&TEMP1,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
| //TEMP2 DD DSN=&&TEMP2,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
| //CONCAT DD DSN=*.TEMP1,VOL=REF=*.TEMP1,DISP=(OLD,PASS)
| // DD DSN=*.TEMP2,VOL=REF=*.TEMP2,DISP=(OLD,PASS)
| //OUT DD DSN=FIXED.OUTPUT.FILE,DISP=(NEW,CATLG,DELETE),
| // SPACE=(TRK,(5,5)),UNIT=SYSDA
| //TOOLIN DD *
| * Convert PULL records from VB to FB and add P identifier.
| COPY FROM(PULL) USING(CTL1)
| * Add sequence number and M identifier to MASTER records.
| COPY FROM(MASTER) TO(TEMP2) USING(CTL2)
| * Splice PULL and MASTER records (splice sequence number, but
| do NOT splice identifier):
| * Spliced MASTER records with matching PULL records have P id.
| * Spliced MASTER records without matching PULL records
| * have M id.
| * Eliminate records with M id.
| SPLICE FROM(CONCAT) TO(TEMP1) ON(1,20,CH) WITHALL WITH(1,48) -
| USING(CTL3)
| * Sort resulting spliced records on original sequence number
| * to get them back in their original order.
| * Remove id and sequence number.
| SORT FROM(TEMP1) TO(OUT) USING(CTL4)
| /*
| //CTL1CNTL DD *
| * Convert PULL records from VB to FB and add P identifier
| OUTFIL FNAMES=TEMP1,VTOF,OUTREC=(5,20,49:CP)
| /*
| //CTL2CNTL DD *
| * Add sequence number and M identifier to MASTER records.
| OUTREC FIELDS=(1,40,41:SEQNUM,8,BI,49:CM)
| /*
| //CTL3CNTL DD *
| * Eliminate MASTER records without matching PULL records.
| OUTFIL FNAMES=TEMP1,OMIT=(49,1,CH,EQ,CM)
| /*
| //CTL4CNTL DD *
| * Sort on sequence number and remove id and sequence number.
| SORT FIELDS=(41,8,BI,A)
| OUTREC FIELDS=(1,40)
| /*
|
| The resulting OUT data set (FIXED.OUTPUT.FILE) has the following 40-byte
| fixed-length records:
| SAN JOSE 8630 SUSAN
| LOS ANGELES 9203 MICHAEL
| SAN JOSE 0052 VICKY
| NEW YORK 5218 CARRIE
| SAN JOSE 3896 FRANK
| NEW YORK 6385 MICHAEL
| The base records originate from the ONHAND data set and are copied and
| reformatted to the COMBINED data set. We put an O in position 40 to identify
| these records as ONHAND records. The overlay records originate from the
| NEEDED data set and are copied and reformatted to the COMBINED data set. We
| put an N in position 40 to identify these records as NEEDED records. Since MOD
| is used for the COMBINED data set, it contains the reformatted ONHAND records
| followed by the reformatted NEEDED records. The COMBINED records are 40
| bytes long and look like this:
| P62 Blue Yes O
| P62 Red Yes O
| G73 Blue Yes O
| A27 Green Yes O
| L90 Red Yes O
| P63 Blue Yes O
| A27 Green No 2003/05/07 N
| P62 Blue No 2002/12/29 N
| A27 Blue No 2003/03/17 N
| M92 Yellow No 2003/06/14 N
| L90 Red No 2002/12/18 N
| The base and overlay records from the COMBINED data set are sorted and spliced.
| The records look like this after they are sorted on the 1,12,CH field, but before
| they are spliced. As a visual aid, the WITH fields in the overlay records are shown
| in bold.
| A27 Blue No 2003/03/17 N
| A27 Green Yes O
| A27 Green No 2003/05/07 N
| G73 Blue Yes O
| L90 Red Yes O
| L90 Red No 2002/12/18 N
| M92 Yellow No 2003/06/14 N
| P62 Blue Yes O
| P62 Blue No 2002/12/29 N
| P62 Red Yes O
| P63 Blue Yes O
| The spliced output records are 40 bytes long and look like this:
| A27 Blue No 2003/03/17 N
| A27 Green Yes 2003/05/07 N
| G73 Blue Yes O
| L90 Red Yes 2002/12/18 N
| M92 Yellow No 2003/06/14 N
| P62 Blue Yes 2002/12/29 N
| P62 Red Yes O
| P63 Blue Yes O
| We use the OUTFIL statement for SPLICE to further process the spliced records. It
| omits the O records, removes the N byte, and sets up the headers for the report.
| The resulting RPT data set looks like this:
| Part On-Hand Needed by
| ------------ ------- ----------
| A27 Blue No 2003/03/17
| A27 Green Yes 2003/05/07
| L90 Red Yes 2002/12/18
| M92 Yellow No 2003/06/14
| P62 Blue Yes 2002/12/29
|
| //S8 EXEC PGM=ICETOOL
| //TOOLMSG DD SYSOUT=*
| //DFSMSG DD SYSOUT=*
| //ONHAND DD *
| P62 Blue Dallas
| G73 Blue San Jose
| A27 Green Vancouver
| /*
| //NEEDED DD *
| Rachel A27 Green Phoenix
| Monica P62 Blue Phoenix
| Phoebe A27 Blue Toronto
| Chandler M92 Yellow Los Angeles
| Joey M92 Yellow Paris
| Ross A27 Green Paris
| /*
| //COMBINED DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(5,5)),
| // DISP=(MOD,PASS)
| //TEMP1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
| //RPT DD SYSOUT=*
| //TOOLIN DD *
| * Reformat the ONHAND records for splicing.
| * Add Yes for found and D for delete record.
| COPY FROM(ONHAND) TO(COMBINED) USING(CTL1)
| * Extract first record of each set of duplicates from NEEDED.
| * Reformat the records for splicing.
| * Add No for missing and D for delete record.
| SELECT FROM(NEEDED) TO(COMBINED) ON(15,12,CH) -
| FIRSTDUP USING(CTL2)
| * Reformat the NEEDED records for splicing.
| * Add No for missing and K for keep record.
| COPY FROM(NEEDED) TO(COMBINED) USING(CTL3)
| * Splice ONHAND and NEEDED records.
| * Splice in Requested by, Ship to and id fields.
| * Eliminate spliced records with D.
| SPLICE FROM(COMBINED) TO(TEMP1) -
| ON(1,12,CH) WITHALL KEEPNODUPS USING(CTL4) -
| WITH(24,10) WITH(53,13) WITH(66,1)
| * Print report.
| DISPLAY FROM(TEMP1) LIST(RPT) -
| INDENT(2) BETWEEN(2) BLANK -
| HEADER(Part) ON(1,12,CH) -
| HEADER(On-Hand) ON(15,3,CH) -
| HEADER(Requested by) ON(24,12,CH) -
| HEADER(Ship from) ON(38,13,CH) -
| HEADER(Ship to) ON(53,13,CH)
| /*
| //CTL1CNTL DD *
| * Reformat ONHAND records with Part in 1-12, Yes for found in
| * 15-17, From City in 38-50 and D in 66.
| OUTREC FIELDS=(1:1,12,15:CYes,38:20,13,66:CD)
| /*
| //CTL2CNTL DD *
| * Reformat FIRSTDUP records with Part in 1-12, No for missing
| * in 15-17, Requester Name in 24-35, n/a for From City in 38-40,
| * To City in 53-65 and D in 66.
| OUTFIL FNAMES=COMBINED,
| OUTREC=(1:15,12,15:CNo ,24:2,10,38:Cn/a,
| 53:31,13,66:CD)
| /*
|
|
| //CTL3CNTL DD *
| * Reformat NEEDED records with Part in 1-12, No for missing in
| * 15-17, Requester Name in 24-35, n/a for From City in 38-40,
| * To City in 53-65 and K in 66.
| OUTREC FIELDS=(1:15,12,15:CNo ,24:2,10,38:Cn/a,
| 53:31,13,66:CK)
| /*
| //CTL4CNTL DD *
| * Eliminate ONHAND parts that do not appear in NEEDED list.
| OUTFIL FNAMES=TEMP1,OMIT=(66,1,CH,EQ,CD)
| /*
|
| The base records originate from the ONHAND data set. They are copied and
| reformatted to the COMBINED data set. The reformatted records look like this:
| P62 Blue Yes Dallas D
| G73 Blue Yes San Jose D
| A27 Green Yes Vancouver D
| We need to make sure that all parts which appear in more than one NEEDED
| record, but do not appear in the ONHAND list, will appear in the report. For
| example, we have the following in the NEEDED data set:
| Chandler M92 Yellow Los Angeles
| Joey M92 Yellow Paris
| But the M92 Yellow part does not appear in the ONHAND data set. If we just let
| these records be spliced, we will only get one record in the output data set with the
| M92 Yellow part instead of two. To handle this, we need to set up an extra base
| record that can be spliced with the two needed records. We get these extra base
| records for duplicates in NEEDED with the SELECT operator, by specifying the
| FIRSTDUP parameter. The FIRSTDUP records are sorted on the 1,12,CH field and
| reformatted to the COMBINED data set. The reformatted records look like this:
| A27 Green No Rachel n/a Phoenix D
| M92 Yellow No Chandler n/a Los Angeles D
| The overlay records originate from the NEEDED data set and are copied and
| reformatted to the COMBINED data set. The reformatted records look like this
| A27 Green No Rachel n/a Phoenix K
| P62 Blue No Monica n/a Phoenix K
| A27 Blue No Phoebe n/a Toronto K
| M92 Yellow No Chandler n/a Los Angeles K
| M92 Yellow No Joey n/a Paris K
| A27 Green No Ross n/a Paris K
| The base and overlay records from the COMBINED data set are sorted and spliced.
| The records look like this after they are sorted on the 1,12,CH field, but before
| they are spliced. As a visual aid, the WITH fields in the overlay records are shown
| in bold.:
| A27 Blue No Phoebe n/a Toronto K
| A27 Green Yes Vancouver D
| A27 Green No Rachel n/a Phoenix D
| A27 Green No Rachel n/a Phoenix K
| A27 Green No Ross n/a Paris K
| G73 Blue Yes San Jose D
| M92 Yellow No Chandler n/a Los Angeles D
| M92 Yellow No Chandler n/a Los Angeles K
| M92 Yellow No Joey n/a Paris K
| P62 Blue Yes Dallas D
| P62 Blue No Monica n/a Phoenix K
| Records with D are not needed, so we use the OUTFIL statement for SPLICE to
| omit them. The TEMP1 records look like this:
| A27 Blue No Phoebe n/a Toronto K
| A27 Green Yes Rachel Vancouver Phoenix K
| A27 Green Yes Ross Vancouver Paris K
| M92 Yellow No Chandler n/a Los Angeles K
| M92 Yellow No Joey n/a Paris K
| P62 Blue Yes Monica Dallas Phoenix K
| Although we could have used the OUTFIL statement for SPLICE to print the report,
| weve chosen instead to use a separate DISPLAY operator. DISPLAY requires an
| extra pass over the spliced records in TEMP1, but is easier to use than OUTFIL for
| reports. The resulting RPT data set looks like this:
| Part On-Hand Requested by Ship from Ship to
| ------------ ------- ------------ ------------- -------------
| A27 Blue No Phoebe n/a Toronto
| A27 Green Yes Rachel Vancouver Phoenix
| A27 Green Yes Ross Vancouver Paris
| M92 Yellow No Chandler n/a Los Angeles
| M92 Yellow No Joey n/a Paris
| P62 Blue Yes Monica Dallas Phoenix
STATS Operator
Prints messages containing the minimum, maximum, average, and total for
specified numeric fields. From 1 to 10 fields can be specified.
DFSORT is called to copy the indd data set to ICETOOLs E35 user exit. ICETOOL
prints messages containing the minimum, maximum, average, and total for each
field as determined by its E35 exit.
The average (or mean) is calculated by dividing the total by the record count and
rounding down to the nearest integer (examples: 23 / 5 = 4, 23 / 5 = 4).
You must not supply your own DFSORT MODS, INREC, or OUTREC statement
since they would override the DFSORT statements passed by ICETOOL for this
operator.
Operand Descriptions
The operands described below can be specified in any order.
FROM(indd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
ON(p,m,f)
Specifies the position, length, and format of a numeric field to be used for this
operation.
p specifies the first byte of the field relative to the beginning of the input record.
p is 1 for the first data byte of a fixed-length record and 5 for the first data byte
of a variable-length record as illustrated below (RRRR represents the 4-byte
record descriptor word):
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. The maximum length for a field
depends on its format.
If the total for a field overflows, ICETOOL continues processing, but prints
asterisks for the average and total for that field.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY Operator
on page 393.
STATS Example
STATS FROM(DATA1) ON(VLEN) ON(15,4,ZD)
Prints messages containing the minimum, maximum, average and total of the binary
values in positions 1-2 of the DATA1 data set. For variable-length records, this gives
statistics about the length of the records. Prints messages containing the minimum,
maximum, average and total of the zoned decimal values in positions 15-18 of the
DATA1 data set.
UNIQUE Operator
Prints a message containing the count of unique values for a specified numeric or
character field.
DFSORT is called to sort the indd data set to ICETOOLs E35 user exit. ICETOOL
prints a message containing the unique count as determined by its E35 user exit.
| OPTION DYNALLOC=(8)
| Attention: Either of these actions affects the work data sets used for an OCCUR
| operator, or for a SELECT or SPLICE operator for which USING(xxxx) is not
| specified.
You must not supply your own DFSORT MODS, INREC, OUTREC, SUM or
RECORD statement since they override the DFSORT statements passed by
ICETOOL for this operator.
Operand Descriptions
The operands described below can be specified in any order.
FROM(indd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
ON(p,m,f)
Specifies the position, length, and format of a numeric or character field to be
used with this operation.
p specifies the first byte of the field relative to the beginning of the input record.
p is 1 for the first data byte of a fixed-length record and 5 for the first data byte
of a variable-length record as illustrated below (RRRR represents the 4-byte
record descriptor word):
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. The maximum length for a field
depends on its format.
UNIQUE Example
UNIQUE FROM(DATAIN) ON(20,40,CH)
UNIQUE FROM(DATAIN) ON(5,3,ZD)
The first UNIQUE operator prints a message containing the count of unique
character data in positions 20-59 of the DATAIN data set.
The second UNIQUE operator prints a message containing the count of unique
zoned decimal values in positions 5-7 of the DATAIN data set.
VERIFY Operator
VSAMTYPE(x)
Examines particular decimal fields in a data set and prints a message identifying
each invalid value found for each field. From 1 to 10 fields can be specified.
DFSORT is called to copy the indd data set to ICETOOLs E35 user exit. ICETOOL
uses its E35 user exit to examine the digits and sign of each value for validity, and
for each invalid value found, prints an error message containing the record number
and field value (in hexadecimal).
You must not supply your own DFSORT MODS, INREC, or OUTREC statement
since they would override the DFSORT statements passed by ICETOOL for this
operator.
Notes:
1. Values with invalid decimal digits are also identified for the DISPLAY, OCCUR,
RANGE, and STATS operators.
2. The DISPLAY operator can be used to print a report identifying the relative
record number, hexadecimal value, and associated fields for each invalid (and
valid) decimal value, as shown in Example 9 under DISPLAY Operator on
page 404.
Operand Descriptions
The operands described below can be specified in any order.
FROM(indd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
ON(p,m,f)
Specifies the position, length, and format of a decimal field to be used for this
operation.
p specifies the first byte of the field relative to the beginning of the input record.
p is 1 for the first data byte of a fixed-length record and 5 for the first data byte
of a variable-length record as illustrated below (RRRR represents the 4-byte
record descriptor word):
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. The maximum length for a field
depends on its format.
If the number of bad values reaches the LIMIT for invalid decimal values,
ICETOOL terminates the operation. If the LIMIT operand is not specified, a
default of 200 is used for the invalid decimal value limit.
NOSIGN
Specifies that the sign of the decimal values is not to be validity checked
(overriding the default of checking for 0-9 as invalid signs).
LIMIT(n)
See the discussion of this operand on the DISPLAY statement in DISPLAY
Operator on page 404.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY Operator
on page 393.
VERIFY Example
VERIFY FROM(NEW) ON(22,16,PD) ON(7,9,ZD)
VERIFY FROM(NEW) ON(22,16,PD) ON(7,9,ZD) NOSIGN LIMIT(10)
The first VERIFY operator checks for invalid digits (A-F) and invalid signs (0-9) in
the packed decimal values from positions 22-37 and the zoned decimal values from
positions 7-15 of the NEW data set. A message is printed identifying each value (if
any) that contains an invalid digit or sign. If 200 invalid values are found, the
operation is terminated.
The second VERIFY operator checks for invalid digits (A-F) in the packed decimal
values from positions 22-37 and the zoned decimal values from positions 7-15 of
the NEW data set. A message is printed identifying each value (if any) that contains
an invalid digit. If 10 invalid values are found, the operation is terminated.
Note: The DISPLAY operator can be used to print a report identifying the relative
record number, hexadecimal value, and associated fields for each invalid
(and valid) decimal value, as shown in Example 9 under DISPLAY Operator
on page 404.
When you call ICETOOL from a program, you have a choice of two different
interfaces: the TOOLIN Interface and the Parameter List Interface.
TOOLIN Interface
With the TOOLIN Interface, you supply ICETOOL statements in the TOOLIN data
set. ICETOOL prints messages in the TOOLMSG data set, but does not return
information directly to your program.
To use the TOOLIN interface, set a value of 0 in register 1, or place the address of
a 4-byte field containing X80000000 in register 1, before calling ICETOOL as
shown below:
...
SLR R1,R1 TOOLIN INTERFACE - METHOD 1
LINK EP=ICETOOL CALL ICETOOL
...
LA R1,NOPLIST TOOLIN INTERFACE - METHOD 2
LINK EP=ICETOOL CALL ICETOOL
...
NOPLIST DC X80,AL3(0) TOOLIN INTERFACE INDICATOR
...
Figure 39 on page 499 shows the format of the parameter list used with the
Parameter List Interface. Table 66 on page 501 shows the operation-specific values
returned to the calling program.
Register 1 Flags
X'FFFFFFFF"
The flags field must be specified. A 4-byte field containing X FFFFFFFF must be
used to indicate the end of the parameter list. It can be coded after any pair of
statement/return addresses.
All addresses in the parameter list must be 31-bit addresses or clean 24-bit
addresses (the first 8 bits contain zeros).
Explanation of Fields
Flags
Bit 0 = 0:
Use the Parameter List Interface. Process ICETOOL statements from
this parameter list and return information to this parameter list. Ignore
TOOLIN.
Bit 0 = 1:
Use the TOOLIN Interface. Process ICETOOL statements from
TOOLIN. Ignore this parameter list.
Bits 1-31:
Reserved. Must be set to zero to ensure future extendability.
Statement Area Address and Statement Area
Each statement area address gives the location of a statement area which
describes an ICETOOL operation to be performed. If the statement area
address is 0, ICETOOL ignores this statement area/return area pair. Otherwise,
the statement area address must point to a statement area in the following
format:
v A 2-byte length field containing the length of the statement area for this
operation. If this field is 0, ICETOOL ignores this statement area/return area
pair.
v One or more 80-character ICETOOL statement images in the format
described in ICETOOL Statements on page 392. Each statement area must
have one operator statement. Comment and blank statements before the
operator statement are processed. Comment, blank, and additional operator
statements after the end of the first operator statement are ignored.
Return Area Address and Return Area
Each return area address gives the location of a return area in which ICETOOL
is to return operation-specific information for the operation described in the
corresponding statement area. If the return area address is 0, ICETOOL does
not return any information for this operation. Otherwise, the return area address
must point to a return area in the following general format:
v A 2-byte length field containing the length of the return area for this
operation. If this field is 0, ICETOOL does not return any information for this
operation.
v A 1-byte operation status indicator which is set by ICETOOL as follows:
0= This operation was run and completed with return code 0 or 4.
Operation-specific values (see below) were returned.
4= This operation was not run (for example, scan mode was in effect) or
did not complete with return code 0 or 4. Operation-specific values
(see below) were not returned.
v Operation-specific values. Each value returned by ICETOOL is an 8-byte
packed decimal value with a C for a positive sign or a D for a negative sign.
If ICETOOL set the operation status to 4, it did not return any values for this
operation.
Note: Programs in LPALIB which call ICETOOL must provide return areas
which ICETOOL can store into.
The required return area length and the operation-specific values returned for
each operator are shown in Table 66 on page 501. If the return area length is
less than the length required, ICETOOL issues a message and terminates the
operation.
DEPTVIEW CSECT
...
* SET UP PARAMETER LIST AND CALL ICETOOL
LA R1,PARLST LOAD ADDRESS OF PARAMETER LIST
LINK EP=ICETOOL CALL ICETOOL
LTR R15,R15 IF ANY OPERATIONS WERE NOT SUCCESSFUL,
BNZ CKSTAT1 DETERMINE WHICH ONE FAILED
* ALL OPERATIONS WERE SUCCESSFUL
* CHECK EMPLOYEES PER DEPARTMENT AGAINST ACCEPTABLE LEVEL
CP RT2AVG1,EMAVGCK IF AVERAGE IS ACCEPTABLE,
BNH CKQUAL NO MESSAGE IS NEEDED
* ISSUE A MESSAGE SHOWING AVERAGE, MINIMUM, MAXIMUM, AND
* TOTAL NUMBER OF EMPLOYEES PER DEPARTMENT.
...
* CHECK EXPENSES PER DEPARTMENT AGAINST ACCEPTABLE LEVEL
CKQUAL CP RT2AVG2,TLAVGCK IF AVERAGE IS ACCEPTABLE,
BNH PCTCALC NO MESSAGE IS NEEDED
* ISSUE A MESSAGE SHOWING AVERAGE, MINIMUM, MAXIMUM, AND
* TOTAL EXPENSES PER DEPARTMENT.
...
* CALCULATE THE PERCENTAGE OF DEPARTMENTS OVER/UNDER EMPLOYEE LIMIT
PCTCALC MVC WORK+2(4),RT3RCDS+4 COPY NUMBER OF DEPARTMENTS
SP WORK+2(4),RT3RNG+4(4) SUBTRACT NUMBER WITHIN LIMITS TO
* GET NUMBER OVER/UNDER LIMIT
CP WORK+2(4),P0 IF NONE OVER/UNDER LIMIT,
BE PCTPRT PERCENTAGE IS ZERO
MP WORK+2(4),P100 MULTIPLY NUMBER OVER/UNDER BY 100
DP WORK(6),RT3RCDS+4(4) DIVIDE BY NUMBER OF DEPARTMENTS
* ISSUE A MESSAGE SHOWING THE PERCENTAGE OF DEPARTMENTS THAT ARE
* OVER/UNDER EMPLOYEE LIMIT
PCTPRT UNPK PCTVAL,WORK(2) CONVERT AVERAGE TO PRINTABLE EBCDIC
OI PCTVAL+2,XF0 ENSURE LAST DIGIT IS PRINTABLE
...
* ONE OR MORE OPERATIONS FAILED
CKSTAT1 CLI RT1STAT,0 IF OPERATION 1 WORKED,
BNE CKSTAT2 CHECK OPERATION 2
* ISSUE MESSAGE: OPERATION 1 FAILED - CHECK TOOLMSG
...
* PARAMETER LIST
PARLST DC A(0) USE PARAMETER LIST INTERFACE
DC A(ST1A) STATEMENT AREA 1 ADDRESS
DC A(RT1A) RETURN AREA 1 ADDRESS
DC A(ST2A) STATEMENT AREA 2 ADDRESS
DC A(RT2A) RETURN AREA 2 ADDRESS
DC A(ST3A) STATEMENT AREA 3 ADDRESS
DC A(RT3A) RETURN AREA 3 ADDRESS
DC F.*-1 END OF PARAMETER LIST* OPERATOR STATEMENT AREAS
* COPY OPERATION
ST1A DC AL2(ST1E-ST1) LENGTH OF STATEMENT AREA 1
ST1 DC CL80* CREATE TWO COPIES OF THE DENVER SITE
DC CL80* DEPARTMENT RECORDS
DC CL80COPY FROM(IN) TO(OUT1,OUT2) USING(CTL1)
ST1E EQU *
* STATS OPERATION
ST2A DC AL2(ST2E-ST2) LENGTH OF STATEMENT AREA 2
ST2 DC CL80* GET STATISTICS FOR NUMBER OF EMPLOYEES
DC CL80* AND TRAVEL EXPENSES PER DEPARTMENT
DC CL80STATS FROM(OUT1) ON(15,2,PD) ON(28,8,ZD)
ST2E EQU *
* RANGE OPERATION
ST3A DC AL2(ST3E-ST3) LENGTH OF STATEMENT AREA 3
ST3 DC CL80* DETERMINE THE NUMBER OF DEPARTMENTS THAT ARE
DC CL80* WITHIN THE LIMIT FOR NUMBER OF EMPLOYEES
DC CL80RANGE FROM(OUT1) ON(15,2,PD) -
DC CL80 HIGHER(10) LOWER(21)
ST3E EQU *
* RETURN AREAS
COPY OPERATION
RT1A DC AL2(RT1E-RT1STAT) LENGTH OF RETURN AREA 1
RT1STAT DS C OPERATION STATUS
RT1E EQU *
* STATS OPERATION
RT2A DC AL2(RT2E-RT2STAT) LENGTH OF RETURN AREA 2
RT2STAT DS C OPERATION STATUS
RT2RCDS DS PL8 COUNT OF RECORDS PROCESSED
RT2MIN1 DS PL8 FIELD 1 - MINIMUM VALUE
RT2MAX1 DS PL8 FIELD 1 - MAXIMUM VALUE
RT2AVG1 DS PL8 FIELD 1 - AVERAGE VALUE
RT2TOT1 DS PL8 FIELD 1 - TOTAL VALUE
RT2MIN2 DS PL8 FIELD 2 - MINIMUM VALUE
RT2MAX2 DS PL8 FIELD 2 - MAXIMUM VALUE
RT2AVG2 DS PL8 FIELD 2 - AVERAGE VALUE
RT2TOT2 DS PL8 FIELD 2 - TOTAL VALUE
RT2E EQU *
* RANGE OPERATION
RT3A DC AL2(RT3E-RT3STAT) LENGTH OF RETURN AREA 3
RT3STAT DS C OPERATION STATUS
RT3RCDS DS PL8 COUNT OF RECORDS PROCESSED
RT3RNG DS PL8 COUNT OF VALUES IN RANGE
RT3E EQU *
* VARIABLES/CONSTANTS
WORK DS PL6 WORKING VARIABLE
P100 DC P100 CONSTANT 100
P0 DC P0 CONSTANT 0
EMAVGCK DC P17 ACCEPTABLE AVERAGE EMPLOYEE COUNT
TLAVGCK DC P5000 ACCEPTABLE AVERAGE TRAVEL EXPENSES
PCTVAL DS PL3 PERCENTAGE OF DEPARTMENTS THAT ARE
* OVER/UNDER EMPLOYEE LIMIT
...
//DFSPARM DD *
DEBUG ABEND
you cause DFSORT to abend when it issues an error message, thus preventing
ICETOOL from performing subsequent operators.
v Tape work data sets cannot be used with ICETOOL.
v An ON field must not include bytes beyond the fixed part of variable length input
records. The entire field specified must be present in every input record,
otherwise, DFSORT issues message ICE015A, ICE218A, or ICE027A and
terminates.
For successful completion of all operations, ICETOOL passes back a return code of
0 or 4 to the operating system or the invoking program.
The meanings of the return codes that ICETOOL passes back (in register 15) are:
0 Successful completion. All operations completed successfully.
4 Successful completion. All operations completed successfully. DFSORT
passed back a return code of 4 for one or more operations. See DFSORT
Messages and Return Codes on page 22 for details.
12 Unsuccessful completion. ICETOOL detected one or more errors that
prevented it from completing successfully. Messages for these errors were
printed in the TOOLMSG data set.
16 Unsuccessful completion. DFSORT detected one or more errors that
prevented ICETOOL from completing successfully. Messages for these
errors were printed in the DFSMSG data set.
20 Message data set error. The TOOLMSG DD statement was not present or
the TOOLMSG data set was not opened.
24 Unsupported operating system. This operating system is not supported
by this release of DFSORT.
In addition, you can obtain and use collections of DFSORT symbols created
specifically for records produced by other products (for example, RACF,
DFSMSrmm and DCOLLECT) or by your site. Visit the DFSORT home page at the
following URL to obtain information about downloading DFSORT symbol mappings
for records produced by other products, and examples that use these symbols:
| http://www.ibm.com/storage/dfsort
DFSORT or ICETOOL will read SYMNAMES and use the symbols it contains to
transform your statements by performing symbol substitution. DFSORT or
ICETOOL will then use the transformed statements as if you had specified them
directly.
If your record layout changes, just make a corresponding change to your DFSORT
symbol data set. DFSORT will use the new mapping to transform your symbols
correctly, even if positions change, so you wont have to change your statements.
Be sure that your symbol definitions match your record layout before you attempt to
use them.
DFSORT Example
The example below shows the JCL and control statements for a simple DFSORT
job that uses symbols.
Lets say you created a symbols data set named MY.SYMBOLS that contains the
following SYMNAMES statements:
* Fields
First_Name,6,20,CH
Last_Name,*,=,=
Account_Number,53,3,PD
SKIP,2
Balance,*,6,ZD
Type,*,8,CH
* Constants
Loan,LOAN
Check,CHECKING
Level1,50000
Level2,-100
This example is only meant to give you a quick overview of how symbols can be
used. The rest of this chapter will explain all of the details, but here are a few
important things to take note of:
By using * for p, you can map consecutive fields in your records without having
to compute their actual positions.
v SKIP,n can be used to advance the next position by n bytes so it can be used for
*. For example:
Symbola,6,20,CH
SKIP,2
Symbolb,*,5,BI
SKIP,n gives you an easy way to skip unused bytes. Other mapping aids allow
you to reset the next position (POSITION,q or POSITION,symbol), or align the
next position on a halfword (ALIGN,H), fullword (ALIGN,F) or doubleword
(ALIGN,D).
v An equal sign (=) can be used for p, m or f to assign the previous position, length
or format to p, m, or f, respectively. For example:
Symbola,6,20,CH
Symbola1,=,8,=
Symbola2,*,12,=
Symbold,*,=,ZD
Symbola,6,20,CH
Symbola1,6,8,CH
Symbola2,14,12,CH
Symbold,26,12,ZD
By using = and *, you can easily map fields onto other fields.
v Symbols for fields and constants can be specified in any order. However, the use
of * and = imposes order dependencies on symbols for fields.
v Comment statements and blank statements are allowed in SYMNAMES.
SYMNAMES DD Statement
A SYMNAMES DD statement indicates you want DFSORT or ICETOOL to do
symbol processing. It specifies the SYMNAMES data set (SYMNAMES for short),
which can consist of one DFSORT symbol data set or many concatenated symbol
data sets.
For best performance, use a large block size, such as the system determined
optimum block size, for all DFSORT symbol data sets.
SYMNOUT DD Statement
A SYMNOUT DD statement specifies a data set in which you want DFSORT or
ICETOOL to print your original SYMNAMES statements and the symbol table
constructed from them. DFSORT or ICETOOL uses RECFM=FBA, LRECL=121 and
the specified BLKSIZE for the SYMNOUT data set (SYMNOUT for short).
If the BLKSIZE you specify is not a multiple of 121, or you do not specify the
BLKSIZE:
v the system determined optimum block size is used, if supported
v otherwise, BLKSIZE=121 is used.
For best performance, use a large block size, such as the system determined
optimum block size, for the SYMNOUT data set.
SYMNAMES Statements
Each symbol in SYMNAMES must be described using a SYMNAMES statement. A
SYMNAMES statement can be a symbol statement, keyword statement, comment
statement or blank statement.
Symbol Statements
The general format for a symbol statement is:
symbol,value remark
symbol, constant
field
A symbol for a constant value must be used only where such a constant is allowed
and has the desired result. Otherwise, substitution of the constant for the symbol
will result in an error message or unintended processing. For example, if the
following SYMNAMES statement is specified:
SYMB,B10110001
since a bit string can be compared to a binary field. However, SYMB will result in
an error message if used in this INCLUDE statement:
INCLUDE COND=(12,1,CH,EQ,SYMB)
Make sure the constants that will be substituted for your symbols are appropriate. If
in doubt, check the rules for constants given in the description of the relevant
operand.
Some examples of invalid character strings are: CAB (apostrophes not paired),
ctitle (ending apostrophe missing) and CONEIL (one apostrophe after O
instead of two).
You can use Cxx...x and xx...x interchangeably. xx...x will be substituted for
symbols where appropriate even if Cxx...x is specified in SYMNAMES. Likewise,
Cxx...x will be substituted for symbols where appropriate even if xx...x is
specified in SYMNAMES. For example, if these SYMNAMES statements are
specified:
My_Title,cMy Report
My_Heading,CJanuary
DEPT1,J82
DEPT2,cM72
Although the rules for character strings used as symbols generally follow the
rules for INCLUDE/OMIT character strings, keep in mind that the same rules do
not apply for character strings in all DFSORT and ICETOOL operands, so use
symbols representing character strings appropriately. For example, ICETOOL
only allows up to 50 characters for a TITLE string, so TITLE(MYCON) would
result in an error message if MYCON is a 64-character string, even though
MYCON could be used without error in an INCLUDE statement. As another
example, double-byte characters would be recognized in a character string
substituted for a symbol in an INCLUDE statement, but would not be recognized
in a character string substituted in an OUTREC statement.
v A hexadecimal string in the format Xyy...yy or xyy...yy.
The value yy represents any pair of hexadecimal digits. Each hexadecimal digit
must be 0-9, A-F or a-f. You can specify up to 32 pairs of hexadecimal digits.
xyy...yy will be treated like Xyy...yy. a-f will be treated like A-F.
Some examples of valid hexadecimal strings are: XF2C3, x2fa71e, and X07.
Some examples of invalid hexadecimal strings are: XF2G301 (G is not a valid
hexadecimal digit), xbf3 (unpaired hexadecimal digits) and X (no hexadecimal
digits).
v A bit string in the format Bbbbbbbbb...bbbbbbbb or bbbbbbbbb...bbbbbbbb.
The value bbbbbbbb represents 8 bits that constitute a byte. Each bit must be 1,
0 or . (period). You can specify up to 8 groups of 8 bits. bbbbbbbbb...bbbbbbbb
will be treated like Bbbbbbbbb...bbbbbbbb.
Some examples of valid bit strings are: B01100100, b11..00..000..111 and
B11.......
Some examples of invalid bit strings are: B0101 (not a multiple of eight bits),
b00..11.... (not a multiple of eight bits), b00000002 (2 is not a valid bit) and B
(no bits).
v A decimal number in the format n, +n or n. You can specify from 1 to 15
significant digits.
Some examples of valid decimal numbers are: +270, 270, 000036, +0 and
2000000.
Some examples of invalid decimal numbers are: ++15 (too many plus signs),
280 (sign in wrong place) and 2.8 (period is not allowed).
v A two-digit year date string in the format Ystring or ystring.
string can be:
yy, yyx,yyxx, yyxxx or yyxxxx where y is a hexadecimal year digit (0-9) and x
is a hexadecimal non-year digit (0-9).
Uppercase, lowercase or mixed case forms of DATE1, DATE2, DATE3, LOW,
BLANKS or HIGH.
Some examples of valid two-digit year date strings are: Y99, y00123, ydate2,
and YBlanks.
Some examples of invalid two-digit year date strings are: Y9, yAB123, and
Yblank.
,
Field: A field can be specified as p,m,f (position, length and format), p,m (position
and length) or p (position only).
A symbol for a field value must be used only where such a field is allowed and has
the desired result. Otherwise, substitution of the field for the symbol will result in an
error message or unintended processing. For example, if the following SYMNAMES
statement is specified:
Field1,15,2,CH
since a character field is allowed in a SORT statement. However, Field1 will result
in an error message if used in a SUM statement such as:
SUM FIELDS=(Field1)
Make sure the fields that will be substituted for your symbols are appropriate. If in
doubt, check the rules for p, m and f given in the description of the relevant
operand.
You can specify p,m,f for your field symbols and then use them where p,m is
required because DFSORT or ICETOOL will substitute just p,m when appropriate.
For example, if you specify the following in SYMNAMES:
First_Field,12,2,BI
Second_Field,18,6,CH
Third_Field,28,5,PD
Fourth_Field,36,3
Fifth_Field,52,4,PD
Max,200000
v SUM statement: p,m for Second_Field as required for symbol,f (that is,
Second_Field,ZD).
v OUTFIL statement: p,m for First_Field as required by the OUTREC operand for
an unedited field (that is, First_Field), but p,m,f for Third_Field as required by the
OUTREC operand for an edited field (that is, Third_Field,M11).
The general rules for using p, m and f in symbol statements are as follows:
v p can be a number, an asterisk (*) or an equal sign (=). A number from 1 to
32752 is allowed in p,m or p,m,f. Since p (position only) cannot be distinguished
from the constant n, 1 to 15 significant digits are allowed for p (position only).
An asterisk (*) can be used to assign the next position to p. Each time a symbol
for p,m,f or p,m is read, the next position is set to p+m. Additionally, the next
position can be modified by keyword statements (see Keyword Statements on
page 517). When * is specified for p, the next position is assigned to p. If the
next position has not been set when * is used for p (for example, * is used in the
first symbol), p is set to 1.
The symbol table printed in the SYMNOUT data set (if specified) will show you
the actual positions assigned when you specify * for p.
As an example of how * can be used, if you specify the following SYMNAMES
statements:
Sym1,*,5,ZD
Con1,27
Sym2,*,2,BI
Field1,8,13,CH
Field2,*,5,PD
Field3,*,2,FI
By using * for p, you can map consecutive fields in your records without having
to compute their actual positions. You can also map fields added between other
fields without having to change the p values for the original or inserted fields. * is
also useful for creating mappings of contiguous fields using concatenated symbol
data sets. As a simple example, if you specify:
//SYMNAMES DD DSN=MY.SYMPDS(RDW),DISP=SHR
// DD DSN=MY.SYMPDS(SECTION1),DISP=SHR
// DD DSN=MY.SYMPDS(SECTION2),DISP=SHR
New_Parts,*,5,ZD
Old_Parts,*,5,ZD
Variable_Fields,*
An equal sign (=) can be used to assign the previous position to p. Each time a
symbol for p,m,f or p,m is read, the previous position is set to p. Additionally, the
previous position can be modified by a POSITION keyword statement (see
below). When = is specified for p, the previous position is assigned to p. If the
previous position has not been set when = is used for p, an error message is
issued.
The symbol table printed in the SYMNOUT data set (if specified) will show you
the actual positions assigned when you specify = for p.
By using = and * for p, you can easily map fields onto other fields.
Whenever you use = for p, you must ensure that the previous position is the one
you want. In particular, if you insert a new field symbol with the wrong position
before a symbol that uses = for p, you will need to change = to the actual
position you want.
v m can be an equal sign (=) or a number from 1 to 32752. An equal sign (=) can
be used to assign the previous length to m. Each time a symbol for p,m,f or p,m
is read, the previous length is set to m. When = is specified for m, the previous
length is assigned to m. If the previous length has not been set when = is used
for m, an error message is issued.
The symbol table printed in the SYMNOUT data set (if specified) will show you
the actual lengths assigned when you specify = for m.
As an example of how = can be used for m, if you specify the following
SYMNAMES statements:
Flags1,5,1,BI
Error1,X08
Flags2,15,=,BI
Error2,X04
Flags3,22,=,BI
Error3,X23
Whenever you use = for m, you must ensure that the previous length is the one
you want. In particular, if you insert a new field symbol with the wrong length
before a symbol that uses = for m, you will need to change = to the actual length
you want.
v f can be an equal sign (=) or one of the following formats: AC, AQ, ASL, AST, BI,
CH, CLO, CSF, CSL, CST, CTO, DT1, DT2, DT3, D1, D2, FI, FL, FS, LS, OL,
OT, PD, PD0, SS, TM1, TM2, TM3, TM4, TS, Y2B, Y2C, Y2D, Y2DP, Y2P, Y2PP,
Y2S, Y2T, Y2TP, Y2U, Y2UP, Y2V, Y2VP, Y2W, Y2WP, Y2X, Y2XP, Y2Y, Y2YP,
Y2Z or ZD.
You can specify f using uppercase letters (for example, CH), lowercase letters
(for example, ch) or mixed case letters (for example, Ch). f specified in any case
will be treated like uppercase.
An equal sign (=) can be used to assign the previous format to f. Each time a
symbol for p,m,f is read, the previous format is set to f. When = is specified for f,
the previous format is assigned to f. If the previous format has not been set when
= is used for f, an error message is issued.
The symbol table printed in the SYMNOUT data set (if specified) will show you
the actual formats assigned when you specify = for f.
As an example of how = can be used for f, if you specify the following
SYMNAMES statements:
Field1,5,8,CH
Field1a,=,3
Field2,*,12,=
Field3,*,20,=
Whenever you use = for f, you must ensure that the previous format is the one
you want. In particular, if you insert a new field symbol with the wrong format
before a symbol that uses = for f, you will need to change = to the actual format
you want.
Keyword Statements
The general format for a keyword statement is:
keyword,value remark
POSITION,q
POSITION,symbol
SKIP,n
ALIGN,H
ALIGN,F
ALIGN,D
Keyword statements can help you map the fields in your records by letting you set
a starting position, skip unused bytes and align fields on specific boundaries.
v POSITION,q can be used to set the next position and the previous position to q.
As discussed under p above, the next position is used when an asterisk (*) is
specified for p in a symbol statement, and the previous position is used when an
equal sign (=) is specified for p in a symbol statement. q can be a number from 1
to 32752. When you use POSITION,q you can use either * or = interchangably
for p of the next symbol.
As an example of how POSITION,q can be used, if you specify the following
SYMNAMES statements:
POSITION,27
Account_Balance,*,5,PD
Account_Id,*,8,CH
POSITION,84
New_Balance,=,20
v ALIGN,D can be used to align the next position on a doubleword boundary, that
is, 1, 9, 17 and so on. As discussed under p above, the next position is used
when an asterisk (*) is specified for p in a symbol statement. ALIGN,d will be
treated like ALIGN,D.
As an example of how ALIGN,D can be used, if you specify the following
SYMNAMES statements:
C1,7,3,CH
ALIGN,D
C2,*,8,BI
The following simple job will cause DFSORT to issue messages in SYSOUT for any
errors it detects in your SYMNAMES statements, allowing you to correct these
errors before proceeding. Once your SYMNAMES statements are free of errors, the
job will cause DFSORT to show the Symbol Table in SYMNOUT, allowing you to
correct any incorrect positions, lengths or formats for your symbols (for example,
those caused by incorrect use of *, =, SKIP, and so on).
//CHECK JOB A402,PROGRAMMER
//DOIT EXEC PGM=ICEMAN
//SYMNAMES DD ... SYMNAMES statements to be checked
//SYMNOUT DD SYSOUT=*
//SORTIN DD *
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY
/*
Once youve debugged your SYMNAMES statements, you can use them in
DFSORT and ICETOOL statements.
You can use symbols in these control statements in any source (that is, DFSPARM,
SYSIN, SORTCNTL, and parameter lists).
Details and examples of the use of symbols for each applicable DFSORT control
statement is given below. The examples are meant to illustrate variations in how
symbols can be used and how they will be transformed. Therefore, the examples do
not necessarily correspond to how symbols would be used in real applications.
Example 1
SORT FIELDS=(C_Field1,A,Z_Field1,D,
C_Field2,ZD,A),EQUALS
Example 2
MERGE FIELDS=(Any_Format,A,C_Field1,A),FORMAT=CH
SUM
FIELDS operand: You can use symbols where you can use fields (p,m,f and p,m).
A symbol for p,m,f results in substitution of p,m if FORMAT=f or symbol,f is
specified.
Example 1
SUM FIELDS=(Z_Field1,C_Field1,ZD)
Example 2
SUM FORMAT=ZD,FIELDS=(C_Field1,Any_Format)
Example 1
INCLUDE COND=((Z_Field1,GT,LIMIT,AND,Any_Format,CH,EQ,C_Field2),OR,
(SubString,NE,Depts),OR,
(Flags,ALL,Error,AND,Flags,NE,Empty))
Example 2
OMIT FORMAT=BI,COND=(C_Field1,EQ,Code_1,OR,
Any_Format,EQ,Stopper,OR,
Flags,EQ,Full)
In the CHANGE and NOMATCH suboperands, you can use symbols where you can
use fields (q,n) and constants (Cxx...x, Xyy...yy and Bbbbbbbbb).
| Example 1
| INREC FIELDS=(11:C_Field2,2X,C_Field1,F,Stopper,5C*,
| Z_Field1,55:Depts,X,P_Field1,TO=FS,X,Z_Field1,M10,
| Z_Field1,MUL,(P_Field1,SUB,LIMIT),EDIT=(SIIIIIT.TT),SIGNS=(+,-))
Example 2
OUTREC FIELDS=(RDW, ** Record Descriptor Word **
Z_Field1,2Z,
3CSymbol cannot be used for a repeated constant,
Code_1,Flags,
Variable_Fields) ** Variable part of input record
OUTFIL
INCLUDE and OMIT operands: You can use symbols where you can use fields
(p1,m1,f1 and p1,m1 and p2,m2,f2 and p2,m2) and constants (n, +n, n, Cxx...x,
Xyy...yy, Yyyx...x and Bbbbbbbbb...bbbbbbbb). A symbol for p,m,f results in
substitution of p,m if symbol,f is specified. A symbol for string always results in
substitution of Cstring.
OUTREC operand: You can use symbols where you can use fields (p,m,f and p,m
and p), non-repeated constants (Cxx...x and Xyy...yy, but not nCxx...x or
| nXyy...yy), and decimal constants (+n and n, but not n). You cannot use symbols
| for edit patterns (pattern).
In the CHANGE and NOMATCH suboperands, you can use symbols where you can
use fields (q,n) and constants (Cxx...x, Xyy...yy and Bbbbbbbbb).
VLFILL operand: You can use symbols where you can use constants (Cx and
Xyy). A symbol for string always results in substitution of Cstring.
VLTRIM operand: You can use symbols where you can use constants (Cx and
Xyy). A symbol for string always results in substitution of Cstring.
HEADER1 and HEADER2 operands: You can use symbols where you can use
fields (p,m) and non-repeated constants (xx...x and Cxx...x, but not nxx...x or
nCxx...x). A symbol for p,m,f always results in substitution of p,m. A symbol for
string always results in substitution of Cstring.
TRAILER1 and TRAILER2 operands You can use symbols where you can use
fields (p,m) and non-repeated constants (xx...x and Cxx...x, but not nxx...x or
nCxx...x). A symbol for p,m,f results in substitution of p,m if symbol,f is specified or
if the symbol is specified outside of the suboperands TOTAL, TOT, MIN, MAX, AVG,
SUBTOTAL, SUBTOT, SUB, SUBMIN, SUBMAX and SUBAVG. A symbol for string
always results in substitution of Cstring.
Outside of the HEADER3 and TRAILER3 suboperands, you can use symbols where
you can use fields (p,m). A symbol for p,m,f always results in substitution of p,m.
Example 1
OUTFIL FNAMES=OUT1,
INCLUDE=(Z_Field1,GT,LIMIT,AND,Any_Format,CH,EQ,C_Field2),
OUTREC=(12:P_Field1,M0,2X,Any_Format,BI,LENGTH=3,2X,QCON,2X,
C_Field2,HEX,2X,Z_Field1,EDIT=(I III IIT.T),2X,
* Lookup Table
Lookup,CHANGE=(6,Entry1,Value1,Entry2,Value2),
NOMATCH=(Lookup))
Example 2
OUTFIL FNAMES=REPORT,
OUTREC=(6:Branch_Office,24:Profit_or_Loss,M5,LENGTH=20,75:X),
SECTIONS=(Division,SKIP=P,
HEADER3=(2:Div_Title,Division,5X,Page:,&PAGE;,2/,
6:BO_Title,24:PL_Title,/,
6:BO_Hyphens,24:PL_Hyphens),
TRAILER3=(6:BO_Equals,24:PL_Equals,/,
6:Total,24:TOTAL=(Profit_or_Loss,M5,LENGTH=20),/,
6:Lowest,24:MIN=(Profit_or_Loss,M5,LENGTH=20)))
ICETOOL reads the SYMNAMES data set once and uses it for all operators and
DFSORT control statements for the run. You can use symbols in operators from the
TOOLIN data set or your parameter list. You can also use symbols in DFSORT
control statements in xxxxCNTL data sets or in the DFSPARM data set (see Using
Symbols in DFSORT Statements on page 520 for details).
ICETOOL will list the original operator statements as well as the transformed
operator statements.
Details of the use of symbols for each applicable ICETOOL operator is given below
followed by a complete ICETOOL example. The example is meant to illustrate
variations in how symbols can be used and how they will be transformed.
Therefore, the example does not necessarily correspond to how symbols would be
used in real applications.
COUNT
HIGHER, LOWER, EQUAL and NOTEQUAL operands: You can use symbols
where you can use constants (x, y, v, and w).
DISPLAY
ON operand: You can use symbols where you can use fields (p,m,f and p,m). A
symbol for p,m,f results in substitution of p,m if symbol,f or symbol,HEX is specified.
BREAK operand: You can use symbols where you can use fields (p,m,f and p,m).
A symbol for p,m,f results in substitution of p,m if symbol,f is specified.
OCCUR
ON operand: You can use symbols where you can use fields (p,m,f and p,m). A
symbol for p,m,f results in substitution of p,m if symbol,f or symbol,HEX is specified.
TITLE and HEADER operands: You can use symbols where you can use
constants (string). A symbol for Cstring always results in substitution of string.
HIGHER, LOWER and EQUAL operands: You can use symbols where you can
use constants (x, y and v).
RANGE
ON operand: You can use symbols where you can use fields (p,m,f and p,m). A
symbol for p,m,f results in substitution of p,m if symbol,f is specified.
HIGHER, LOWER, EQUAL and NOTEQUAL operands: You can use symbols
where you can use constants (x, y, v and w).
SELECT
ON operand: You can use symbols where you can use fields (p,m,f and p,m). A
symbol for p,m,f results in substitution of p,m if symbol,f is specified.
HIGHER, LOWER and EQUAL operands: You can use symbols where you can
use constants (x, y and v).
| SPLICE
| ON operand: You can use symbols where you can use fields (p,m,f and p,m). A
| symbol for p,m,f results in substitution of p,m if symbol,f is specified.
| WITH operand: You can use symbols where you can use fields (p,m). A symbol for
| p,m,f results in substitution of p,m.
ICETOOL Example
//TOOLSYM JOB A402,PROGRAMMER
//DOIT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYMNOUT DD SYSOUT=*
//SYMNAMES DD *
Rdw,1,4,BI
Account_Code,12,1,CH
Dept_Code,*,=,=
Customer_Name,*,20,CH
SKIP,2
Customer_Balance,*,10,ZD
Customer_Flags,*,1,BI
* Department Codes
Research,R
Marketing,M
* Balance Cutoffs
Cancel,+10000 100.00
Gift,+1000000 10,000.00
Stop_Check,-500 -5.00
* Headings and Titles
Title,Customer Report for
Head1,Customer Name
Head2,Customer Balance
Head3,Customer Flags
/*
//IN DD DSN=MY.CUSTOMER.INPUT,DISP=SHR
//OUT DD DSN=&&O,UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE),
// DISP=(,PASS)
//LIST1 DD SYSOUT=*
//TOOLIN DD *
RANGE FROM(IN) ON(Customer_Balance) LOWER(Stop_Check)
SORT FROM(IN) TO(OUT) USING(CTL1)
DISPLAY FROM(OUT) LIST(LIST1) BLANK WIDTH(133) -
TITLE(Title) DATE(4MD/) PAGE -
HEADER(Head1) ON(Customer_Name) -
HEADER(Head2) ON(Customer_Balance,C1) -
HEADER(Head3) ON(Customer_Flags,HEX)
/*
//CTL1CNTL DD *
SORT FIELDS=(Customer_Balance,D,Customer_Name,A)
INCLUDE COND=((Dept_Code,EQ,Research,OR,Dept_Code,EQ,Marketing),
AND,Customer_Balance,GT,Gift)
/*
Head2,Customer Balance
Head3,Customer Flags
invalid for a particular statement or operand will be detected after the substitution
phase. This makes it easier to determine the cause of the error. For example, if
SYMNAMES contains:
Sym1,5,4,ZD
Con1,1234
Con2,1234
the statement:
INCLUDE COND=(Sym1,EQ,Con1)
An ICE114A message with a $ marker under C1234 will then be issued for the
statement because a ZD field cannot be compared to a character constant. In
this example, the error could be fixed by using Con2 (a decimal constant) in the
statement instead of Con1 or by redefining Con1 as a decimal constant.
v 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. In particular, if you use symbols processing and do not use
MOD, you will not see the original control statements unless Blockset is selected.
v If you rearrange your records in any way (for example, using E15, E35, INREC,
OUTREC or OUTFIL) and want to use symbols for the rearranged records, be
sure to use symbols that map to the new positions of your fields. For example, if
you use a SYMNAMES data set with the following statements:
Field1,1,5,ZD
Field2,*,6,ZD
Field3,*,3,ZD
Field4,*,4,ZD
the resulting records will only contain Field2 and Field4. If you want to use
symbols for the rearranged records (for example, in a SORT statement), you will
need to use a SYMNAMES data set with symbols that map to the rearranged
records, such as:
New_Field2,1,6,ZD
New_Field4,*,4,ZD
If you use unique symbols for the rearranged fields, as in the example above,
you can concatenate the old and new symbol data sets together and use the old
and new symbols where appropriate, as in this example:
INREC FIELDS=(Field2,Field4)
SORT FIELDS=(New_Field2,A,New_Field4,A)
Using EFS
Like the user exits described in Chapter 4, Using Your Own User Exit Routines,
the DFSORT Extended Function Support (EFS) interface is a means by which you
can pass run-time control to an EFS program you write yourself. An EFS program is
essential if you want to process double-byte character sets (such as Japanese
characters) with DFSORT.
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.
Using an EFS program and EFS program exit routines, you can:
v Sort or merge user-defined data types (such as double-byte character sets) with
user-defined collating sequences
v Include or omit records based on the user-defined data types
v Provide user-written messages to DFSORT for printing to the message data set
v Examine, alter, or ignore control statements or EXEC PARM options prior to
processing by DFSORT.
The EFS program can also perform routine tasks, such as opening and initializing
data sets, terminating DFSORT, and closing data sets.
You can write your EFS program in any language that uses standard register and
linkage conventions, and can:
v Pass a parameter list and a record (if you provide the EFS01 and EFS02 exit
routines in the EFS program) in register 1
v Pass a return code in general register 15.
Notes:
1. DFSORT does not support EFS programs for Conventional merge or tape work
data set sort applications.
2. VLSHRT is not allowed if EFS processing is in effect and an EFS01 or EFS02
exit routine is provided by the EFS program.
3. 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.
4. If you use symbol processing, you must not use an EFS program.
You can activate your EFS program during run-time with the EFS=name option
(name is the name of your EFS program):
v As set during DFSORT installation with the ICEMAC macro (see Installation
Defaults on page 15)
v On the PARM parameter of your EXEC statement when you use job control
language to invoke DFSORT (see Specifying EXEC/DFSPARM PARM Options
on page 29)
v On the OPTION program control statement (see OPTION Control Statement on
page 142).
EFS EFS
Interface EFS
Interface
Processing Interface
Processing
Input Output
Data Data
Set Set
EFS processing can be invoked during the initialization, input, and termination
phases of DFSORT. DFSORT always calls the EFS program during the initialization
phase.
During the input phase, DFSORT reads input records, and performs any INCLUDE
or OMIT statement logic on the records. If the EFS program generates exit routines
(EFS01 and EFS02), DFSORT calls them during the input phase.
During the termination phase, DFSORT closes data sets, releases storage, and
returns control to the calling program or system. DFSORT always calls the EFS
program from the termination phase.
Major Call 3
DFSORT
Input Phase Call for each
EFS01 and EFS01
Input Record
EFS02
Parameter
List One or more calls for each
Processing EFS02
Input Record
DFSORT
Termination Phase Major Call 4
EFS
Processing EFS
Program
Major Call 5
Figure 42. EFS Program Calls for a Sort. The figure also shows the calls to the EFS program
EFS01 and EFS02 exit routines.
Major Call 3
DFSORT
Input and Call for each EFS01
Output Phase EFS01 and (Merge
Input Record Only)
EFS02
Parameter
List One or more calls for each
Processing EFS02
Input Record
DFSORT
Termination Phase Major Call 4
EFS
Processing EFS
Program
Major Call 5
Figure 43. EFS Program Calls for a Merge or Copy. The figure also shows the calls to the
EFS program EFS01 and EFS02 exit routines.
Initialization Phase
DFSORT runs Major Calls 1 through 3 during the initialization phase.
Major Call 1: The EFS program can perform initialization processing such as
opening data sets and obtaining storage.
Information is passed in both directions between DFSORT and the EFS program
across the EFS interface.
At Major Call 1, DFSORT supplies your EFS program with fields in the EFS
interface containing:
v An action code indicating that Major Call 1 is in effect
v Informational flags that describe current processing.
When the EFS program returns control to DFSORT, it can supply fields in the EFS
interface containing:
v A control statement request list, with a list of DFSORT and non-DFSORT control
statement operation definers, or EXEC PARM options
Major Call 2: At this call, your EFS program can examine, alter, or ignore control
statements before DFSORT processes them, and provide user-written messages to
the message data set. DFSORT calls your EFS program once for each control
statement or EXEC PARM you request.
At Major Call 2, DFSORT supplies your EFS program with fields in the EFS
interface containing:
v An action code indicating that Major Call 2 is in effect
v The original control statement or EXEC PARM option requested by the EFS
program
v The length of the original control statement or EXEC PARM option
v Informational flags that describe current processing
v An EFS Program Context area (a private communication area for the EFS
program).
When the EFS program returns control to DFSORT, it can supply fields in the EFS
interface containing:
v A modified version of the control statement or EXEC PARM option sent by
DFSORT to the EFS program. If you plan to sort or merge user-defined data
types, or include or omit user-defined data types, your EFS program must return
new formats for the SORT/MERGE or INCLUDE/OMIT control statements. These
new formats (D1 and D2) signal DFSORT to call the EFS01 and EFS02 exit
routines you included with your EFS program.
Major Call 3: At Major Call 3, your EFS program can provide DFSORT with
user-written messages to print to the message data set. DFSORT can call the EFS
program once for the Blockset technique and once for the Peerage/Vale techniques.
DFSORT obtains more information at this call from the EFS program to process the
EFS01 and EFS02 exit routines.
At Major Call 3, DFSORT supplies your EFS program with fields in the EFS
interface containing:
v An action code indicating that Major Call 3 is in effect
v An extract buffer offsets list needed by the EFS01 exit routine
v A record lengths list of input and output records
When the EFS program returns control to DFSORT, it can supply fields in the EFS
interface containing:
v An EFS01 exit routine address
v An EFS02 exit routine address
v A list of messages for printing to the message data set
v A return code in general register 15.
Input Phase
DFSORT runs the two exit routines, EFS01 and EFS02, during the input phase. The
EFS01 routine supports sorting or merging user-defined data types with
user-defined collating sequences and is called once for each record. The EFS02
routine provides logic to include or omit records on user-defined data types and is
called one or more times for each record, according to the logic.
Information is passed in both directions between DFSORT and the exit routines
across the EFS01 and EFS02 parameter lists.
DFSORT supplies the EFS01 routine with fields in the parameter list containing:
v An Extract Buffer Area to which the EFS01 routine must move all EFS control
fields. See EFS01 User Exit Routine on page 553 for more information.
v The input data record.
v An EFS Program Context Area (a private communication area for the EFS
program).
When the EFS01 routine returns control to DFSORT, it must return a return code in
general register 15.
DFSORT supplies the EFS02 routine with fields in the parameter list containing:
v A Correlator Identifier, which identifies a relational condition containing EFS
fields. See EFS02 User Exit Routine on page 554 for more information.
v The input data record.
When the EFS02 routine returns control to DFSORT, it must return a return code in
general register 15.
Termination Phase
DFSORT runs Major Calls 4 and 5 during the termination phase. Only one call is
made at each of these Major Calls.
Major Call 4: The EFS program provides any final user-written messages for
printing to the message data set.
At Major Call 4, DFSORT supplies your EFS program with fields in the EFS
interface containing:
v An action code indicating that Major Call 4 is in effect.
v An EFS Program Context Area (a private communication area for the EFS
program).
When the EFS program returns control to DFSORT, it can supply fields in the EFS
interface containing:
v A message list containing messages for printing to the message data set.
v A return code (in general register 15).
Major Call 5: The EFS program performs any termination processing, such as
closing data sets and releasing storage.
At Major Call 5, DFSORT supplies your EFS program with fields in the EFS
interface containing:
v An action code indicating that Major Call 5 is in effect.
v An EFS Program Context Area (a private communication area for the EFS
program).
When the EFS program returns control to DFSORT, it must supply a return code in
general register 15.
At Major Call 2, your EFS program can examine, alter, or ignore control statements
and EXEC PARM options that DFSORT reads from the EXEC statement, SYSIN,
SORTCNTL, DFSPARM, or a parameter list passed from an invoking program.
OUTFIL statements cannot be passed to an EFS program or returned from an EFS
program to be parsed.
The same override rules apply to control statements and parameters returned from
an EFS program as apply to the original control statements and parameters.
DFSPARM
SYSIN SORTCNTL
SYSOUT
You can control whether to print the control statements returned by an EFS program
to the message data set with:
v The LISTX operator of the ICEMAC macro (see Installation Defaults on page
15)
v The LISTX or NOLISTX operators in the PARM field of the JCL EXEC statement
(see Specifying EXEC/DFSPARM PARM Options on page 29)
v The LIST or NOLIST operators of the OPTION program control statement.
Terminating DFSORT
Your EFS program can terminate DFSORT at any of the five Major Calls and also
from either of the two EFS program exit routines during the input phase.
The parameter list resides below 16MB virtual, and remains accessible while the
EFS program is active, although DFSORT might change its storage location during
run-time to optimize use of storage. The actual address in register 1 (used to pass
the interface parameter list address) can therefore change while DFSORT is
running.
Figure 45 on page 542 illustrates the structure of the EFS interface parameter list.
The illustrated portions of the list are explained in order in the following pages.
EXEC PARMs are not described in the figure, but are included in processing.
R1
Action code
4 bytes
Address of Control statement
Control Statement list request list
** bytes
4 bytes
Address of
original Control Statement Original control
including all keywords and statement string
corresponding subparameters * bytes
4 bytes
Address of
modified Control Statement Modified control
including all keywords and statement string
corresponding subparameters * bytes
4 bytes
Length of
original Control Statement
including all keywords and
corresponding subparameters
4 bytes
Length of
modified Control Statement
including all keywords and
corresponding subparameters
4 bytes
Address of
EFS context area
4 bytes
Address of
Extract buffer offsets
(zeros if no EFS fields exist)
4 bytes
Address of Record lengths
Record lengths list list
4 bytes 8 bytes
RESERVED
4 bytes
RESERVED
4 bytes
RESERVED
4 bytes
Information flags
4 bytes
Address of
message list
(zeros if none)
4 bytes
RESERVED
4 bytes
RESERVED
4 bytes
RESERVED
4 bytes
Address of
f EFS01 extract routine
(zeros if none)
4 bytes
Address of
f EFS02 INCLUDE/OMIT
routine (zeros if none)
4 bytes
List end indicator (X'FFFFFFFF')
4 bytes
** - Length determined by length fields in the list
* - Length determined by corresponding length field
Action Codes
DFSORT sets one of five action codes before a call to the EFS program:
0 Indicates Major Call 1 to the EFS program. DFSORT sends this action code
once.
4 Indicates Major Call 2 to the EFS program. DFSORT might send this action
code several times at Major Call 2 depending on how many control
statements are requested and found. For example, if the SORT, MERGE,
and INCLUDE control statements are all supplied in SYSIN and are
requested, the EFS program is called twice: once for the SORT control
statement (because SORT and MERGE are mutually exclusive, and
assuming the SORT statement is specified first, only the SORT statement is
taken) and once for the INCLUDE control statement.
8 Indicates Major Call 3 to the EFS program. DFSORT can send this action
code once for the Blockset technique and once for the Peerage/Vale
technique.
12 Indicates Major Call 4 to the EFS program. DFSORT sends this action code
once.
16 Indicates Major Call 5 to the EFS program. DFSORT sends this action code
once.
The asterisk (*) indicates that the length is determined by the corresponding length
field (maximum of 8 bytes).
DFSORT places a copy of the requested control statement or PARM option string in
a contiguous storage area for the EFS program. No labels are supplied with the
control statement; the address of the string always points to the first byte of the
appropriate operation definer or PARM option.
DFSORT will send the requested control statement(s) or PARM option(s) to the EFS
program as found by DFSORT; DFSORT will provide limited syntax checking of
control statements or PARM option(s) before sending them to the EFS program.
In addition to following the rules in General Coding Rules on page 84, you must
observe the following rules for non-DFSORT control statements:
v DFSORT will recognize a control statement with no operand(s) provided the
operation definer (1) is supplied in SYSIN, SORTCNTL, or DFSPARM and (2) is
the only operation definer contained on a line.
v Operation definers supplied through SYSIN, SORTCNTL, DFSPARM, or the
extended parameter list and requested by the EFS program will not be
recognized if they are longer than eight bytes.
In addition to observing the rules in z/OS MVS JCL Users Guide and z/OS MVS
JCL Reference you must observe the following rule for non-DFSORT PARM
options:
v PARM options requested by the EFS program will not be recognized if they are
longer than eight bytes.
Thus the EFS program will not be sent duplicate DFSORT or non-DFSORT control
statements (except for the DFSORT OPTION and DEBUG control statements as
explained in Special Handling of OPTION and DEBUG Control Statements), or
duplicate PARM options.
DFSORT will free any storage it acquired for the control statement or PARM string.
Note: Blanks and quotes are very important to DFSORT in determining the control
statement to send to an EFS program. Do not supply unpaired quotes in the
INCLUDE/OMIT control statements, because DFSORT treats data within
quotes as a constant, and treats blanks outside of quotes as the major
delimiter.
For example, DFSORT handles override for the OPTION and DEBUG control
statements as follows:
v The OPTION control statement supplied in SORTCNTL will selectively override
corresponding options on the OPTION control statement supplied in the extended
parameter list.
v The DEBUG control statement supplied in SORTCNTL will selectively override
corresponding options on the DEBUG control statement supplied in the 24-bit
parameter list or the extended parameter list.
Because of these override features, DFSORT cannot simply send the OPTION
control statement supplied in SORTCNTL and not send the OPTION control
statement supplied in the extended parameter list. For the EFS program to process
all possible operands on the OPTION control statements, DFSORT must send the
OPTION control statements supplied in both SORTCNTL and the extended
parameter list. DFSORT will send both the OPTION and DEBUG control statements
supplied through different sources. If duplicate OPTION or DEBUG control
statements are supplied in the same source and the OPTION or DEBUG control
statements are also supplied in different sources, DFSORT will send the first
occurrence of both the OPTION and DEBUG control statements supplied through
different sources.
Your EFS program must set an Informational flag to indicate whether the control
statement or PARM option in the string should be parsed or ignored by DFSORT
(see Information Flags on page 550 for further details).
You must observe the following rules for control statements to be returned to
DFSORT for parsing:
v The operation definer and corresponding operands must be in uppercase
EBCDIC format.
v At least one blank must follow the operation definer (SORT, MERGE, RECORD,
and so on). A control statement can start with one or more blanks and can end
with one or more blanks. No other blanks are allowed unless the blanks are part
of a constant.
v Labels are not allowed; a leading blank, or blanks, before the control statement
name is optional.
v No continuation character is allowed.
v Comment statements, blank statements, and remarks are not allowed.
The content and format of the altered EXEC PARM option to be parsed must
correspond to valid DFSORT values as described in Specifying EXEC/DFSPARM
PARM Options on page 29.
Use D1 and D2 to reflect data types that require special processing by EFS
program exit routines EFS01 and EFS02, respectively. You cannot specify D2
format with the INCLUDE or OMIT parameters of the OUTFIL statement.
Where Represents
mp field position within the input record
mm field length
mf the D1 format that designates this field as an EFS control field
ms must be either ascending (A) or descending (D); modification by an E61 exit
(E) is not allowed.
Table 69 gives an example of using the D1 format for a SORT control statement
returned to DFSORT by the EFS program.
SORT FIELDS=(15,4,FF,A,20,4,CH,A,40,7,FF,D)
SORT FIELDS=(15,4,D1,A,20,4,CH,A,40,7,D1,D)
where:
, AND ,
OR
, AND , (
( OR
Where Represents
Table 70 gives an example of using a correlator identifier and the D2 format for an
INCLUDE control statement returned to DFSORT by the EFS program.
Note: The values for the correlator identifiers assigned to each relational condition
by the EFS program can be in any chosen order. The example in Table 70
shows a sequential ordering for the correlator identifiers.
INCLUDE COND=(15,4,FF,EQ,20,4,FF,AND,40,7,FF,NE,50,7,FF,OR,
30,2,FF,NE,35,2,FF)
INCLUDE COND=(1,4,D2,EQ,1,4,D2,AND,2,7,D2,NE,2,7,D2,OR,3,2,D2,NE,3,2,D2)
Where:
v FF is a user-defined format and modified to D2 by the EFS program before returning to
DFSORT.
v The first relational condition specified, (1,4,D2,EQ,1,4,D2), uses correlator identifier value
1 to identify this relational condition.
v The second relational condition specified, (2,7,D2,NE,2,7,D2), uses correlator identifier
value 2 to identify this relational condition.
v The third relational condition specified, (3,2,D2,NE,3,2,D2), uses correlator identifier value
3 to identify this relational condition.
The EFS program is responsible for obtaining (at Major Call 1) and releasing (at
Major Call 5) the necessary storage for the EFS program context area.
DFSORT frees any storage it acquired for the extract buffer offsets list. The format
of the extract buffer offsets list is:
4 bytes 4 bytes
The input and output record lengths are sent to the EFS program for informational
use only. DFSORT ignores any changes to the values made to the record lengths
list returned by the EFS program.
DFSORT frees any storage it acquired for the record lengths list. The format of the
record lengths list is:
4 bytes 4 bytes
Information Flags
The information flags are defined in the figure that follows:
bit 0 1 2 3 45 6 7 8
Reserved
0 = Fixed-length records
1 = Variable-length records
0 = PARM option/Control statement not from DFSPARM
1 = PARM option/Control statement from DFSPARM
0 0 = No application in effect
0 1 = SORT application in effect
1 0 = MERGE application in effect
1 1 = COPY application in effect
0 = SORTDIAG not being used
1 = SORTDIAG being used
0 = Directly invoked
1 = Program invoked
0 0 = Option from EXEC PARM
0 1 = Control statement from SYSIN
1 0 = Control statement from SORTCNTL
1 1 = Control statement from invoking parameter list
Bit Description
Bits 0 and 1
Indicate the source of the control statement being processed. Information
flags 0 and 1 are set by DFSORT before a call to the EFS program at
Major Call 2 (multiple calls are possible at Major Call 2).
Bit 2 Indicates how DFSORT was invoked. Information flag 2 is set by DFSORT
before Major Call 1 to the EFS program.
Bit 3 Indicates whether diagnostic messages are to be printed. Information flag 3
is set by DFSORT before Major Call 1 to the EFS program.
Bits 4 and 5
Indicate the DFSORT function being run. Information flags 4 and 5 are set
by DFSORT before each call at Major Call 2 and Major Call 3 to the EFS
program (multiple calls are possible at Major Call 2 and Major Call 3).
Bit 6 Indicates the source of PARM options and control statements from
DFSPARM. Information flag 6 is set by DFSORT before each call at Major
Call 2 to the EFS program (multiple calls are possible at Major Call 2).
Bit 7 Indicates whether fixed-length records or variable-length records are to be
processed. Information flag 7 is set by DFSORT before each call at Major
Call 3 to the EFS program (multiple calls are possible at Major Call 3).
Bit 8 Set by the EFS program to inform DFSORT whether to parse or ignore the
control statement returned by the EFS program. Printing of the control
statement is managed by the LISTX/NOLISTX parameters (see OPTION
Control Statement on page 142 for further details). Information flag 8 is set
by the EFS program before returning to DFSORT from each call at Major
Call 2 (multiple calls are possible at Major Call 2).
Message List
Your EFS program can return informational or critical messages. A return code of 0
in general register 15 indicates an informational message while a return code of 16
indicates a critical message. If the EFS program has no messages to send after a
Major Call, it must zero the message list address in the EFS interface parameter
list.
At Major Call 2, if the EFS program finds a syntax error in a control statement, it
can return an offset relative to the start of the string to indicate the location of the
error. DFSORT first prints the control statement in error and then prints another line
containing a dollar symbol ($) at the location indicated by the offset.
Because DFSORT associates the relative offset with a critical message, the EFS
program must return with a return code of 16 in general register 15. If a relative
offset is returned for an EXEC PARM, the relative offset will be ignored. The EFS
program must free any storage it acquired for its messages.
The length field values must not include their own length.
An asterisk (*) indicates that the length is determined by the corresponding length
field.
During the termination phase, the EFS program must free any storage used by
these routines.
The EFS program can provide user exit routine EFS01 to supplement the function
of the DFSORT SORT/MERGE control statements and can provide user exit routine
EFS02 to perform the function of the DFSORT INCLUDE/OMIT control statements.
Register
Use
1 DFSORT places the address of a parameter list in this register.
13 DFSORT places the address of a standard save area in this register. The
area can be used to save contents of registers used by the EFS program
exit routine. The first word of the area contains the characters SM1 in its
three low-order bytes.
14 Contains the address of DFSORT return point.
15 Contains the address of the EFS program exit routine. This register can be
used as the base register for EFS program exit routine. This register is also
used by the EFS program exit routine to pass return codes to DFSORT.
At Major Call 3, DFSORT sends the EFS program a list of offsets into a buffer.
These offsets indicate where in the buffer the EFS program must have the EFS01
routine move the data indicated by the EFS control fields. See Extract Buffer
Offsets List on page 550 for further details. At Major Call 3, the EFS program must
return the address of the EFS01 routine to DFSORT.
During the input phase, DFSORT calls the EFS01 routine for each input record. The
EFS01 exit routine must move all data indicated by the EFS control fields, specified
in the SORT or MERGE FIELDS operand, from the input record to the extract buffer
area as specified by the offsets in the extract buffer offsets list. For each EFS
control field, the total number of bytes moved by EFS01 into the buffer area is
equal to the total number of bytes specified in the mm parameter of the altered
SORT or MERGE operand. Records are ordered according to the altered ms
parameter.
The EFS01 routine is called to extract all EFS control fields to the extract buffer
area each time a new record is brought into the input phase.
DFSORT will do sort or merge processing using the data in the extract buffer, and
will treat the data as binary data.
DFSORT places the address of a parameter list in register 1. The list begins on a
fullword boundary and is three fullwords long. The format of the parameter list is:
Bytes 1 through 4
Address of the extract buffer area
Address of the input record
Address of the EFS program context area
The EFS01 routine must return one of the following return codes in general register
15:
0 The extraction of the EFS control field was successful.
16 The extraction of the EFS control field was unsuccessful; terminate
DFSORT.
At Major Call 3, the EFS program must return the address of the EFS02 routine to
DFSORT.
The EFS02 routine is called to perform the INCLUDE or OMIT comparison logic for
each relational condition containing an EFS field. During the input phase, DFSORT
will call the EFS02 exit routine one or more times for each input record according to
the evaluation defined by the AND, OR, or parentheses. The EFS02 exit routine
must use the correlator identifier to determine the current relational condition being
performed. EFS02 must perform the comparison logic for the current relational
condition as identified by the correlator identifier. Figure 48 repeats Table 70 on
page 549 to illustrate an example of the calling sequences to an EFS02 by
DFSORT.
INCLUDE COND=(15,4,FF,EQ,20,4,FF,AND,40,7,FF,NE,50,7,FF,OR,
30,2,FF,NE,35,2,FF)
INCLUDE COND=(1,4,D2,EQ,1,4,D2,AND,2,7,D2,NE,2,7,D2,OR,
3,2,D2,NE,3,2,D2)
Where: the calling sequence to EFS02 may be summarized with the following
tables:
DFSORT places the address of a parameter list in register 1. The list begins on a
fullword boundary and is three fullwords long. The format of the parameter list is:
The EFS02 exit routine must return one of the following return codes in general
register 15:
0 True
The record passed the INCLUDE or OMIT test for the relational condition of
an EFS field. If applicable, processing continues with the next relational
condition. Otherwise, DFSORT accepts the record if INCLUDE is specified
or omits the record if OMIT is specified.
4 False
The record did not pass the INCLUDE or OMIT test for the relational
condition of an EFS field. If applicable, processing continues with the next
relational condition. Otherwise, DFSORT omits the record if INCLUDE is
specified or includes the record if OMIT is specified.
16 Terminate
An error occurred in processing the INCLUDE or OMIT logic; terminate
DFSORT.
The EFS program user exit routine can return to DFSORT with either 24-bit or
31-bit addressing in effect. The return address that DFSORT placed in register 14
must be used.
Except for the EFS program context area address (which DFSORT sends to the
EFS program user exit routine unchanged), DFSORT handles the EFS program exit
routine parameter list addresses (that is, the pointer to the EFS program exit routine
parameter list and the addresses in the parameter list) as follows:
v If the EFS program exit routine is entered with 24-bit addressing in effect,
DFSORT can pass clean (zeros in the first 8 bits) 24-bit addresses or 31-bit
addresses to the EFS program exit routine. The EFS program exit routine must
return clean 24-bit addresses if the EFS program exit routine returns to DFSORT
with 31-bit addressing in effect.
v If the EFS program exit routine is entered with 31-bit addressing in effect,
DFSORT can pass clean 24-bit addresses or 31-bit addresses to the EFS
program exit routine. The EFS program exit routine must return 31-bit addresses
or clean 24-bit addresses.
The figures illustrate the same points as described in Figure 2 on page 8 with the
following exceptions:
v When record processing is done for an INCLUDE or OMIT control statement, an
EFS02 user exit routine is called to perform the comparison logic for the
relational conditions with EFS fields.
v When record processing is done for a SORT or MERGE control statement, an
EFS01 user exit routine is called to perform the extraction process for EFS
control fields.
SORTIN SORTINnn
SKIPREC
STOPAFT
INREC INREC
SORT MERGE
EFS01 EFS01
SUM SUM
OUTREC OUTREC
Copy Application
SORTIN
SKIPREC
E15 or E15 or
COBOL E15 COBOL E15
INCLUDE EFS02
OMIT
STOPAFT
INREC
COPY
OUTREC
E35 or E35 or
COBOL E35 COBOL E35
SORTOUT OUTFIL
DFSORT calls EFS program EFSPGM at Major Call 1, and EFSPGM sets the
following fields in the EFS interface parameter list:
v Control statement request list
Contains the OPTION operation definer which indicates to DFSORT that the
OPTION control statement is requested by EFSPGM.
v EFSPGM program context area
EFSPGM will be using the context area.
v Message list=0
EFSPGM has no messages for DFSORT to print to the message data set.
General register 15 is set to zero.
Major Call 2
Prior to Major Call 2, DFSORT sets the following fields in the EFS interface
parameter list:
v Action code=4
Major Call 2 is in effect.
v Informational bit flag 4=0 and informational bit flag 5=0
No application is in effect.
EFSPGM requested the OPTION control statement. DFSORT makes a call to EFS
program EFSPGM for each control statement requested; in this case, one.
DFSORT also sets the following fields in the EFS interface parameter list:
v Informational bit flag 0=0 and informational bit flag 1=1
The requested control statement came from SYSIN.
v The original OPTION control statement, including all operands and
corresponding subparameters
OPTION STOPAFT=30,DYNALLOC=3390
v The length of the original OPTION control statement, including all operands and
corresponding subparameters
The original control statement string is 31 bytes long.
DFSORT calls EFS program EFSPGM at Major Call 2, and EFSPGM sets the
following fields in the EFS interface parameter list:
v Informational bit flag 8=1
DFSORT must parse the control statement returned by EFSPGM.
v The altered OPTION control statement, including all operands and
subparameters
OPTION STOPAFT=30,DYNALLOC=3380,EQUALS
v The length of the altered OPTION control statement, including all operands and
subparameters
The altered control statement string is 38 bytes long.
v Message list=0
EFSPGM has no messages for DFSORT to print to the message data set.
General register 15 is set to zero.
Table 71 shows the original control statement sent to EFS program EFSPGM and
the altered control statement returned by EFS program EFSPGM.
Table 71. Original and Altered Control Statements
Original OPTION control statement sent to EFSPGM
OPTION STOPAFT=30,DYNALLOC=3390
OPTION STOPAFT=30,DYNALLOC=3380,EQUALS
Where:
Major Call 3
Prior to Major Call 3, DFSORT sets the following fields in the EFS interface
parameter list:
v Action code=8
Major Call 3 is in effect.
DFSORT calls EFS program EFSPGM at Major Call 3, and EFSPGM sets the
following fields in the EFS interface parameter list:
v EFS01 address=0
Because the SORT control statement has no EFS control fields, the EFS01 user
exit routine is not used.
Because no INCLUDE control statement was supplied (with EFS fields), the
EFS02 user exit routine is not used.
v Message list=0
EFSPGM has no messages for DFSORT to print to the message data set.
General register 15 is set to zero.
DFSORT calls EFS program EFSPGM at Major Call 4, and EFSPGM sets the
following fields in the EFS interface parameter list:
v Message list=0
EFSPGM has no messages for DFSORT to print to the message data set.
Major Call 5
Prior to Major Call 5, DFSORT sets the following fields in the EFS interface
parameter list:
v Action Code=16
Major Call 5 is in effect.
DFSORT calls EFS program EFSPGM at Major Call 5, and EFSPGM does not set
any fields in the EFS interface parameter list but sets general register 15 to zero.
Improving Performance
DFSORT is designed to optimize performance automatically. It sets optimization
variables (such as buffer sizes) and selects the most efficient of several sorting and
merging techniques.
The DFSORT z/OS DFSORT Tuning Guide provides additional information related
to many of the topics covered in this chapter.
Whenever possible:
v Use either EBCDIC character or binary control fields
v Place binary control fields so they start and end on byte boundaries
v Avoid using the alternative collating sequence character translation
v If you know that a fixed-point control field always contains positive values, specify
it as a binary field.
v If you know that a packed decimal or zoned decimal control field always contains
positive values with the same sign (for example, X'C'), specify it as a binary field.
v Use packed decimal format rather than zoned decimal
v If several contiguous character or binary control fields in the correct order of
significance are to be sorted or merged in the same order (ascending or
descending), specify them as one control field
v Avoid overlapping control fields.
v Avoid using locale processing if your SORT, MERGE, INCLUDE, or OMIT
character fields can be processed using the binary encoding of the data.
Efficient Blocking
You can improve the performance of DFSORT significantly by blocking your input
and output records efficiently. Whenever possible, use system-determined optimum
block sizes for your data sets.
For copy applications, Blockset is the only technique used. If your program cannot
use Blockset, DFSORT issues error message ICE160A and stops processing.
Sorting Techniques
One condition that affects which sorting technique DFSORT selects is the type of
device used for intermediate storage. If you use a tape device, the Conventional
technique is used, which is less efficient. For more information on using tape
devices for intermediate storage, see Tape Work Storage Devices on page 576.
The Blockset and Peerage/Vale techniques can be used only with disk work data
sets. These techniques are discussed below.
Notes:
v The Blockset technique might require more intermediate work space than
Peerage/Vale. For more information, see Allocate Temporary Work Space
Efficiently on page 575.
Peerage/Vale Sorting Techniques: When the conditions for use of the Blockset
sorting technique are not met, DFSORT uses Peerage/Vale.
Merging Techniques
For merging applications, DFSORT uses the Blocksetand Conventional techniques.
Note: If Blockset is not selected, you can use a SORTDIAG DD statement to force
message ICE800I, which gives a code indicating why Blockset cannot be
used.
Conventional Merging Technique: When the conditions for use of the Blockset
merging technique are not met, DFSORT uses the Conventional merge technique,
which is less efficient.
Variable-Length Records
When the input data set consists of variable-length records and dynamic allocation
of intermediate data sets is used, specify the average record length as accurately
as possible using AVGRLEN=n in the OPTION statement.
Disk Devices
System performance is improved if storage is specified in cylinders rather than
tracks or blocks. Storage on sort work data sets will be readjusted to cylinders if
possible. The number of tracks per cylinder for disk devices is shown in Table 72.
Table 72. Number of Tracks per Cylinder for Disk Devices
Device Tracks per Cylinder
3380 15
3390 15
9345 15
If WRKSEC is in effect and the work data set is not allocated to virtual I/O,
DFSORT allocates secondary extents as required, even if not requested in the JCL.
Allocating twice the space used by the input data sets is usually adequate for the
work data sets. Certain conditions can cause additional space requirements. These
include:
v Long control words (more than 150 bytes)
v Using different device types or work data sets
v Using an alternative collating sequence
v Low ratio of available storage to input file size.
Care should be taken to ensure that the LRECL parameter of the DCB corresponds
to the actual maximum record length contained in your data set.
Use Compression
The use of compression can significantly reduce the disk storage required for many
types of data and the resulting time DFSORT spends reading and writing that data.
We recommend using compression for your DFSORT input and output data sets as
a way to improve elapsed time performance.
The exact elapsed time improvement you see when using 3390s depends on the
processing techniques used by DFSORT for the particular run, and which data sets
(SORTIN, SORTWKdd, SORTOUT, OUTFIL) reside on 3390s. We recommend that
if you cannot use all 3390s, you use 3390s for SORTIN, SORTOUT, and OUTFIL
data sets in preference to SORTWKdd data sets.
CFW
To improve Blockset sorting performance by taking advantage of the cached 3990
Storage Controls, specify CFW on the DEBUG control statement or CFW=YES as
the installation default (CFW=YES is the IBM-supplied default).
DSA
Performance can be improved for Blockset sort applications by using Dynamic
Storage Adjustment (DSA).
The DSA installation parameter sets the maximum amount of storage available to
DFSORT for dynamic storage adjustment of a Blockset sort application when
SIZE/MAINSIZE=MAX is in effect. If you specify a DSA value greater than the
TMAXLIM value, you allow DFSORT to use more storage than the TMAXLIM value
if doing so should improve performance. DFSORT only tries to obtain as much
storage as needed to improve performance up to the DSA value.
DSPSIZE
Performance can be improved for sort applications that use the Blockset technique
by using dataspace sorting.
The DSPSIZE parameter sets the maximum amount of data space that will be used
for dataspace sorting. The default, DSPSIZE=MAX, permits DFSORT to select the
maximum amount of data space that it uses based on the size of the file being
sorted and the paging activity of your system.
FASTSRT
| By specifying the COBOL FASTSRT compiler option, you can significantly reduce
DFSORT processor time, EXCPs, and elapsed time. With FASTSRT, DFSORT
input/output operations are more efficient because DFSORT rather than COBOL
does the input/output (see Figure 51 on page 569). For more details, see the
| COBOL publications.
The FASTSRT option does not take effect for input and output if input and output
procedures are used in the SORT statement. Many of the functions usually
performed in an input or output procedure are the same as those done by DFSORT
INREC, OUTFIL, OUTREC, INCLUDE or OMIT, STOPAFT, SKIPREC, and SUM
functions. You might be able to eliminate your input and output procedures by
coding the appropriate DFSORT program control statements and placing them in
either the DFSPARM (DFSORT), SORTCNTL (DFSORT), or IGZSRTCD (COBOL)
data set, thereby allowing your SORT statement to qualify for FASTSRT.
SDB
To improve Blockset elapsed time, and disk and tape utilization, specify
SDB=LARGE as your sites installation default (SDB=INPUT is the IBM-supplied
default). SDB=LARGE allows DFSORT to select the system-determined optimum
block size for your disk and tape output data sets, when appropriate.
HIPRMAX
Blockset sorting performance can be improved by using Hiperspace along with disk
for temporary storage.
MOSIZE
| Blockset sorting performance can be improved by using memory object sorting.
| The MOSIZE parameter sets the maximum size of a memory object to be used
| during a run. Specifying MOSIZE=MAX allows DFSORT to optimize the maximum
| size of a memory object to be used during a run, subject to other system and
| concurrent Hipersorting and memory object sorting activity throughout the run. Total
| memory object sorting activity on a system can be further limited by the DFSORT
| installation options EXPMAX, EXPOLD, and EXPRES. See the description of
| MOSIZE in OPTION Control Statement on page 142 for more information.
OUTFIL
If you need to create multiple output data sets from the same input data set, you
can use OUTFIL to read the input data set only once, thus improving performance.
OUTFIL can be used for sort, merge, and copy applications to provide sophisticated
filtering, editing, conversion, lookup and replace, and report features.
If you are creating only a single output data set and do not need the features of
OUTFIL, use SORTOUT rather than OUTFIL for best performance.
LOCALE
You can use the LOCALE option to sort and merge character data based on
collating rules in an active locale; this enables you to obtain results with DFSORT
that were previously possible only through pre- and/or post-processing of your data.
By eliminating such costly processing, you can save time and processing resources.
SUM
You can improve performance by using SUM to add the contents of fields. The
SUM statement adds the contents of specified SUM fields in records with identical
control fields. The result is placed in one record while the other record is deleted,
thus reducing the number of records to be output by DFSORT.
You can use the ZDPRINT=YES installation option or the ZDPRINT run-time option
to specify that positive zoned decimal fields that result from summing are to be
printable. That is, you can tell DFSORT to change the last digit of the zone from
hex C to hex F.
Eliminating Duplicate Records: You can eliminate records with duplicate keys by
specifying
SUM FIELDS=NONE
For a diagram of the processing sequence for record handling statements, user
exits, and options, see Figure 2 on page 8.
ICETOOL
ICETOOL is a multi-purpose utility that allows you to use DFSORTs highly efficient
I/O and processing to perform multiple operations on one or more data sets in a
single job step. ICETOOLs twelve operators allow you to perform sort, copy,
statistical, and report operations quickly and efficiently.
CKPT
The CKPT option might preclude the use of the more efficient Blockset technique.
EQUALS
The EQUALS option increases the time needed for comparison of records and for
data transfer.
EQUCOUNT
The EQUCOUNT option takes additional time to count the number of records with
equal keys.
LOCALE
The LOCALE option may increase the time required to run an application.
NOCINV
The NOCINV option precludes the use of control interval access for more efficient
VSAM processing.
NOBLKSET
The NOBLKSET option precludes the use of the more efficient Blockset technique.
VERIFY
The VERIFY option degrades performance, because it involves extra processing.
The run time required by most user exit routines is generally small, but the routines
at user exits E15, E32, and E35 are entered for each record of the data sets. For
large input data sets, the total run time of these routines can be relatively large.
Dynamic Link-Editing
Dynamic link-editing of user exit routines degrades performance.
EFS Programs
When EFS programs are included in an application, the time required to run the
application might increase.
is especially important with main storage sizes greater than 32MB. The default
amount of main storage that will be made available to DFSORT is defined when it is
installed.
DFSORT requires a minimum of 88KB, but to get better performance, use a much
larger amount of storage. The recommended amount is about 4MB. Improved
performance will be most noticeable with large input files.
Note: When Blockset is selected, DFSORT can place selected buffers above 16MB
virtual. This frees more storage for DFSORT without having to increase the
REGION size. A REGION size of at least 440KB must be available to allow
DFSORT to use storage effectively.
Generally, the most efficient way to allocate (virtual) main storage is to use
MAINSIZE/SIZE=MAX explicitly or by default. However, problems can arise if the
values for the TMAXLIM or MAXLIM installation options have been set excessively
high (or low). Guidelines for setting these values are given in z/OS DFSORT
Installation and Customization.
If you specify MAINSIZE/SIZE=n and give n a value less than that specified for the
MINLIM installation option, MINLIM is used.
If the MINLIM value is greater than that specified for REGION on the EXEC
statement, DFSORT attempts to use the value specified for MINLIM; if it fails to get
the amount specified by MINLIM, DFSORT still tries to run, provided at least 88KB
(below 16MB virtual) are available to DFSORT.
Although DFSORT requires a minimum of 88KB (below 16MB virtual), the minimum
amount of main storage required depends on the application.
For best performance, it is strongly recommended that you use significantly more
than the minimum amount of main storage.
Storage used for OUTFIL processing will be adjusted automatically, depending upon
several factors, including:
v Total available storage
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.
Notes:
1. In some cases, this release of DFSORT may use more storage than prior
releases for comparable applications. This might affect the operation of some
applications. For example, some applications that run as in-storage sorts (with
no SORTWKdd data sets) in previous releases might not run in-storage when
using this release. The amount of storage allocated is normally controlled by
TMAXLIM. A REGION size of at least 440KB must be available if DFSORT is to
achieve acceptable performance. The allocation of storage can be adversely
affected if you have a smaller region value or if DFSORT needs to allocate
buffers below 16MB virtual.
2. For extremely large sorts (for example, 500MB or more of data), make sure that
Hipersorting and dataspace sorting are enabled, or make sure that 16MB or
more of main storage is available to DFSORT.
Your system programmer has set the default storage values according to your sites
major sorting requirements. If you have an overnight or batch time window that
must be met, increasing storage (using REGION or SIZE/MAINSIZE=n) can give
you some relief from the time constraint. If you are concerned with processor time,
decreasing storage (using REGION or SIZE/MAINSIZE=n) can reduce the
processor time associated with sorting small files.
In general, when you vary the amount of storage available to DFSORT, several
things occur:
1. If you increase the amount of storage:
v EXCPs are reduced.
v For larger files, processor time generally decreases; that is, overhead in
managing the extra storage is offset by DFSORT having to make fewer
passes over the data.
v For a very heavily loaded system, elapsed time might increase because
DFSORT can be swapped out more often.
v For very small sorts, processor time might remain stable or increase because
of the overhead in managing the extra storage. For larger files, processor
time will usually decrease because the overhead in managing the extra
storage would be less than the benefit gained by DFSORT making fewer
passes over the data.
2. If you decrease the amount of storage:
v EXCPs increase.
v Elapsed time increases for most sorts.
v Processor time decreases for very small files, but increases for larger files.
Changing the main storage allocation can affect system efficiency. By reducing the
amount of main storage allocated, you impair performance of DFSORT to allow
other programs to have the storage they need to operate simultaneously; by
increasing the allocation, you can run large DFSORT applications efficiently at the
risk of decreasing the efficiency of other applications sharing the multiprogramming
environment.
When SIZE/MAINSIZE is less than REGION, make sure the difference between
SIZE/MAINSIZE and your REGION specification value or default provides sufficient
storage for system or user exit routine use.
Elapsed time is decreased when DFSORT can both read input while writing to
SORTWKdd and write output while reading from SORTWKdd. If, for example, you
have two channels, the best allocation of them is to have SORTIN, SORTOUT, and
OUTFIL data sets on one and the SORTWKdd data sets on the other.
Storage requirements for different disk techniques can be estimated by using the
guidelines found in Appendix A, Using Work Space, on page 615.
DFSORT temporary work data sets allocated to virtual devices (VIO) can provide
reduced elapsed time at the cost of increased CPU time for DFSORT applications.
In general, this is not a good trade-off and VIO should not be used for DFSORT
work data sets unless:
v The system supports VIO in expanded storage, and
v Elapsed time is of primary concern.
If work data sets are allocated to VIO, the ICEMAC option VIO tells DFSORT how
to handle to VIOs:
v VIO=YES causes DFSORT to accept the use of VIOs for work data sets.
v VIO=NO causes DFSORT to reallocate work data sets from virtual devices to
real devices. Note that in order for re-allocation to be successful, a real device
with the same device type as the virtual device must be available.
Increasing the number of work units, however, also reduces the block size used for
intermediate storage; this can become a critical factor if you have relatively little
main storage available for buffers. For example, if DFSORT has only 88KB in which
to operate, you probably achieve no improvement (and might find deterioration) if
you use more than four tape work units. Therefore, apply the general rule of using
as many tapes as possible only when DFSORT has more than 100KB available.
Use Hipersorting
Hipersorting uses Hiperspace. A Hiperspace is a high-performance data space
which resides in expanded storage, or in central storage for 64-bit real mode, and is
backed by auxiliary storage when necessary. With Hipersorting, Hiperspace is used
in place of and along with disk for temporary storage of records during a Blockset
sort. Hipersorting reduces I/O processing which in turn reduces elapsed time,
EXCPs, and channel usage. Hipersorting is recommended when the input or output
is a compressed sequential or VSAM data set.
You can control the maximum amount of Hiperspace for a Hipersorting application
with the HIPRMAX parameter. HIPRMAX can direct DFSORT to dynamically
determine the maximum amount of Hiperspace, subject to the available storage at
the start of the run. You can also use HIPRMAX to suppress Hipersorting when
optimizing CPU time is your major concern because Hipersorting can slightly
degrade CPU time.
Dataspace sorting allows DFSORT to sort large pieces of data at a time. This helps
to reduce CPU time and elapsed time.
The maximum amount of data space used for dataspace sorting can be controlled
with the DSPSIZE option. DSPSIZE=MAX allows DFSORT to select the maximum
data space to use. In this case, the amount used would depend on the size of the
file being sorted and the paging activity of your system. DSPSIZE=0 means that
DFSORT will not use dataspace sorting.
The following functions and types of data sets are not supported for dataspace
sorting:
v Spool, dummy, or pipe data set, or HFS file, as input.
v User exits
v INREC, OUTFIL, OUTREC, and SUM
v EQUCOUNT
Dataspace sorting is seldom used for very small data sets of a few MB or so
because it is more efficient to sort small amounts of data entirely in main storage.
In order for dataspace sorting to be used, you need sufficient available central
storage, that is, unused or not recently used, as reported by SRM at the start of the
sort. Such storage is needed to back the corresponding data space required by
DFSORT. The amount of data space required varies. Typically, it grows as the
amount of data to sort increases, and, it shrinks as the amount of main storage
specified increases.
The following are actions you can take which might increase the use of dataspace
sorting:
v Specify sufficient main storage. The default is 4MB, the recommended minimum
for dataspace sorting. If you increase the amount of main storage specified, more
dataspace sorting is possible, especially when sorting large amounts of data
(multiple hundred MBs). Specifying more than 12MB or so will have no significant
impact on DFSORTs decision to use dataspace sorting; it will, however, improve
the performance of large non-dataspace sort applications.
v Specify generous extent sizes for work data sets, especially for secondary
extents. Dataspace sorting is frequently used in conjunction with disk work space
but never with Hiperspace or with tape work data sets.
v Specify DSPSIZE=MAX.
v Verify that IEFUSI does not place any restrictions on the size of the data spaces
a single address space can create.
v Ensure that DFSORT has accurate information about the input file size. DFSORT
can automatically estimate the file size for disk input data sets and tape data sets
managed by DFSMSrmm or a tape management system that uses ICETPEX.
See File Size and Dynamic Allocation on page 619 for information on situations
where DFSORT cannot determine the file size accurately, and what to do about
it.
| You can control the maximum size of a memory object for a memory object sorting
| application with the MOSIZE parameter. MOSIZE can direct DFSORT to
| dynamically determine the maximum size of a memory object, subject to the
| available central storage at the start of the run. MOSIZE=0 means that DFSORT
| will not use memory object sorting.
| The actual size of a memory object that a memory object sorting application uses
| depends upon several factors. See the MOSIZE description in OPTION Control
| Statement on page 142 for more details.
| The following functions and types of data sets are not supported for memory object
| sorting:
| v Spool, dummy, or pipe data set, or HFS file, as input
| v INREC, OUTREC, and SUM
| v EQUCOUNT
| The following are actions you can take which might increase the use of memory
| object sorting:
| v Verify that a sufficient size for memory objects is defined by the MEMLIMIT
| parameter on the JOB or EXEC JCL statement.
| v Specify MOSIZE=MAX.
| v Specify generous extent sizes for work data sets, especially for secondary
| extents.
| v Verify that IEFUSI does not place any restrictions on the size of the memory
| objects a single address space can create.
| v Ensure that DFSORT has accurate information about the input file size. DFSORT
| can automatically estimate the file size for disk input data sets and tape data sets
| managed by DFSMSrmm or a tape management system that uses ICETPEX.
| See File Size and Dynamic Allocation on page 619 for information on situations
| where DFSORT cannot determine the file size accurately, and what to do about
| it.
| ICEGENER, like IEBGENER, will use an SDB=value parameter you supply using
| PARM='SDB=value', when appropriate. The valid SDB=value parameters are
| SDB=LARGE, SDB=YES, SDB=SMALL, SDB=INPUT and SDB=NO, as explained
| in OPTION Control Statement on page 142. If you supply an invalid SDB=value
| parameter, ICEGENER will transfer control to IEBGENER, which will terminate due
| to the invalid parameter. If you do not supply an SDB=value parameter, ICEGENER
will use your sites DFSORT installation default for SDB, when appropriate (the
IBM-supplied default is SDB=INPUT). If ICEGENER transfers control to IEBGENER,
IEBGENER will use the SDB=value parameter you supply, if any, or its normal
default for SDB.
| ICEGENER will also recognize DFSORT parameters other than SDB=value you
| supply using PARM=parameter that are valid on DFSORTs OPTION statement as
| explained in OPTION Control Statement on page 142. However, IEBGENER does
| not recognize any parameters other than the valid SDB=value forms, so if DFSORT
| must transfer control to IEBGENER, IEBGENER will not recognize DFSORTs
| parameters and will terminate. Likewise, if you supply a DFSORT parameter using
| PARM=parameter that is not valid on DFSORTs OPTION statement, DFSORT will
| transfer control to IEBGENER and IEBGENER will terminate due to the invalid
| parameter.
| Thus, you can pass PARM parameters to ICEGENER that are valid as DFSORT
| OPTION parameters, but you must be aware that if ICEGENER transfers control to
| IEBGENER, those parameters will cause IEBGENER to terminate. PARM
| parameters that are not valid as DFSORT OPTION parameters (even if they are
| valid as DFSORT PARM parameters) will cause ICEGENER to transfer control to
| IEBGENER which will terminate.
However, if you know that ICEGENER will use DFSORT copy, you can use a
DFSPARM data set with ICEGENER to pass control statements and parameters to
DFSORT. For example, if you specify:
//DFSPARM DD *
OPTION SPANINC=RC0
/*
and ICEGENER uses DFSORT copy, any incomplete spanned records DFSORT
detects in a variable spanned input data set are eliminated.
If your site has installed ICEGENER to be invoked by the name IEBGENER, you
need not make any changes to your applications to use ICEGENER. If your site has
not chosen automatic use of ICEGENER, you can use ICEGENER by substituting
the name ICEGENER for IEBGENER on the EXEC statement (when DFSORT is
directly invoked) or LINK macro (when DFSORT is program-invoked) in any
applications you choose. Program-invoked applications must be recompiled.
for the copy application; for example, OPTION. However, ICEGENER can
transfer control to IEBGENER due to DFSPARM or SORTCNTL statement
errors or other errors detected by DFSORT. Therefore, DFSORT copy should be
used directly rather than ICEGENER if DFSORT processing statements such as
INCLUDE, OUTREC, SUM and so on are required.
3. For most error conditions that prevent the use of DFSORT copy, control will be
transferred to the IEBGENER system utility. DFSORT messages will not be
printed unless a SORTDIAG DD statement is supplied. Use of the SORTDIAG
DD statement will allow you to determine why DFSORT copy could not be used.
4. If DFSORT copy is used, its operation and messages will be equivalent to a
directly called DFSORT copy application. If an unrecoverable error is
encountered (for example, an I/O error), DFSORTs return code of 16 will be
changed by ICEGENER to a return code of 12 to emulate the return code from
a failing IEBGENER application.
5. DFSORT copy can perform some functions not provided by IEBGENER, such
as certain padding and truncation operations. ICEGENER processing is not
identical to IEBGENER processing in all cases, since DFSORT copy uses
methods to enhance performance (EXCP, for example) that are not used by
IEBGENER.
6. In some cases, IEBGENER terminates when the SYSUT2 LRECL is different
from the SYSUT1 LRECL. ICEGENER takes one of three actions depending on
ICEMAC option GNPAD (LRECL padding) or GNTRUNC (LRECL truncation), as
appropriate.
If you want ICEGENER to transfer control to IEBGENER when the SYSUT2
LRECL is larger than the SYSUT1 LRECL, use ICEMAC option GNPAD=IEB. If
you want ICEGENER to handle LRECL padding, use GNPAD=RC0 (the
supplied default) or GNPAD=RC4.
If you want ICEGENER to transfer control to IEBGENER when the SYSUT2
LRECL is smaller than the SYSUT1 LRECL, use ICEMAC option
GNTRUNC=IEB. If you want ICEGENER to handle LRECL truncation, use
GNTRUNC=RC0 (the supplied default) or GNTRUNC=RC4.
7. For a call to ICEGENER, or to IEBGENER as an alias for ICEGENER, register
1 must point to a valid parameter list consisting of three addresses as follows:
v Address1: The address of the Option List.
v Address2: The address of the Alternate DDname List.
v Address3: The address of the Page Number List.
Methods of calling ICEGENER which generate a valid parameter list will allow
ICEGENER to use DFSORTs copy feature, whereas methods of calling
ICEGENER which generate an invalid parameter list will cause ICEGENER to
transfer control to IEBGENER. For example:
call *(icegener)
The meanings of the return codes that ICEGENER passes back (in register 15) are:
0 Successful completion. ICEGENER completed successfully.
4 Successful completion. ICEGENER completed successfully, and:
v ICEMAC option GNPAD=RC4 was specified and the SYSUT2 LRECL
was larger than the SYSUT1 LRECL (LRECL padding) or
v ICEMAC option GNTRUNC=RC4 was specified and the SYSUT2 LRECL
was smaller than the SYSUT1 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 SYSUT2
| data set, or
| v NULLOFL=RC4 was in effect and there were no data records for an
| OUTFIL data set.
12 Unsuccessful completion. DFSORT detected an error that prevented
ICEGENER from completing successfully.
24 Unsupported operating system. This operating system is not supported
by this release of DFSORT.
Summary of Examples
The table below summarizes the examples provided in this chapter.
REXX Examples
Both DFSORT and ICETOOL can be called from REXX. The key is to specify
ALLOCATE statements for the data sets you need and then use an ADDRESS
statement like this:
ADDRESS LINKMVS name
which says to fetch the named program using the standard system search list.
Here are the DFSORT control statements that might appear in the
Y897797.SORT.STMTS data set:
SORT FIELDS=(5,4,CH,A)
INCLUDE COND=(21,3,SS,EQ,CL92,J82,M72)
CLIST Examples
Both DFSORT and ICETOOL can be called from a CLIST. They key is to specify
ALLOCATE statements for the data sets you need and then use a CALL statement
like this:
CALL *(name)
Here are the DFSORT control statements that might appear in the
Y897797.SORT.STMTS data set:
SORT FIELDS=(5,4,CH,A)
INCLUDE COND=(21,3,SS,EQ,CL92,J82,M72)
Sort Examples
This section includes 13 sort examples.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls DFSORT directly by its alias SORT.
03 SYSOUT DD statement. Directs DFSORT messages and control statements
to system output class A.
04 SORTIN DD statement. The input data set is named A123456.IN5 and is
cataloged. DFSORT determines from the data set label that the RECFM is
VB, the maximum LRECL is 120, and the BLKSIZE is 2200.
05 SORTOUT DD statement. The output data set is named OUT1 and is to be
allocated on 3490 volume VOL001 and kept. DFSORT sets the RECFM
and LRECL from SORTIN and selects an appropriate BLKSIZE for this
standard labeled tape.
06 SORTWK01 DD statement. The first work data set is allocated on 3390.
07 SORTWK02 DD statement. The second work data set is allocated on 3390.
08 SYSIN DD statement. DFSORT control statements follow.
09 Comment statement. Printed but otherwise ignored.
10 SORT statement. FIELDS specifies an ascending 5-byte character control
field starting at position 7 (the third data byte, since the RDW occupies the
first 4 bytes). The control field is to be collated according to the modified
sequence described in the ALTSEQ statement.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls DFSORT directly by its alias SORT.
03 SYSOUT DD statement. Directs DFSORT messages and control statements
to system output class H.
04-05 SORTIN DD statement. Consists of a concatenation of two data sets. The
first input data set is named INP1 and resides on 3380 volume SCR001.
The second input data set is named INP2 and resides on 3390 volume
SYS351. DFSORT determines from the data set labels that the record
format is FB, the LRECL is 80 and the largest BLKSIZE is 27920.
06-07 SORTOUT DD statement. The output data set is temporary and is to be
allocated on a 3390. Since the OUTREC statement results in a reformatted
output record length of 22 bytes, LRECL=22 must be specified. DFSORT
sets the RECFM from SORTIN and selects an appropriate BLKSIZE.
08 SYSIN DD statement. DFSORT control statements follow.
09 OMIT statement. COND specifies that input records with a character M in
position 5 are to be omitted from the output data set.
10 SORT statement. FIELDS specifies an ascending 8-byte character control
field starting at position 20 and a descending 3-byte fixed-point control field
starting at position 10.
11 SUM statement. FIELDS specifies a 4-byte zoned-decimal summary field
starting at position 16. Whenever two records with the same control fields
(specified in the SORT statement) are found, their summary fields (specified
in the SUM statement) are to be added and placed in one of the records,
and the other record is to be deleted.
12 OPTION statement. DYNALLOC specifies that work data sets are to be
dynamically allocated using the installation defaults for the type of device
and number of devices. ZDPRINT specifies that positive ZD SUM fields are
to be printable.
13 OUTREC statement. FIELDS specifies how the records are to be
reformatted for output. The reformatted records are 22 bytes long and look
as follows:
Position Content
1-3 Input positions 10 through 12
4-11 Input positions 20 through 27
12-15 Input positions 16 through 19
16-17 Zeros
18 Input position 5
19-22 The character string SUM
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Uses the SORTD cataloged procedure to call DFSORT
directly.
03-05 SORTIN DD statement. The input data set is named SRTFIL and resides on
3590 volume 311500. It is to be deleted after this job step. It has a RECFM
of D (variable-length ISCII/ASCII records), a maximum LRECL of 400, a
BLKSIZE of 404 and an ISCII/ASCII label. For this job, the buffer offset is
the block length indicator. The records are to be translated from ISCII/ASCII
to EBCDIC.
06-07 SORTOUT DD statement. The output data set is named OUTFIL and is to
be allocated on 3590 volume 311501 and kept. It is to be written with an
ISCII/ASCII label. DFSORT sets the RECFM and LRECL from SORTIN and
sets the BLKSIZE to 404 as indicated in the DD statement. For this job, the
buffer offset is the block length indicator. The records are to be translated
from EBCDIC to ISCII/ASCII.
08 SORTWK01 DD statement. The work data set is allocated on SYSDA.
09 SYSIN DD statement. DFSORT control statements follow.
10 SORT statement. FIELDS specifies a descending 8-byte ISCII/ASCII control
field starting at position 10.
11 RECORD statement. TYPE specifies ISCII/ASCII variable-length records.
LENGTH specifies that the minimum record length is 20 and the average
record length is 80.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls DFSORT directly.
03 SYSOUT DD statement. Directs DFSORT messages and control statements
to system output class A.
04-05 SORTIN DD statement. The input data set is named INPUT and resides on
3490 volume FLY123. DFSORT determines from the data set label of this
standard labeled tape that the RECFM is V, the LRECL is 120 and the
BLKSIZE is 124.
06-07 SORTOUT DD statement. The output data set is temporary and is to be
allocated on SYSDA. Since the input is unblocked and the output is to be
blocked, RECFM=VB must be specified. DFSORT sets the LRECL from
SORTIN and selects an appropriate BLKSIZE.
08-09 MODLIB DD statement. Specifies the load libraries that contain the exit
routines. When exit routines reside in more than one library, the libraries
must be concatenated using a single DD statement.
10 SYSIN DD statement. DFSORT control statements follow.
11 SORT statement. FIELDS specifies an ascending 4-byte packed-decimal
control field starting at position 23 and an ascending 6-byte floating-sign
control field starting at position 10.
12 OPTION statement. DYNALLOC=(3390,3) specifies that three 3390 work
data sets are to be allocated. AVGRLEN=75 specifies an average record
length of 75. AVGRLEN helps DFSORT optimize work space for
variable-length record input. FILSZ=E50000 specifies an estimate of 50000
records. Since the 3490 input data set is compacted, DFSORT might not be
able to determine the file size accurately unless the data set is managed by
DFSMSrmm or a tape management system that uses ICETPEX.
Specification of FILSZ can make a significant difference in work space
optimization when tape input data sets are not managed.
13 MODS statement. E15 specifies a user exit routine named MODREC.
Approximately 1024 bytes are required for MODREC and the system
services (for example, GETMAIN and OPEN) it performs. E35 specifies a
user exit routine named ADDREC. Approximately 1200 bytes are required
for ADDREC and the system services it performs. MODREC and ADDREC
reside in the libraries defined by the MODLIB DD statement.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls a program named MYPGM that in turn calls
DFSORT.
03 STEPLIB DD statement. Specifies the load library that contains MYPGM.
04 SYSOUT DD statement. Directs DFSORT messages and control statements
to system output class A.
05 SYSPRINT DD statement. Directs MYPGM output to system output class A.
06 SORTIN DD statement. The input data set is member MASTER in the
cataloged partitioned data set M999999.INPUT. DFSORT determines the
RECFM, LRECL and BLKSIZE from the data set label.
07 SORTOUT DD statement. The output data set is named
M999999.OUTPUT.FILE and is cataloged. DFSORT determines the
RECFM, LRECL and BLKSIZE from the data set label.
08 SORTCNTL DD statement. DFSORT control statements follow. Statements
in SORTCNTL override or supplement statements passed by MYPGM in
the DFSORT parameter list it uses.
09 OPTION statement. CHALT specifies that character format control fields
(specified in the SORT statement passed by MYPGM) are to be sorted
using the installation default ALTSEQ table. DYNALLOC=(,3) specifies that
three work data sets are to be dynamically allocated using the installation
default for the type of device. FILSZ=U25000 specifies a file size of 25000
records is to be used by DFSORT to determine the amount of work space
needed. Since the input data set is a member of a PDS, specifying FILSZ
helps DFSORT optimize work data set space.
For purposes of illustration, assume that none of the standard installation defaults
for batch direct invocation of DFSORT have been changed by the site.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls DFSORT directly by its alias SORT.
03 SYSOUT DD statement. Directs DFSORT messages and control statements
to system output class A.
04 SORTIN DD statement. The input data set is TEST.SORTIN.FILE. DFSORT
determines that it is a VSAM data set and obtains its attributes from the
catalog.
05 SORTOUT DD statement. The output data set is TEST.SORTOUT.FILE.
DFSORT determines that it is a VSAM data set and obtains its attributes
from the catalog.
06 DFSPARM DD statement. DFSORT control statements follow. DFSPARM
can be used for both direct-invocation and program-invocation of DFSORT
and overrides options and statements from all other sources. Certain
operands, such as MSGPRT and LIST/NOLIST, are used if supplied in
DFSPARM, the EXEC PARM or the invocation parameter list, but not used
if supplied in SYSIN or SORTCNTL.
07 RECORD statement. TYPE=V specifies that DFSORT is to treat the VSAM
records as variable-length. In this case, the RECORD statement could be
omitted, since DFSORT would automatically set a record type of V due to
the use of VSAM data sets for SORTIN and SORTOUT.
08 SORT statement. FIELDS specifies an ascending 4-byte binary control field
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls DFSORT directly by its alias name SORT.
MSGDDN=DFSOUT specifies an alternate message data set for DFSORT
messages and control statements to prevent the COBOL messages in
SYSOUT from being interleaved with the DFSORT messages and control
statements.
| 03 STEPLIB statement. Specifies the Language Environment library.
04 SYSOUT statement. Directs COBOL messages to system output class A.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Uses the SORT cataloged procedure to call DFSORT
directly and supply the DD statements (not shown) required by the linkage
editor.
03 SORTIN DD statement. The input data set is named SMITH.INPUT and is
cataloged. DFSORT determines the RECFM, LRECL and BLKSIZE from
the data set label.
04-05 SORTOUT DD statement. The output data set is named SMITH.OUTPUT
and is to be allocated on 3380 volume XYZ003 and cataloged. DFSORT
sets the RECFM and LRECL from SORTIN and selects an appropriate
BLKSIZE.
06 SORTWK01 DD statement. The work data set is allocated on SYSDA.
07 EXIT DD statement. Specifies the partitioned data set containing the object
decks for the E11, E18, E31, E35 and E38 exit routines.
08 EXIT2 DD statement. Specifies the partitioned data set containing the
object deck for the E17 exit routine.
-----------------------------------------------------------------------
MYSORT CSECT 11
.
.
.
LA R1,PL1 SET ADDRESS OF PARAMETER LIST 12
* TO BE PASSED TO DFSORT 13
ST R2,PL4 SET ADDRESS OF GETMAINED AREA 14
* TO BE PASSED TO E15 15
LINK EP=SORT INVOKE DFSORT 16
.
.
.
PL1 DC A(CTLST) ADDRESS OF CONTROL STATEMENTS 17
PL2 DC A(E15) ADDRESS OF E15 ROUTINE 18
PL3 DC A(0) NO E35 ROUTINE 19
PL4 DS A USER EXIT ADDRESS CONSTANT 20
PL5 DC F-1 INDICATE END OF LIST 21
CTLST DS 0H CONTROL STATEMENTS AREA 22
DC AL2(CTL2-CTL1) LENGTH OF CHARACTER STRING 23
CTL1 DC C SORT FIELDS=(5,8,CSF,A) 24
DC C RECORD TYPE=F,LENGTH=80 25
DC C OPTION FILSZ=E25000,DYNALLOC, 26
DC CRESINV=8000 27
DC C OMIT FORMAT=CSF,COND=(5,8,EQ,13,8) 28
CTL2 EQU * 29
OUT DCB DDNAME=MSGOUT,... 30
E15 DS 0H E15 ROUTINE 31
.
.
.
L R2,4(,R1) GET ADDRESS OF GETMAINED AREA 32
.
.
.
BR R14 RETURN TO DFSORT 33
.
.
.
The JCL for running program MYSORT, and highlights of the code used by
MYSORT to invoke DFSORT with the extended parameter list, are shown below.
For purposes of illustration, assume that none of the standard installation defaults
for batch program invocation of DFSORT have been changed by the site.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls a program named MYSORT that in turn calls
DFSORT.
03 SYSOUT DD statement. Directs DFSORT messages and control statements
to SYSOUT class C.
04 MSGOUT DD statement. Directs MYSORT messages to SYSOUT class C.
05 STEPLIB DD statement. Specifies the load library that contains MYSORT.
06-07 SORTOUT DD statement. The output data set is temporary and is to be
allocated on SYSDA. Since SORTIN is not used, DFSORT sets the RECFM
and LRECL from the RECORD statement and sets the BLKSIZE to the
LRECL (unblocked records).
08 SORTCNTL DD statement. DFSORT control statements follow. Statements
in SORTCNTL override or supplement statements passed by MYSORT in
the extended parameter list it uses.
09 Comment statement. Printed but otherwise ignored.
10 OPTION statement. FILSZ=E30000 specifies an estimate of 30000 records,
overriding FILSZ=E25000 in the OPTION statement of the extended
parameter list. Since the E15 routine supplies all of the input records,
DFSORT will not be able to determine the file size accurately; therefore,
specifying FILSZ can make a significant difference in work space
optimization when an E15 routine supplies all of the input records. Its
important to change the FILSZ value whenever the number of input records
increases significantly.
11 This is the start of program MYSORT. Assume that it GETMAINs a work
area, saves its address in register 2, and initializes it with information to be
used by the E15 routine.
12-13 MYSORT places the address of the extended parameter list to be passed to
DFSORT in register 1.
14-15 MYSORT places the address of the GETMAINed work area in the user exit
address constant field in the extended parameter list. DFSORT will pass
this address to the E15 routine (in the second word of the E15 parameter
list) when it is entered.
16 MYSORT calls DFSORT by its alias SORT.
17-21 The extended parameter list specifies: the address of the control statements
area, the address of the E15 routine, that no E35 routine is present, and
the address of the GETMAINed work area. F-1 indicates the end of the
extended parameter list. Subsequent parameter list fields, such as the
address of an ALTSEQ table, are not used in this application.
Since the address of the E15 routine is passed in the parameter list,
SORTIN cannot be used; if a SORTIN DD statement were present, it would
be ignored.
22-23 This is the start of the control statements area. The total length of the
control statements is specified.
24 SORT statement. FIELDS specifies an ascending 8-byte floating-sign
control field starting at position 5.
25 RECORD statement. TYPE=F and LENGTH=80 specify that the E15 inserts
fixed-length records of 80 bytes. In this case, TYPE=F could be omitted,
since DFSORT would automatically set a record type of F. However,
LENGTH must be specified when an E15 supplies all of the input records.
26-27 OPTION statement. FILSZ=E25000 specifies an estimate of 25000 records,
which is overridden by FILSZ=E30000 in SORTCNTLs OPTION statement.
DYNALLOC specifies that work data sets are to be dynamically allocated
using the installation defaults for the type of device and number of devices.
RESINV=8000 specifies that approximately 8000 bytes are required for the
system services (for example, GETMAIN and OPEN) that MYSORTs E15
exit routine performs.
28 OMIT statement. FORMAT specifies that the compare fields are
floating-sign. COND specifies that input records with equal 8-byte
floating-sign compare fields starting in position 5 (also the control field) and
position 13 are to be omitted from the output data set.
29 This is the end of the control statements area.
30 This is the DCB for MYSORTs MSGOUT output.
31-33 This is MYSORTs E15 routine. The E15 routine loads the address of the
GETMAINed work area from the second word of the E15 parameter list.
The E15 routine must supply each input record by placing its address in
register 1 and placing a 12 (insert) in register 15. When all the records have
been passed, the E15 routine must place an 8 (do not return) in register
15.
OUTFIL FNAMES=(ALLGPS,ALLBU) 12
OUTFIL FNAMES=G1STATS, 13
INCLUDE=(1,3,CH,EQ,CG01), 14
HEADER2=(1:GROUP 1 STATUS REPORT FOR ,&DATE, 15
- PAGE ,&PAGE,2/, 16
6:ITEM ,16:STATUS ,31:PARTS,/, 17
6:-----,16:------------,31:-----), 18
OUTREC=(6:6,5, 19
16:14,1,CHANGE=(12, 20
C1,CSHIP, 21
C2,CHOLD, 22
C3,CTRANSFER), 23
NOMATCH=(C*CHECK CODE*), 24
31:39,1,BI,M10,LENGTH=5, 25
120:X) 26
OUTFIL FNAMES=G2STATS, 27
INCLUDE=(1,3,CH,EQ,CG02), 28
HEADER2=(1:GROUP 2 STATUS REPORT FOR ,&DATE, 29
- PAGE ,&PAGE,2/, 30
6:ITEM ,16:STATUS ,31:PARTS,/, 31
6:-----,16:------------,31:-----), 32
OUTREC=(6:6,5, 33
16:14,1,CHANGE=(12, 34
C1,CSHIP, 35
C2,CHOLD, 36
C3,CTRANSFER), 37
NOMATCH=(C*CHECK CODE*), 38
31:39,1,BI,M10,LENGTH=5, 39
120:X) 40
Line Explanation
01 JOB statement. Introduces this job to the operating system.
INPUT Pipes
OUTPUT
Pipes
WORK DATA SETS
Dynamically allocated
USER EXITS
None
FUNCTIONS/OPTIONS
FILSZ, OUTFIL, DYNALLOC
//EXAMP JOB A400,PROGRAMMER 01
//RUNSORT EXEC PGM=ICEMAN 02
//SYSOUT DD SYSOUT=H 03
//SORTIN DD DSN=INPUT.PIPE,SUBSYS=PIPE, 04
// DCB=(LRECL=60,RECFM=FB,BLKSIZE=32760) 05
//OUT1 DD DSN=OUTPUT.PIPE1,SUBSYS=PIPE, 06
// DCB=(LRECL=60,RECFM=FB,BLKSIZE=32760) 07
//OUT2 DD DSN=OUTPUT.PIPE2,SUBSYS=PIPE, 08
// DCB=(LRECL=60,RECFM=FB,BLKSIZE=32760) 09
//SYSIN DD * 10
OPTION DYNALLOC,FILSZ=U1000000 11
SORT FIELDS=(1,20,CH,A,25,4,BI,A) 12
OUTFIL FNAMES=(OUT1,OUT2),SPLIT 13
Line Explanation
01 Job statement. Introduces this job to the operating system.
02 EXEC statement. Calls DFSORT directly.
03 SYSOUT DD statement. Directs DFSORT messages and control statements
to system output class H.
04-05 SORTIN DD statement. The SUBSYS=PIPE parameter directs the
allocation to the PIPE subsystem for the pipe named INPUT.PIPE. The
DCB statement describes the data set characteristics to subsystem PIPE.
06-07 OUT1 DD statement. The SUBSYS=PIPE parameter directs the allocation
to the PIPE subsystem for the pipe named OUTPUT.PIPE1. The DCB
statement describes the data set characteristics to subsystem PIPE.
08-09 OUT2 DD statement. The SUBSYS=PIPE parameter directs the allocation
to the PIPE subsystem for the pipe named OUTPUT.PIPE2. The DCB
statement describes the data set characteristics to subsystem PIPE.
10 SYSIN DD statement. DFSORT control statements follow.
11 OPTION statement. DYNALLOC specifies that work data sets are to be
dynamically allocated using the installation defaults for type of device and
number of devices. FILSZ=U1000000 specifies an estimate of one million
input records.
12 SORT statement. FIELDS specifies an ascending 20-byte character control
field starting at position 1 and an ascending 4 byte binary control field
starting at position 25.
13 OUTFIL statement. The records from the SORTIN pipe are sorted and
written alternatively to the OUT1 and OUT2 pipes (that is, the sorted
records are split evenly between the two output pipes).
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls DFSORT directly by its alias name SORT. LOCALE
specified in EXEC PARM overrides installation default for LOCALE. The
locale for the French language and the cultural conventions of Canada will
be active.
03 STEPLIB DD statement. Specifies the Language Environment run-time
library containing the dynamically loadable locales.
04 SYSOUT statement. Directs DFSORT messages and control statements to
sysout class A.
05 SORTIN DD statement. The input data set is named
INPUT.FRENCH.CANADA and is cataloged. DFSORT determines the
RECFM, LRECL and BLKSIZE from the data set label.
06 SORTOUT DD statement. The output data set is named
OUTPUT.FRENCH.CANADA and is cataloged. DFSORT determines the
RECFM, LRECL and BLKSIZE from the data set label.
07 SYSIN DD statement. DFSORT control statements follow.
08 SORT statement. FIELDS specifies an ascending 20-byte character control
field starting at position 1, a one-byte descending binary control field
starting at position 25, and a 10-byte ascending character control field
starting at position 30. The character (CH) control fields will be sorted
according to the collating rules defined in locale FR_CA.
09 INCLUDE statement. COND specifies that only input records with equal
6-byte character compare fields starting in position 40 and position 50 are
to be included in the output data set. The character (CH) compare fields will
be compared according to the collating rules defined in locale FR_CA.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls DFSORT directly by its alias name SORT.
03 SYSOUT DD statement. Directs DFSORT messages and control statements
to system output class A.
04-05 SORTIN DD statement. The first input file is an HFS file named
/user/hfs.inp1.txt. Only read access is allowed. The file is defined as a text
file. It has fixed-length records with a record size of 80 and a block size of
240.
06-07 The second input file is an HFS file named /user/hfs.inp2.txt. Only read
access is allowed. The file is defined as a text file. It has fixed-length
records with a record size of 80 and a block size of 80.
08-09 SORTOUT DD statement. The output file is an HFS file named
/user/hfs.ut.txt. Only write access is allowed. The file is defined as a text
file. It has fixed-length records with a record size of 80 and a block size of
80.
10 SYSIN DD statement. DFSORT control statements follow.
11 SORT statement. FIELDS specifies an ascending 8-byte character control
field starting at position 10.
Merge Examples
This section contains 2 merge examples.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls DFSORT directly by its alias SORT.
03 SYSOUT DD statement. Directs DFSORT messages and control statements
to sysout class A.
04 SORTIN01 DD statement. The first input data set is named M1234.INPUT1
and is cataloged. DFSORT determines the RECFM, LRECL and BLKSIZE
from the data set label.
05 SORTIN02 DD statement. The second input data set is named
M1234.INPUT2 and is cataloged. DFSORT determines the RECFM, LRECL
and BLKSIZE from the data set label.
06 SORTIN03 DD statement. The third input data set is named M1234.INPUT3
and is cataloged. DFSORT determines the RECFM, LRECL and BLKSIZE
from the data set label.
07-08 SORTOUT DD statement. The output data set is named M1234.MERGOUT
and is to be allocated on 3390 and kept. DFSORT sets the RECFM and
LRECL from the SORTINnn data sets and selects an appropriate BLKSIZE.
09 SYSIN DD statement. DFSORT control statements follow.
10 MERGE statement. FIELDS specifies an ascending 8-byte character control
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls DFSORT directly by its alias name SORT.
03 STEPLIB DD statement. Specifies the Language Environment run-time
library containing the dynamically loadable locales.
04 SYSOUT statement. Directs DFSORT messages and control statements to
sysout class A.
05 SORTIN01 DD statement. The first input data set is named
INPUT01.GERMAN.GERMANY and is cataloged. DFSORT determines the
RECFM, LRECL and BLKSIZE from the data set label.
06 SORTIN02 DD statement. The second input data set is named
Copy Examples
This section contains 2 copy examples.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02-03 EXEC statement. Calls DFSORT directly by its alias SORT. SKIPREC=500
specifies that the first 500 input records are not to be included in the output
data set. MSGPRT=CRITICAL specifies that error messages, but not
informational messages, are to be printed. ABEND specifies that DFSORT
is to terminate with a user ABEND if it issues an error message.
04 SYSOUT DD statement. Directs DFSORT messages and control statements
to sysout class A.
05-07 SORTIN DD statement. The input data set is named FLY.RECORDS and
resides on 3490 volumes 000333 and 000343. The UNIT parameter
requests two tape drives, one for each volume of the data set. Because the
tape is unlabeled, DCB parameters must be supplied to indicate that the
RECFM is FB, the LRECL is 12000 and the BLKSIZE is 24000.
08 SORTOUT DD statement. The output data set is named
FLY.RECORDS.COPY and is cataloged. DFSORT determines the RECFM,
LRECL and BLKSIZE from the data set label.
09 SYSIN DD statement. DFSORT control statements follow.
10 SORT statement. FIELDS=COPY specifies a copy application.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls DFSORT directly by its alias SORT.
03 SYSOUT DD statement. Directs DFSORT messages and control statements
to sysout class A.
04 SORTIN DD statement. The input data set is named SMF.DATA and is
cataloged. DFSORT determines from the data set label that the RECFM is
VBS, the LRECL is 32760 and the BLKSIZE is 23476.
05-06 SORTOUT DD statement. The output data set is named SMF.VIOL and is
to be allocated on SYSDA and kept. DFSORT sets the RECFM and LRECL
from SORTIN and selects an appropriate BLKSIZE.
07 SYSIN DD statement. DFSORT control statements follow.
08 INCLUDE statement. COND specifies that only input records with decimal
80 in the 1-byte fixed-point field at position 6 and bit 0 on in the 1-byte
binary field at position 19 are to be included in the output data set.
09 OPTION statement. COPY specifies a copy application. VLSHRT specifies
that records which are too short to contain all of the INCLUDE compare
fields are not to be included in the output data set.
ICEGENER Example
This section contains an ICEGENER example.
This example shows how to use the ICEGENER facility for an IEBGENER job if
your site has not installed ICEGENER as an automatic replacement for IEBGENER.
The ICEGENER facility selects the more efficient DFSORT copy function for this
IEBGENER job.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls the ICEGENER facility. PGM=IEBGENER has been
replaced by PGM=ICEGENER.
03-06 No other changes to the IEBGENER job are required.
ICETOOL Example
This section contains an example of ICETOOL with various operators.
//CJ82CNTL DD * 37
* Select J82 employees, reformat fields, and insert text 38
INCLUDE COND=(45,3,CH,EQ,CJ82) 39
OUTREC FIELDS=(21,10,X,1,15,Cis in department J82,34X) 40
//IN1 DD DSN=FLY.INPUT1,DISP=SHR 41
//OUTJ69D DD DSN=&&OUTJ69D,DISP=(,PASS),SPACE=(TRK,(10,10)), 42
// UNIT=SYSDA 43
//OUTJ82D DD DSN=&&OUTJ82D,DISP=(,PASS),SPACE=(TRK,(10,10)), 44
// UNIT=SYSDA 45
//CONCAT DD DSN=*.OUTJ69D,VOL=REF=*.OUTJ69D,DISP=(OLD,PASS) 46
// DD DSN=*.OUTJ82D,VOL=REF=*.OUTJ82D,DISP=(OLD,PASS) 47
//ABCDCNTL DD * 48
* Sort by last name, first name 49
SORT FIELDS=(12,15,CH,A,1,10,CH,A) 50
//DEPTSD DD DSN=FLY.OUTPUT1,DISP=SHR 51
//DEPTSP DD SYSOUT=A 52
//IN2 DD DSN=FLY.INPUT2,DISP=SHR 53
//OUT4 DD DSN=FLY.OUTPUT2,DISP=OLD 54
//CTL1CNTL DD * 55
* Sort and produce totals in one record for each unique key 56
SORT FIELDS=(5,10,CH,A) 57
SUM FIELDS=(22,6,PD,30,3,ZD) 58
//LIST1 DD SYSOUT=A 59
This example shows how ICETOOL can be used to perform multiple operations in a
single step.
Line Explanation
01 JOB statement. Introduces this job to the operating system.
02 EXEC statement. Calls ICETOOL specifying the recommended REGION of
1024K.
03 TOOLMSG DD statement. Directs ICETOOL messages and statements to
system output class A.
04 DFSMSG DD statement. Directs DFSORT messages and control
statements to SYSOUT class A.
05 TOOLIN DD statement. ICETOOL statements follow. The MODE for the
ICETOOL run is initially set to STOP. If an error is detected for an operator,
SCAN mode will be entered.
06 Comment statement. Printed but otherwise ignored.
07-10 OCCUR operator. Prints, in the LT5 data set, a report detailing each value
for the specified field in the IN1 data set and the number of times that value
occurs.
11 Comment statement.
12 COPY operator. Records from the IN1 data set are copied to the OUTJ69D
data set using the DFSORT control statements in the CJ69CNTL data set.
As a result, &&OUTJ69D contains a reformatted subset of the records from
FLY.INPUT1 (those records containing J69 in the positions 45-47).
13 COPY operator. Records from the IN1 data set are copied to the OUTJ82D
data set using the DFSORT control statements in the CJ82CNTL data set.
As a result, &&OUTJ82D contains a reformatted subset of the records from
FLY.INPUT1 (those records containing J82 in the positions 45-47).
14 Comment statement.
15 SORT operator. Records from the CONCAT data sets are sorted to the
DEPTSD and DEPTSP data sets using the DFSORT control statements in
the ABCDCNTL data set. As a result, FLY.OUTPUT1 and DEPTSP
(SYSOUT) contain the sorted combined records from &&OUTJ69D and
&&OUTJ82D
16-17 Comment statements.
18 MODE operator. The MODE is reset to STOP (needed in case SCAN mode
was entered due to an error for a previous operator). If an error is detected
for a subsequent operator, SCAN mode will be entered. This divides the
previous operators and subsequent operators into two unrelated groups.
19 Comment statement.
20 VERIFY operator. Identifies invalid values, if any, in the specified decimal
fields of the IN2 data set. Used to stop subsequent operations if any invalid
value is found in FLY.INPUT2.
21 Comment statement.
22 STATS operator. Prints the minimum, maximum, average, and total for the
specified fields of the IN2 data set.
ON(VLEN) operates on the record length of the records in FLY.INPUT2.
Thus, the values printed for ON(VLEN) represent the shortest record, the
longest record, the average record length, and the total number of bytes for
FLY.INPUT2.
23 Comment statement.
24 SORT operator. Records from the IN2 data set are sorted and summarized
to the OUT4 data set using the DFSORT control statements in the
CTL1CNTL data set. As a result, FLY.OUTPUT2 contains one record from
FLY.INPUT2 for each unique sort field with totals for the sum fields.
25-27 Comment statements.
28-31 DISPLAY operator. Prints, in the LIST1 data set, a report detailing each sort
and sum value for the OUT4 data set resulting from the previous operation,
and the lowest and highest value for each sum field.
32-59 DD statements. Defines the data sets and DFSORT control statements
used for the ICETOOL operations described above.
Introduction
When a sort application cannot be performed entirely in virtual storage, DFSORT
must use work space. The amount of work space required depends on:
v The amount of data being sorted
v The amount of virtual storage available to DFSORT
v The amount of Hiperspace available to DFSORT
v The type of devices you use
v The DFSORT functions and features you use (for example, VLSHRT, locale
processing, EFS, and ALTSEQ can increase the amount of work space required).
There are three ways to supply work space for a DFSORT application:
v Hiperspace
v Dynamic allocation of work data sets
v JCL allocation of work data sets.
Hiperspace
Hiperspace is the most efficient form of intermediate storage for DFSORT. Using the
default ICEMAC option HIPRMAX=OPTIMAL ensures that DFSORT will use
Hiperspace for Hipersorting whenever possible. Sites can tune their definition of
HIPRMAX=OPTIMAL through use of the ICEMAC parameters EXPMAX, EXPOLD,
and EXPRES. See z/OS DFSORT Installation and Customization for more
information.
DFSORT only uses Hipersorting when there is sufficient storage to back all the
DFSORT Hiperspace data. Hipersorting is very dynamic: multiple concurrent
Hipersorting applications always know each others storage needs and never try to
back their Hiperspaces with the same portion of storage. In addition, DFSORT
checks the available storage throughout the run, and switches from using
Hiperspace to using disk work data sets when either a storage shortage is predicted
| or the total Hipersorting and memory object sorting activity on the system reaches
the limits set by the DFSORT installation options EXPMAX, EXPOLD, and
EXPRES.
Using tape devices for work data sets rather than disk causes significant
performance degradation for the following reasons:
v Tape work data sets prevent DFSORT from using its more efficient sorting
techniques, Blockset and Peerage/Vale. Disk work data sets allow DFSORT to
use these techniques.
v Tape work data sets must be accessed sequentially. Disk data sets can be
accessed randomly.
v Disk control units can provide additional features, such as cache fast write, that
are not available with tape devices.
Number of Devices
Although one work data set is sufficient, using two or more work data sets on
separate devices usually reduces the elapsed time of the application significantly. In
general, using more than three work data sets does not reduce elapsed time any
further, and is only necessary if the work data sets are small or the file size is large.
No more than 255 work data sets can be specified. If you specify more than 32
work data sets, and the Blockset technique is not selected, a maximum of 32 work
data sets is used.
Under some circumstances, DFSORT does not perform as well when using
ESCON channels as it does when using parallel channels. The two types of
applications most likely to cause a noticeable decrease in performance are:
1. Applications where DFSORT cannot accurately determine the size of the file to
be sorted. These applications often involve DFSORT E15 user exits that insert
records into the sorting process.
2. Sort applications with a low ratio of available storage to input file size.
v As the amount of Hiperspace available to the application varies from run to run,
DFSORT can automatically adjust the amount of space it dynamically allocates to
complement the amount of Hiperspace. This eliminates unneeded allocation of
disk space.
JCL allocation is fixed; DFSORT cannot adjust it, even if all sorting can be done
in Hiperspace. Disk space might be wasted.
Dynamic allocation has one drawback: for certain applications, as described in File
Size and Dynamic Allocation on page 619, you might need to give DFSORT a
reasonable estimate of the input file size. Later, if the input file size for the
application increases significantly, you must update the file size estimate
accordingly.
However, JCL allocation has a similar drawback, except that it applies to all
applications. Unless you overallocate the work data sets initially and waste space,
you have to update the JCL allocation when the input file size increases significantly
for any application to avoid out-of-space abends.
If you can allocate enough work data set space with JCL to guarantee your
applications will never exceed the space allocated, you do not need dynamic
allocation. However, since efficient use of disk space is usually desirable, dynamic
allocation is recommended over JCL allocation.
Device Defaults
When the device type, or the number of devices for dynamic allocation, is not
explicitly specified, DFSORT obtains the missing information from the DYNALOC
installation option information supplied by your system programmer.
In the above circumstances, if the number of records is not supplied by the FILSZ
or SIZE option, you will receive message ICE118I. If dynamic allocation of work
data sets is used, DFSORT allocates the primary space according to the DYNSPC
value in effect. This can result in underallocation or overallocation, possibly leading
to wasted space or an out-of-space condition, respectively. If this happens, you
should specify FILSZ=En with a reasonably accurate estimate of the number of
records to be sorted. If you cannot specify FILSZ=En, you should use DYNSPC=n
to adjust the primary space for dynamically allocated work data sets, as
appropriate.
For variable-length records, DFSORT uses one-half of the maximum record length
(LRECL) in conjunction with the number of records to determine the input file size,
unless you specify AVGRLEN=n. If your actual average record length is significantly
different from one-half of the maximum record length, specifying AVGRLEN=n can
prevent DFSORT from overallocating or underallocating dynamic work space.
See OPTION Control Statement on page 142 for more information about the
AVGRLEN, DYNSPC, FILSZ, and SIZE options.
Dynamic over-allocation of work space can occur when you do not specify the
number of records (for example, with small input data sets on tape), or even when
you do (for example, when a significant number of records is deleted). In these
cases, you might prefer to use JCL allocation of work data sets to control the
amount of space allocated. However, there are drawbacks to doing so, as
previously explained. If DYNAUTO=IGNWKDD is used, remember to specify
run-time option USEWKDD when you want to use JCL allocation of work data sets.
Because of the number of variables involved, an exact formula cannot be given for
calculating the needed work space. However, the following guidelines usually hold
true:
v For fixed length record (FLR) sort applications, 1.5 to 2 times the input file size is
usually adequate.
v For variable-length record (VLR) sort applications, 1.5 to 2.5 times the input file
size is usually adequate.
These guidelines assume that a reasonable amount of storage (at least 1M) is
available to DFSORT. Limiting the available amount of storage can increase the
amount of needed work space.
DFSORT can often run with less than the amount of work space indicated by the
above guidelines.
To get the best performance using JCL allocation of work data sets:
v Use devices without much activity on them.
v For best performance, use emulated 3390-9 devices (such as RAMAC) or other
high-speed IBM disk devices for work data sets, and avoid using tape, virtual
(VIO) or real 3390-9 devices for work data sets.
v Allocate space in cylinders.
v Specify contiguous space for each work data set, and make sure there is enough
primary space so that secondary space is not needed.
v Allocate two or more work data sets.
v Assign one work data set per actuator.
v Use multiple channel paths to the devices.
v Use different spindles and separate channel paths for the work data sets and the
input/output data sets.
The following table shows the work data set space needed with 4M of storage for
| applications with various characteristics when Hipersorting, dataspace sorting, and
| memory object sorting are not used (HIPRMAX=0, DSPSIZE=0 and MOSIZE=0).
Table 74. Work Space Requirements for Various Input Characteristics
Input Data set Characteristics Cylinders (3390)
Filesize (MB) FLR/VLR Max LRECL BLKSIZE Input Data Work Data
Set Set
4 FLR 80 27920 6 6
4 FLR 160 27840 6 6
20 FLR 80 27920 26 36
20 FLR 160 27840 26 36
20 FLR 1000 27000 26 36
40 FLR 80 27920 51 56
40 FLR 160 27840 51 56
40 FLR 1000 27000 52 56
150 FLR 160 27840 189 198
4 VLR 300 27998 6 9
40 VLR 300 27998 51 63
40 VLR 6000 27998 55 59
150 VLR 300 27998 188 200
150 VLR 6000 27998 203 200
For best performance, use emulated 3390-9 devices (such as RAMAC) or other
high-speed IBM disk devices for work data sets, and avoid using real 3390-9
devices for work data sets.
System performance is improved if work data sets are specified in cylinders, rather
than tracks or blocks. Storage on temporary work data sets will be readjusted to
cylinders if possible. The number of tracks per cylinder for disk devices is shown in
Table 75.
Table 75. Number of Tracks per Cylinder for Disk Devices
Maximum Bytes used
Device Tracks per Cylinder per Track
3380 15 47476
3390 15 56664
9345 15 46456
If WRKSEC is in effect and the work data set is not allocated to VIO, DFSORT
allocates secondary extents as required, even if not requested in the JCL.
DFSORT normally allocates secondary extents for work data sets, even if not
requested in the JCL. This reduces the probability of exceeding work space
capacity.
If the disk work space is not sufficient to perform the sort, DFSORT issues a
message and terminates.
Three different tape work data set techniques are available to DFSORT: Balanced,
Polyphase, and Oscillating. For information on how to calculate their requirements,
see Table 76.
Note: The value you obtain for min is literally a minimum value; if, for example,
your input uses a more efficient blocking factor than DFSORT or is spanned,
you need more work space. Space requirements are also summarized in
Table 76. DFSORT selects the most appropriate tape technique using these
criteria.
Table 76. Work Space Requirements of the Various Tape Techniques
Work Space Areas Max. No. of
Tape Technique Maximum Input Required Work Areas Comments
Balanced tape 15 volumes Min=2(V+1)* tape units 32 volumes Used if more than three work
(BALN) storage tapes are provided
and file size is not given.
Polyphase tape 1 volume Min=3 tape units 17 volumes Used if three work storage
(POLY) tapes are provided.
Table 76. Work Space Requirements of the Various Tape Techniques (continued)
Work Space Areas Max. No. of
Tape Technique Maximum Input Required Work Areas Comments
Oscillating tape 15 volumes Min=V+2* or 4 tape 17 volumes File size must be given. The
(OSCL) units, whichever is tape drive containing SORTIN
greater cannot be used as a work
unit.
Note:
V = Number of input volumes. Number of input volumes of blocking equals work space blocking.
The value for Nmax printed in message ICE038I is an average value rounded down
to the nearest thousand. This value assumes random input. If you have a reversed
sequenced file and tape work space, sort capacity may be exceeded at a lower
value because of the higher number of partly empty, end-of-string blocks.
For magnetic tape, a tape length of 2400 feet is assumed in calculating Nmax. For
tapes of other lengths, the figure is not correct. When tapes with mixed density are
used, the smallest density is used in the calculation.
If you specify an actual data set size, and that size is larger than the maximum
capacity estimated by the program (Nmax), the program terminates before
beginning to sort. If you specify an estimated data set size, or none at all, and the
number of records reaches the maximum (Nmax), the program gives control to your
routine at user exit E16, if you have written and included one. This routine can
direct the program to take one of the following actions:
v Continue sorting the entire input data set with available work space. If the
estimate of the input data set size was high, enough work space may remain to
complete the application.
v Continue sorting with only part of the input data set; the remainder could be
sorted later and the two results merged to complete the application.
v Terminate the program without any further processing.
If you do not include an E16 routine, DFSORT continues to process records for as
long as possible. If the work space is sufficient to contain all the records in the input
data set, DFSORT completes normally; when work space is not sufficient, DFSORT
issues a message and terminates.
The program generates a separate message for each of the three possible error
conditions. They are:
1. ICE041AN GT NMAX: Generated before sorting begins when the exact file
size is greater than Nmax.
2. ICE046ASORT CAPACITY EXCEEDED: Generated when the sort has used
all available work space.
3. ICE048INMAX EXCEEDED: Generated when the sort has exceeded Nmax
and has transferred control to a user-written E16 routine for further action.
The test for message ICE041A is made with the maximum possible calculated
value, that is, DFSORT is sure it will fail. In case of doubt, the message is not
issued.
Listed below are the places in DFSORT where you can specify various options that
will override the IBM-supplied defaults. The sources for the options are listed in
override order; that is, any option specified in a higher place in the list overrides
one specified in a lower place.
//DFSPARM DD *
OPTION EQUALS
//SYSIN DD *
OPTION NOEQUALS,SKIPREC=50
For control statements other than DEBUG and OPTION, override is at the
statement level. For example, with:
//DFSPARM DD *
MODS E15=(CHECK,4096,EXIT)
//SYSIN DD *
MODS E35=(MOVE,2048,EXITX)
Parameter Lists
v Use with program invocation only.
Note: The extended parameter list can perform a superset of the functions in the
24-bit parameter list.
Override Tables
The following tables show the possible sources of specification and order of
override for individual options.
v The order of override between sources of specification is from left to right. A
specification overrides all specifications to its right.
v The order of override within a source is from top to bottom. A specification
overrides all specifications below it.
v EXEC PARM options you can specify in the DFSPARM data set are preceded by
the word PARM in the DFSPARM columns of the tables to distinguish them
from control statement options.
v The Function columns indicate which functions (S=sort, M=merge, or C=copy)
can use the option.
v Although alias names are available for many of the options, they are not shown
here.
628
column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with EXEC ICEMAC JCL, Description of
Specified with DFSPARM PARM Specified with SYSIN TSO OR TDx Option Function
NO NO NO ABCODE ABEND code S,M,C
DEBUG ABSTP NO DEBUG ABSTP NO Abnormal stop S,M,C
ALTSEQ CODE NO ALTSEQ CODE ALTSEQ Alternate S,M
sequence
PARM ARESALL ARESALL OPTION ARESALL ARESALL System storage S,M,C
OPTION ARESALL above 16MB
Specification/Override Of Options
virtual
DEBUG NOASSIST NO DEBUG NOASSIST NO Bypass Sorting S
Instructions
PARM AVGRLEN AVGRLEN OPTION AVGRLEN NO Average record S
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with EXEC ICEMAC JCL, Description of
Specified with DFSPARM PARM Specified with SYSIN TSO OR TDx Option Function
NO NO NO Time-of-day for Simulate S,M,C
activation SORTDIAG DD
Statement
NO NO NO DIAGSIM Simulate S,M,C
SORTDIAG DD
Statement
NO NO NO DSA Dynamic storage S
adjustment limit
PARM DSPSIZE DSPSIZE OPTION DSPSIZE DSPSIZE Dataspace S
OPTION DSPSIZE sorting
PARM DYNALLOC DYNALLOC OPTION DYNALLOC DYNALOC1 Dynamic S
OPTION DYNALLOC SORT DYNALLOC SORTWKs
SORT DYNALLOC
PARM DYNALLOC DYNALLOC OPTION DYNALLOC DYNAUTO Automatic S
OPTION DYNALLOC|USEWKDD SORT DYNALLOC dynamic
SORT DYNALLOC allocation
PARM DYNSPC DYNSPC OPTION DYNSPC DYNSPC Dynamic S
OPTION DYNSPC allocation default
space
PARM EFS EFS NO2 EFS EFS program S,M,C
OPTION EFS specified
NO NO NO ENABLE Enable S,M,C
Time-of-Day
modules
PARM EQUALS|NOEQUALS EQUALS|NOEQUALS OPTION EQUALS|NOEQUALS EQUALS Equal record S,M
OPTION EQUALS|NOEQUALS SORT|MERGE EQUALS|NOEQUALS order
SORT|MERGE EQUALS|NOEQUALS
DEBUG EQUCOUNT NO DEBUG EQUCOUNT NO Equal key count S
629
Table 77. Directly Invoked DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the ICEMAC column. If NO is specified in
630
the ICEMAC column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with EXEC ICEMAC JCL, Description of
Specified with DFSPARM PARM Specified with SYSIN TSO OR TDx Option Function
PARM ABEND|NOABEND ABEND|NOABEND DEBUG ABEND|NOABEND ERET Error action S,M,C
DEBUG ABEND|NOABEND
DEBUG ESTAE|NOESTAE NO DEBUG ESTAE|NOESTAE ESTAE ESTAE routine S,M,C
OPTION EXITCK NO OPTION EXITCK EXITCK E15/E35 return S,M,C
code checking
NO NO NO EXPMAX Available S
Specification/Override Of Options
expanded
storage limit for
all DFSORT
Hiperspaces
NO NO NO EXPOLD Old expanded S
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with EXEC ICEMAC JCL, Description of
Specified with DFSPARM PARM Specified with SYSIN TSO OR TDx Option Function
PARM FILSZ FILSZ OPTION FILSZ|SIZE FSZEST File size S,M
OPTION FILSZ|SIZE SORT|MERGE FILSZ|SIZE
SORT|MERGE FILSZ|SIZE
PARM HIPRMAX HIPRMAX OPTION HIPRMAX HIPRMAX Hipersorting S
OPTION HIPRMAX
NO NO NO IDRCPCT IDRC S
compaction
NO NO NO IEXIT ICEIEXIT S,M,C
4 4
OPTION CKPT NO OPTION CKPT IGNCKPT Checkpoints S
SORT CKPT4 SORT CKPT4
NO NO NO IOMAXBF Maximum S,M,C
SORTIN/
SORTOUT
data set buffer
space
RECORD LENGTH NO RECORD LENGTH NO Record lengths S,M,C
2
PARM LIST|NOLIST LIST|NOLIST NO LIST Print DFSORT S,M,C
OPTION LIST|NOLIST control
statements5
PARM LISTX|NOLISTX LISTX|NOLISTX NO2 LISTX Print control S,M,C
OPTION LISTX|NOLISTX statements
returned by an
EFS program5
PARM LOCALE LOCALE NO2 LOCALE Locale S,M,C
OPTION LOCALE processing
NO NO NO MAXLIM Maximum S,M,C
storage below
16MB virtual6
631
Table 77. Directly Invoked DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the ICEMAC column. If NO is specified in
632
the ICEMAC column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with EXEC ICEMAC JCL, Description of
Specified with DFSPARM PARM Specified with SYSIN TSO OR TDx Option Function
PARM MOSIZE MOSIZE OPTION MOSIZE MOSIZE Memory object S
OPTION MOSIZE sorting
PARM MSGDDN MSGDDN NO2 MSGDDN Alternate S,M,C
OPTION MSGDDN message data
set
NO NO NO MSGCON Write messages S,M,C
on master
Specification/Override Of Options
console
PARM MSGPRT MSGPRT NO2 MSGPRT Print messages S,M,C
OPTION MSGPRT
OPTION NOBLKSET NO OPTION NOBLKSET NO Bypass Blockset S,M
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with EXEC ICEMAC JCL, Description of
Specified with DFSPARM PARM Specified with SYSIN TSO OR TDx Option Function
PARM OVFLO OVFLO OPTION OVFLO OVFLO Summary fields S,M
OPTION OVFLO overflow action
PARM PAD PAD OPTION PAD PAD DFSORT LRECL S,M,C
OPTION PAD padding action
NO NO NO PARMDDN Alternate S,M,C
ddname for
DFSPARM
PARM RESALL RESALL OPTION RESALL RESALL System reserved S,M,C
OPTION RESALL storage6
PARM RESET|NORESET RESET|NORESET OPTION RESET|NORESET RESET NEW or MOD S,M,C
OPTION RESET|NORESET VSAM output
PARM SDB SDB OPTION SDB SDB System- S,M,C
OPTION SDB determined
output data
set block size
NO NO NO SDBMSG System- S,M,C
determined
block size for
message and
list data sets
PARM SIZE SIZE OPTION MAINSIZE SIZE Storage S,M,C
OPTION MAINSIZE
PARM SKIPREC SKIPREC OPTION SKIPREC NO Skip records S,C
OPTION SKIPREC SORT SKIPREC
SORT SKIPREC
OPTION SMF NO NO SMF SMF records S,M,C
PARM SOLRF|NOSOLRF SOLRF|NOSOLRF OPTION SOLRF|NOSOLRF SOLRF SORTOUT S,M,C
OPTION SOLRF|NOSOLRF length
633
Table 77. Directly Invoked DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the ICEMAC column. If NO is specified in
634
the ICEMAC column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with EXEC ICEMAC JCL, Description of
Specified with DFSPARM PARM Specified with SYSIN TSO OR TDx Option Function
7 2
OPTION SORTIN NO NO NO Alternate S,C
SORTIN ddname
NO NO NO SORTLIB Conventional S,M
modules library
OPTION SORTOUT8 NO NO2 NO Alternate S,M,C
SORTOUT
ddname
Specification/Override Of Options
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with EXEC ICEMAC JCL, Description of
Specified with DFSPARM PARM Specified with SYSIN TSO OR TDx Option Function
NO NO NO VIO SORTWK virtual S
I/O
PARM VLLONG|NOVLLONG VLLONG|NOVLLONG OPTION VLLONG|NOVLLONG VLLONG Truncate long S,M,C
OPTION VLLONG|NOVLLONG output records
PARM VLSCMP|NOVLSCMP VLSCMP|NOVLSCMP OPTION VLSCMP|NOVLSCMP VLSCMP Pad short S,M,C
OPTION VLSCMP|NOVLSCMP compare fields
PARM VLSHRT|NOVLSHRT VLSHRT|NOVLSHRT OPTION VLSHRT|NOVLSHRT VLSHRT Action for short S,M,C
OPTION VLSHRT|NOVLSHRT control or
compare fields
NO NO NO VSAMBSP VSAM buffer S
space
PARM VSAMEMT|NVSAMEMT VSAMEMT|NVSAMEMT OPTION VSAMEMT|NVSAMEMT VSAMEMT Emty VSAM S,M,C
OPTION VSAMEMT|NVSAMEMT input
PARM VSAMIO|NOVSAMIO VSAMIO|NOVSAMIO OPTION VSAMIO|NOVSAMIO VSAMIO Same VSAM S
OPTION VSAMIO|NOVSAMIO input and output
PARM WRKREL|NOWRKREL WRKREL|NOWRKREL OPTION WRKREL|NOWRKREL WRKREL Release S
OPTION WRKREL|NOWRKREL SORTWK space
PARM WRKSEC|NOWRKSEC WRKSEC|NOWRKSEC OPTION WRKSEC|NOWRKSEC WRKSEC SORTWK S
OPTION WRKSEC|NOWRKSEC secondary
allocation
PARM Y2PAST Y2PAST OPTION Y2PAST Y2PAST Set century S,M,C
OPTION Y2PAST SORT|MERGE Y2PAST window
SORT|MERGE Y2PAST
PARM ZDPRINT|NZDPRINT ZDPRINT|NZDPRINT OPTION ZDPRINT|NZDPRINT ZDPRINT ZD SUM results S,M
OPTION ZDPRINT|NZDPRINT
635
Specification/Override Of Options
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with Extended ICEMAC INV, Description of
Specified with DFSPARM Specified with SORTCNTL Parameter List TSOINV or TDx Option Function
NO NO NO ABCODE ABEND code S,M,C
DEBUG ABSTP DEBUG ABSTP DEBUG ABSTP NO Abnormal stop S,M,C
ALTSEQ CODE ALTSEQ CODE Offset 16 entry ALTSEQ Alternate sequence S,M
ALTSEQ CODE
PARM ARESALL OPTION ARESALL OPTION ARESALL ARESALL System storage S,M,C
OPTION ARESALL above 16MB virtual
OPTION ARESINV OPTION ARESINV OPTION ARESINV ARESINV Storage above 16MB S,M,C
virtual for invoking
program
DEBUG NOASSIST DEBUG NOASSIST DEBUG NOASSIST NO Bypass Sorting S
Instructions
PARM AVGRLEN OPTION AVGRLEN OPTION AVGRLEN NO Average record S
OPTION AVGRLEN length
PARM BSAM DEBUG BSAM DEBUG BSAM NO Force BSAM S,M,C
DEBUG BSAM
DEBUG CFW|NOCFW DEBUG CFW|NOCFW DEBUG CFW|NOCFW CFW Cache fast write S
OPTION CHALT|NOCHALT OPTION CHALT|NOCHALT OPTION CHALT|NOCHALT CHALT CH field sequence S,M
OPTION CHECK|NOCHECK OPTION CHECK|NOCHECK OPTION CHECK|NOCHECK CHECK Record count check S,M,C
PARM CINV|NOCINV OPTION CINV|NOCINV OPTION CINV|NOCINV CINV Control interval S,M,C
OPTION CINV|NOCINV access
PARM COBEXIT OPTION COBEXIT OPTION COBEXIT COBEXIT COBOL library S,M,C
OPTION COBEXIT
INCLUDE|OMIT INCLUDE|OMIT INCLUDE|OMIT NO Include|Omit fields S,M,C
COND|FORMAT COND|FORMAT COND|FORMAT
OPTION COPY OPTION COPY OPTION COPY NO Copy records C
SORT|MERGE FIELDS SORT|MERGE FIELDS2 SORT|MERGE FIELDS
637
Table 78. Extended Parameter List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the ICEMAC column. If NO is
638
specified in the ICEMAC column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with Extended ICEMAC INV, Description of
Specified with DFSPARM Specified with SORTCNTL Parameter List TSOINV or TDx Option Function
NO NO NO day Time-of-day for S,M,C
activation
NO NO NO DIAGSIM Simulate SORTDIAG S,M,C
DD statement
NO NO NO DSA Dynamic storage S
adjustment limit
Specification/Override Of Options
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with Extended ICEMAC INV, Description of
Specified with DFSPARM Specified with SORTCNTL Parameter List TSOINV or TDx Option Function
DEBUG ESTAE|NOESTAE DEBUG ESTAE|NOESTAE DEBUG ESTAE|NOESTAE ESTAE ESTAE routine S,M,C
OPTION EXITCK OPTION EXITCK OPTION EXITCK EXITCK E15/E35 return code S,M,C
checking
NO NO NO EXPMAX Available expanded S
storage limit for all
DFSORT
Hiperspaces
NO NO NO EXPOLD Old expanded S
storage limit for all
DFSORT
Hiperspaces
NO NO NO EXPRES Available expanded S
storage reserved for
non-Hipersorting use
PARM E15=COB MODS E154|HILEVEL=YES Offset 4 entry4 NO Exit E15 S,C
MODS E154|HILEVEL=YES MODS E154|HILEVEL=YES
MODS E184 MODS E184 Offset 24 entry4 NO Exit E18 S
MODS E184
NO NO Offset 4 entry NO Exit E32 M
4 4
PARM E35=COB MODS E35 |HILEVEL=YES Offset 8 entry NO Exit E35 S,M,C
MODS E354|HILEVEL=YES MODS E354|HILEVEL=YES
MODS E394 MODS E394 Offset 28 entry4 NO Exit E39 S,M,C
MODS E394
MODS Exx MODS Exx MODS Exx NO User Exit Exx S,M,C5
(xx=11,16,17,19,
31,37,38, and 61)
INREC FIELDS INREC FIELDS INREC FIELDS NO INREC fields S,M,C
639
Table 78. Extended Parameter List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the ICEMAC column. If NO is
640
specified in the ICEMAC column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with Extended ICEMAC INV, Description of
Specified with DFSPARM Specified with SORTCNTL Parameter List TSOINV or TDx Option Function
SORT|MERGE SORT|MERGE SORT|MERGE NO Control fields S,M
FIELDS|FORMAT FIELDS|FORMAT FIELDS|FORMAT
SUM FIELDS|FORMAT SUM FIELDS|FORMAT SUM FIELDS|FORMAT NO Sum fields S,M
MERGE FILES MERGE FILES MERGE FILES NO Merge input files M
PARM FILSZ OPTION FILSZ|SIZE OPTION FILSZ|SIZE FSZEST File size S,M
OPTION FILSZ|SIZE SORT|MERGE FILSZ|SIZE2 SORT|MERGE FILSZ|SIZE
Specification/Override Of Options
SORT|MERGE FILSZ|SIZE
NO NO NO GENER IEBGENER name C
NO NO NO GNPAD ICEGENER LRECL C
padding action
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with Extended ICEMAC INV, Description of
Specified with DFSPARM Specified with SORTCNTL Parameter List TSOINV or TDx Option Function
3
PARM LOCALE NO OPTION LOCALE LOCALE Locale processing S,M,C
OPTION LOCALE
NO NO NO MAXLIM Maximum storage S,M,C
below 16MB virtual8
NO NO NO MINLIM Minimum storage S,M,C
PARM MOSIZE OPTION MOSIZE OPTION MOSIZE MOSIZE Memory object S
OPTION MOSIZE sorting
PARM MSGDDN NO3 OPTION MSGDDN MSGDDN Alternate message S,M,C
OPTION MSGDDN ddname
NO NO NO MSGCON Write messages on S,M,C
master console
PARM MSGPRT NO3 OPTION MSGPRT MSGPRT Print messages S,M,C
OPTION MSGPRT
OPTION NOBLKSET OPTION NOBLKSET OPTION NOBLKSET NO Bypass Blockset S,M
NO NO NO NOMSGDD Action when S,M,C
message data set
missing
PARM NULLOUT OPTION NULLOUT OPTION NULLOUT NULLOUT Action when no S,M,C
OPTION NULLOUT records for
SORTOUT
PARM ODMAXBF OPTION ODMAXBF OPTION ODMAXBF ODMAXBF Maximum OUTFIL S,M,C
OPTION ODMAXBF data set buffer space
OUTFIL11 OUTFIL11 OUTFIL11 NO OUTFIL processing S,M,C
PARM OUTREL|NOOUTREL OPTION NOOUTREL OPTION NOOUTREL OUTREL Release output data S,M,C
OPTION NOOUTREL set space
OPTION NOOUTSEC OPTION NOOUTSEC OPTION NOOUTSEC OUTSEC Output data set S,M,C
secondary allocation
641
Table 78. Extended Parameter List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the ICEMAC column. If NO is
642
specified in the ICEMAC column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with Extended ICEMAC INV, Description of
Specified with DFSPARM Specified with SORTCNTL Parameter List TSOINV or TDx Option Function
PARM OVFLO OPTION OVFLO OPTION OVFLO OVFLO Summary fields S,M
OPTION OVFLO overflow action
PARM PAD OPTION PAD OPTION PAD PAD DFSORT LRECL S,M,C
OPTION PAD padding action
NO NO NO PARMDDN Alternate ddname for S,M,C
DFSPARM
Specification/Override Of Options
PARM RESALL OPTION RESALL OPTION RESALL RESALL System reserved S,M,C
OPTION RESALL storage8
PARM RESET|NORESET OPTION RESET|NORESET OPTION RESET|NORESET RESET NEW or MOD VSAM S,M,C
OPTION RESET|NORESET output
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with Extended ICEMAC INV, Description of
Specified with DFSPARM Specified with SORTCNTL Parameter List TSOINV or TDx Option Function
9 3 9
OPTION SORTIN NO OPTION SORTIN NO Alternate SORTIN S,C
ddname
NO NO NO SORTLIB Conventional S,M
modules library
OPTION SORTOUT10 NO3 OPTION SORTOUT10 NO Alternate SORTOUT S,M,C
ddname
PARM SPANINC OPTION SPANINC OPTION SPANINC SPANINC Incomplete spanned S,M,C
OPTION SPANINC records action
PARM STIMER|NOSTIMER OPTION NOSTIMER OPTION NOSTIMER STIMER Use of STIMER S,M,C
OPTION NOSTIMER
PARM STOPAFT OPTION STOPAFT OPTION STOPAFT NO Input limit S,C
OPTION STOPAFT SORT|MERGE STOPAFT2 SORT|MERGE STOPAFT
SORT|MERGE STOPAFT
NO NO NO SVC DFSORT SVC S,M,C
information
PARM SZERO|NOSZERO OPTION SZERO|NOSZERO OPTION SZERO|NOSZERO SZERO Signed or unsigned S,M,C
OPTION SZERO|NOSZERO zero
NO NO NO TEXIT ICETEXIT S,M,C
NO NO NO TMAXLIM Maximum storage S,M,C
above and below
16MB virtual8
PARM TRUNC OPTION TRUNC OPTION TRUNC TRUNC DFSORT LRECL S,M,C
OPTION TRUNC truncation action
RECORD TYPE RECORD TYPE RECORD TYPE NO Record format S,M,C
PARM VERIFY|NOVERIFY OPTION VERIFY|NOVERIFY OPTION VERIFY|NOVERIFY VERIFY Sequence check S,M
OPTION VERIFY|NOVERIFY
NO NO NO VIO SORTWK virtual I/O S
643
Table 78. Extended Parameter List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the ICEMAC column. If NO is
644
specified in the ICEMAC column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with
Specified with Extended ICEMAC INV, Description of
Specified with DFSPARM Specified with SORTCNTL Parameter List TSOINV or TDx Option Function
PARM VLSCMP|NOVLSCMP OPTION VLSCMP|NOVLSCMP OPTION VLSCMP|NOVLSCMP VLSCMP Pad short compare S,M,C
OPTION VLSCMP|NOVLSCMP fields
PARM VLSHRT|NOVLSHRT OPTION VLSHRT|NOVLSHRT OPTION VLSHRT|NOVLSHRT VLSHRT Action for short S,M,C
OPTION VLSHRT|NOVLSHRT control field or
compare field
NO NO NO VSAMBSP VSAM buffer space S
Specification/Override Of Options
646
column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with ICEMAC Description of
Specified with DFSPARM Specified with SORTCNTL Specified with 24-Bit List INV, TSOINV or TDx Option Function
NO NO NO ABCODE ABEND code S,M,C
DEBUG ABSTP DEBUG ABSTP DEBUG ABSTP NO Abnormal stop S,M,C
ALTSEQ CODE ALTSEQ CODE X'F6' entry ALTSEQ Alternate S,M
ALTSEQ CODE sequence
PARM ARESALL OPTION ARESALL NO ARESALL System storage S,M,C
OPTION ARESALL above 16MB
virtual
Specification/Override Of Options
The order of override is from left to right and from top to bottom within a row.
Specified with ICEMAC Description of
Specified with DFSPARM Specified with SORTCNTL Specified with 24-Bit List INV, TSOINV or TDx Option Function
DEBUG CTRx DEBUG CTRx DEBUG CTRx NO ABEND record S,M
count
NO NO NO day Time-of-day for S,M,C
activation
NO NO NO DIAGSIM Simulate S,M,C
SORTDIAG DD
statement
NO NO NO DSA Dynamic storage S
adjustment limit
PARM DSPSIZE OPTION DSPSIZE NO DSPSIZE Dataspace sorting S
OPTION DSPSIZE
PARM DYNALLOC OPTION DYNALLOC SORT DYNALLOC DYNALOC1 Dynamic S
OPTION DYNALLOC SORT DYNALLOC SORTWKs
SORT DYNALLOC
PARM DYNALLOC OPTION DYNALLOC SORT DYNALLOC DYNAUTO Automatic S
OPTION DYNALLOC|USEWKDD SORT DYNALLOC DYNALLOC
SORT DYNALLOC
PARM DYNSPC OPTION DYNSPC NO DYNSPC Dynamic allocation S
OPTION DYNSPC default space
PARM EFS NO2 NO EFS EFS program S,M,C
OPTION EFS specified
NO NO NO ENABLE Enable S,M,C
Time-of-Day
modules
PARM EQUALS|NOEQUALS OPTION EQUALS|NOEQUALS SORT|MERGE EQUALS Equal record order S,M
OPTION EQUALS|NOEQUALS SORT|MERGE EQUALS| EQUALS|NOEQUALS
SORT|MERGE EQUALS| NOEQUALS
NOEQUALS
647
Table 79. 24-Bit List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the ICEMAC column. If NO is specified in the
648
ICEMAC column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with ICEMAC Description of
Specified with DFSPARM Specified with SORTCNTL Specified with 24-Bit List INV, TSOINV or TDx Option Function
PARM ABEND|NOABEND DEBUG ABEND|NOABEND DEBUG ERET Error action S,M,C
DEBUG ABEND|NOABEND ABEND|NOABEND
DEBUG ESTAE|NOESTAE DEBUG ESTAE|NOESTAE DEBUG ESTAE|NOESTAE ESTAE ESTAE routine S,M,C
OPTION EXITCK OPTION EXITCK NO EXITCK E15/E35 return S,M,C
code checking
NO NO NO EXPMAX Available S
expanded storage
Specification/Override Of Options
The order of override is from left to right and from top to bottom within a row.
Specified with ICEMAC Description of
Specified with DFSPARM Specified with SORTCNTL Specified with 24-Bit List INV, TSOINV or TDx Option Function
SORT|MERGE FIELDS|FORMAT SORT|MERGE FIELDS|FORMAT SORT|MERGE NO Control fields S,M,C
FIELDS|FORMAT
SUM FIELDS|FORMAT SUM FIELDS|FORMAT SUM FIELDS|FORMAT NO Sum fields S,M
MERGE FILES MERGE FILES X'04' entry NO Merge input files M
MERGE FILES
PARM FILSZ OPTION FILSZ|SIZE SORT|MERGE FSZEST File size S,M
OPTION FILSZ|SIZE SORT|MERGE FILSZ|SIZE FILSZ|SIZE
SORT|MERGE FILSZ|SIZE
NO NO NO GENER IEBGENER name C
NO NO NO GNPAD ICEGENER C
LRECL padding
action
NO NO NO GNTRUNC ICEGENER C
LRECL truncation
action
PARM HIPRMAX OPTION HIPRMAX NO HIPRMAX Hipersorting S
OPTION HIPRMAX
NO NO NO IDRCPCT IDRC compaction S
NO NO NO IEXIT ICEIEXIT S,M,C
5 5 5
OPTION CKPT OPTION CKPT SORT|MERGE CKPT IGNCKPT Checkpoints S
SORT|MERGE CKPT5 SORT|MERGE CKPT5
NO NO NO IOMAXBF Maximum S,M,C
SORTIN/
SORTOUT
data set buffer
space
RECORD LENGTH RECORD LENGTH RECORD LENGTH NO Record lengths S,M,C
2
PARM LIST|NOLIST NO NO LIST Print DFSORT S,M,C
649
Table 79. 24-Bit List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the ICEMAC column. If NO is specified in the
650
ICEMAC column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with ICEMAC Description of
Specified with DFSPARM Specified with SORTCNTL Specified with 24-Bit List INV, TSOINV or TDx Option Function
2
PARM LISTX|NOLISTX NO NO LISTX Print control S,M,C
OPTION LISTX|NOLISTX statements
returned by an
EFS program6
PARM LOCALE NO2 NO LOCALE Locale processing S,M,C
OPTION LOCALE
NO NO NO MAXLIM Maximum storage S,M,C
below 16MB
Specification/Override Of Options
virtual7
NO NO NO MINLIM Minimum storage S,M,C
PARM MOSIZE OPTION MOSIZE NO MOSIZE Memory object S
OPTION MOSIZE sorting
The order of override is from left to right and from top to bottom within a row.
Specified with ICEMAC Description of
Specified with DFSPARM Specified with SORTCNTL Specified with 24-Bit List INV, TSOINV or TDx Option Function
PARM OUTREL|NOOUTREL OPTION NOOUTREL NO OUTREL Release output S,M,C
OPTION NOOUTREL data set space
OPTION NOOUTSEC OPTION NOOUTSEC NO OUTSEC Output data set S,M,C
secondary
allocation
NO NO NO OVERRGN Storage over S,M,C
REGION
PARM OVFLO OPTION OVFLO NO OVFLO Summary fields S,M
OPTION OVFLO overflow action
PARM PAD OPTION PAD NO PAD DFSORT LRECL S,M,C
OPTION PAD padding action
NO NO NO PARMDDN Alternate ddname S,M,C
for DFSPARM
PARM RESALL OPTION RESALL NO RESALL System reserved S,M,C
OPTION RESALL storage7
PARM RESET|NORESET OPTION RESET|NORESET NO RESET NEW or MOD S,M,C
OPTION RESET|NORESET VSAM output
OPTION RESINV OPTION RESINV X'01' entry RESINV Program reserved S,M,C
storage7
PARM SDB OPTION SDB NO SDB System- S,M,C
OPTION SDB determined output
data set block size
NO NO NO SDBMSG System- S,M,C
determined block
size for message
and list data sets
PARM SIZE OPTION MAINSIZE X'00' entry SIZE Storage S,M,C
OPTION MAINSIZE
651
Table 79. 24-Bit List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the ICEMAC column. If NO is specified in the
652
ICEMAC column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with ICEMAC Description of
Specified with DFSPARM Specified with SORTCNTL Specified with 24-Bit List INV, TSOINV or TDx Option Function
PARM SKIPREC OPTION SKIPREC SORT|MERGE SKIPREC NO Skip records S,C
OPTION SKIPREC SORT|MERGE SKIPREC
SORT|MERGE SKIPREC
OPTION SMF NO NO SMF SMF records S,M,C
PARM SOLRF|NOSOLRF OPTION SOLRF|NOSOLRF NO SOLRF SORTOUT length S,M,C
OPTION SOLRF|NOSOLRF
OPTION SORTDD NO2 Prefix entry NO ddname prefix S,M,C
Specification/Override Of Options
8 2
OPTION SORTIN NO NO NO Alternate SORTIN S,C
ddname
NO NO NO SORTLIB Conventional S,M
modules library
The order of override is from left to right and from top to bottom within a row.
Specified with ICEMAC Description of
Specified with DFSPARM Specified with SORTCNTL Specified with 24-Bit List INV, TSOINV or TDx Option Function
NO NO NO TMAXLIM Maximum storage S,M,C
above and below
16MB virtual7
PARM TRUNC OPTION TRUNC NO TRUNC DFSORT LRECL S,M,C
OPTION TRUNC truncation action
RECORD TYPE RECORD TYPE RECORD TYPE NO Record format S,M,C
PARM VERIFY|NOVERIFY OPTION VERIFY|NOVERIFY NO VERIFY Sequence check S,M
OPTION VERIFY|NOVERIFY
NO NO NO VIO SORTWK virtual S
I/O
PARM VLLONG|NOVLLONG OPTION VLLONG|NOVLLONG NO VLLONG Truncate long S,M,C
OPTION VLLONG|NOVLLONG output records
PARM VLSCMP|NOVLSCMP OPTION VLSCMP|NOVLSCMP NO VLSCMP Pad short compare S,M,C
OPTION VLSCMP|NOVLSCMP fields
PARM VLSHRT|NOVLSHRT OPTION VLSHRT|NOVLSHRT NO VLSHRT Action for short S,M,C
OPTION VLSHRT|NOVLSHRT control or compare
field
NO NO NO VSAMBSP VSAM buffer S
space
PARM VSAMEMT|NVSAMEMT OPTION VSAMEMT|NVSAMEMT NO VSAMEMT Empty VSAM input S,M,C
OPTION VSAMEMT|
NVSAMEMT
PARM VSAMIO|NOVSAMIO OPTION VSAMIO|NOVSAMIO NO VSAMIO Same VSAM input S
OPTION VSAMIO|NOVSAMIO and output
PARM WRKREL|NOWRKREL OPTION WRKREL|NOWRKREL NO WRKREL Release SORTWK S
OPTION WRKREL|NOWRKREL space
PARM WRKSEC|NOWRKSEC OPTION WRKSEC| NO WRKSEC SORTWK S
OPTION WRKSEC|NOWRKSEC NOWRKSEC secondary
653
Table 79. 24-Bit List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the ICEMAC column. If NO is specified in the
654
ICEMAC column, move to the next column to the left and so on.
The order of override is from left to right and from top to bottom within a row.
Specified with ICEMAC Description of
Specified with DFSPARM Specified with SORTCNTL Specified with 24-Bit List INV, TSOINV or TDx Option Function
PARM Y2PAST OPTION Y2PAST SORT|MERGE Y2PAST Y2PAST Set century S,M,C
OPTION Y2PAST SORT|MERGE Y2PAST window
SORT|MERGE Y2PAST
PARM ZDPRINT|NZDPRINT OPTION ZDPRINT|NZDPRINT NO ZDPRINT ZD SUM results S,M
OPTION ZDPRINT|NZDPRINT
Specification/Override Of Options
Format Description
| CH (character EBCDIC, unsigned). Each character is represented by its 8-bit EBCDIC code.
Format Description
PD (packed decimal, signed). Each digit of the decimal number is converted into its 4-bit binary
equivalent. The sign indicator is put into the rightmost four bits of the number.
PD0 can be used for parts of PD fields. For example, in the PD field Pmmddyy (hexadecimal
0mmddyyC), PD0 can be used separately for 0mmd (mm), mddy (dd) and dyyC (yy).
FI (fixed point, signed). The complete number is represented by its binary equivalent with the sign
indicator placed in the most significant bit position.
Format Description
CSF or FS (signed numeric with optional leading floating sign).
<s>d . . .d
s is an optional sign immediately to the left of the digits d . . .d. If s is a , the number is treated
as negative, otherwise it is treated as positive. Thus, must be used for a minus sign, but any
other character (for example, + or blank) can be used for a plus sign. The first non-decimal digit
(that is, not 0-9) going from right to left is treated as the sign and anything to the left of the sign
is ignored.
Examples:
Value: Treated as:
34 +34
+34 +34
00034 +34
003 3
1234 1234
1234 +1234
+01234 +1234
0 +0
The types of data handled by the CSF/FS format encompass those produced by several different
FORTRAN, PL/I and COBOL formats, such as those shown below (using a width of 4 for
purposes of illustration):
Because CSF/FS format fields are processed less efficiently than the other formats, CSF/FS
should not be used when another format is also appropriate (for example, CSL).
CSL or LS (signed number, leading separate sign). This format refers to decimal data as punched into cards,
and then assembled into EBCDIC code.
Format Description
CTO or OT (signed numeric, trailing overpunch sign). This format has the same representation as for the
CLO format, except that the sign indicator is overpunched on the last decimal digit of the number.
Example: +247 with + overpunched on 7 becomes
F2 F4 C7 hexadecimal
ASL (signed numeric, ASCII, leading separate sign). Similar to the CSL format but with decimal data
assembled into ASCII code.
Example: +247 punched into card becomes
+ 2 4 7 Punched numeric data
2B 32 34 37 Hexadecimal
0101011 00110010 00110100 00110111 Binary ASCII code
Similarly 247 becomes
2D 32 34 37 hexadecimal
AST (signed numeric, ASCII, trailing separate sign). This gives the same bit representation as the ASL
format, except that the sign is punched after the number.
Example: 247+ becomes
32 34 37 2B hexadecimal
Y2T (character or zoned decimal yyx, yyxx, yyxxx and yyxxxx full date format with special indicators).
y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-9 and represents a non-year
digit. x...x must be in correct collating order.
The special indicators are X00...00 (BI zeros), X40...40 (blanks), C0...0 (CH zeros), Z0...0
(ZD zeros), C9...9 (CH nines), Z9...9 (ZD nines) and XFF...FF (BI ones).
Y2U (packed decimal yyx and yyxxx full date format with special indicators).
y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-9 and represents a non-year
digit. s is hexadecimal 0-F and is ignored. xxx must be in correct collating order.
The special indicators are P0...0 (PD zeros) and P9...9 (PD nines).
Y2V (packed decimal yyxx and yyxxxx full date format with special indicators).
y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-9 and represents a non-year
digit. s is hexadecimal 0-F and is ignored. xx or xxxx must be in correct collating order.
The special indicators are P0...0 (PD zeros) and P9...9 (PD nines).
Format Description
Y2W (character or zoned decimal xyy, xxyy, xxxyy and xxxxyy full date format with special indicators).
y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-9 and represents a non-year
digit. x...x must be in correct collating order. x...xyy will be treated as yyx...x when collating the
date field.
The special indicators are X00...00 (BI zeros), X40...40 (blanks), C0...0 (CH zeros), Z0...0
(ZD zeros), C9...9 (CH nines), Z9...9 (ZD nines) and XFF...FF (BI ones).
Y2X (packed decimal xyy and xxxyy full date format with special indicators).
y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-9 and represents a non-year
digit. s is hexadecimal 0-F and is ignored. xxx must be in correct collating order. x...xyy will be
treated as yyx...x when collating the date field.
The special indicators are P0...0 (PD zeros) and P9...9 (PD nines).
Y2Y (packed decimal xxyy and xxxxyy full date format with special indicators).
y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-9 and represents a non-year
digit. s is hexadecimal 0-F and is ignored. xx or xxxx must be in correct collating order. x...xyy will
be treated as yyx...x when collating the date field.
The special indicators are P0...0 (PD zeros) and P9...9 (PD nines).
Y2C or Y2Z (two-digit, two-byte character or zoned-decimal year data). The two-digit year data can be
represented as follows:
xyxy
y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-F and is ignored.
xyyx
y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-F and is ignored.
Format Description
Y2D (two-digit, one-byte decimal year data). The two-digit year data can represented as follows:
yy
y is hexadecimal 0-9 and represents a year digit.
xyxy
y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-F and is ignored.
qxzx
qx is hexadecimal 00, 40 or FF. zx is hexadecimal 00-FF (although typically 00, 40 and FF).
Thus, special indicators might be hexadecimal 0000, 0005, 4040, FFFF, FF85 and so on.
Y2B (two-digit, one-byte binary year data). The binary year data can be represented as follows:
hh
hh is the hexadecimal equivalent of a decimal yy value as follows:
Format Description
TM4 (SMF time interpreted as Z'hhmmssxx'). A 4-byte binary SMF time value in hundredths of a
second is converted to a Z'hhmmssxx' value. hh represents the hour (00-23), mm represents the
minutes (00-59), ss represents the seconds (00-59), and xx represents hundredths of a second
(00-99).
1
The overpunch sign bit is always 'C' for positive and 'D' for negative.
| Detailed descriptions of CH, ZD, PD, FI, BI, and FL data formats are found in z/OS
| MVS Programming: Assembler Services Reference IAR-XCT.
DFSORT statements
INCLUDE X X X X X X
INREC X X X X X X
MERGE X X X X X X
OMIT X X X X X X
OUTREC X X X X X X
SORT X X X X X X
SUM X X X X
OUTFIL statement operands
INCLUDE X X X X X X
OMIT X X X X X X
OUTREC X X X X X X
TRAILERx X X X X X
ICETOOL operators
DISPLAY (ON, BREAK) X X X X X X X
OCCUR (ON) X X X X X X X
RANGE (ON) X X X X X
SELECT (ON) X X X X X X
| SPLICE (ON) X X X X X X
STATS (ON) X X X X X
UNIQUE (ON) X X X X X
VERIFY (ON) X X
DFSORT statements
| INCLUDE X X X X X X X X X X X
INREC X X
MERGE X X X X X X X X X X X X
| OMIT X X X X X X X X X X X
OUTREC X X
SORT X X X X X X X X X X X X
SUM X
OUTFIL statement
operands
| INCLUDE X X X X X X X X X X
| OMIT X X X X X X X X X X
OUTREC X X
| For example, say you want to separate out records in a very large file into two data
| sets based on the values in a PIC S9(4) COMP field starting in position 21. In the
| first data set, you want records with values in the field that are greater than or equal
| to +5000. In the second data set, you want records with values in the field that are
| less than -1000. You could use the table below to determine that a PIC S9(4)
| COMP field is equivalent to a DFSORT field with a length of 2 and a format of FI,
| allowing you to code your DFSORT statements as follows:
| OPTION COPY
| OUTFIL FNAMES=OUT1,INCLUDE=(21,2,FI,GE,+5000)
| OUTFIL FNAMES=OUT2,INCLUDE=(21,2,FI,LT,-1000)
| Table 82. Equivalent DFSORT formats for various COBOL data types
| COBOL data type DFSORT Length DFSORT Format
| PIC X(n) USAGE DISPLAY n CH
| GROUP DATA ITEMS with n bytes n CH
| PIC 9(n) DISPLAY n ZD
| PIC S9(n) DISPLAY <TRAILING> n ZD
| PIC S9(n) DISPLAY LEADING n CLO
| PIC S9(n) DISPLAY SEPARATE <TRAILING> n+1 CST
| PIC S9(n) DISPLAY LEADING SEPARATE n+1 CSL or FS
| PIC 9(n) COMP|BINARY|COMP-4|COMP-5
| n = 1 to 4 2 BI
| n = 5 to 9 4 BI
| n >= 10 8 BI
| Table 82. Equivalent DFSORT formats for various COBOL data types (continued)
| COBOL data type DFSORT Length DFSORT Format
| PIC S9(n) COMP|BINARY|COMP-4|COMP-5
| n = 1 to 4 2 FI
| n = 5 to 9 4 FI
| n >= 10 8 FI
| PIC 9(n) COMP-3|PACKED-DECIMAL (n/2)+1 PD
| PIC S9(n) COMP-3|PACKED-DECIMAL (n/2)+1 PD
| COMP-1 4 FL
| COMP-2 8 FL
|
| Notes:
| 1. PIC 9(x)V9(y) can be treated like PIC 9(n) where n=x+y. (COBOL does NOT
| store the decimal point internally.)
| 2. PIC S9(x)V9(y) can be treated like PIC S9(n) where n=x+y. (COBOL does NOT
| store the decimal point internally.)
ALTSEQ, CHALT, and LOCALE can be used to select alternate collating sequences
for character data.
Packed decimal, zoned decimal, fixed-point, and normalized floating-point data are
collated algebraically, that is, each quantity is interpreted as having a sign.
Table 83. EBCDIC Collating Sequence
Collating Sequence Bit Configuration Symbol Meaning
0 00000000
.
.
64 01100100 SP Space
.
.
74 01001010 Cent sign
75 01001011 . Period, decimal point
76 01001100 < Less than sign
77 01001101 ( Left parenthesis
78 01001110 + Plus sign
79 01001111 I Vertical bar, Logical OR
80 01010000 & Ampersand
.
.
90 01011010 ! Exclamation point
91 01011011 $ Dollar sign
92 01011100 * Asterisk
93 01011101 ) Right parenthesis
94 01011110 ; Semicolon
95 01011111 Logical not
96 01100000 Minus, hyphen
97 01100001 / Slash
107 01101011 , Comma
108 01101100 % Percent sign
109 01101101 _ Underscore
110 01101110 > Greater than sign
111 01101111 ? Question mark
.
.
122 01111010 : Colon
123 01111011 # Number sign
124 01111100 @ Commercial At
125 01111101 Apostrophe, prime
126 01111110 = Equal sign
127 01111111 Quotation marks
ISCII/ASCII
Table 84 shows the collating sequence for ISCII/ASCII, character, and unsigned
decimal data. The collating sequence ranges from low (00000000) to high
(01111111). Bit configurations that do not correspond to symbols are not shown.
Packed decimal, zoned decimal, fixed-point normalized floating-point data, and the
signed numeric data formats are collated algebraically; that is, each quantity is
interpreted as having a sign.
Table 84. ISCII/ASCII Collating Sequence
Collating Sequence Bit Configuration Symbol Meaning
0 00000000 Null
.
.
32 00100000 SP Space
33 00100001 ! Exclamation point
34 00100010 Quotation mark
35 00100011 # Number sign
36 00100100 $ Dollar sign
37 00100101 % Percent
38 00100110 & Ampersand
39 00100111 Apostrophe, prime
.
.
40 00101000 ( Opening parenthesis
41 00101001 ) Closing parenthesis
All abend dumps produced by DFSORT are system abend dumps that can be
processed by standard dump analysis programs. A dump will be generated if you
have included a SYSUDUMP, SYSABEND, or SYSMDUMP DD statement in your
application. The actual output of the system dump depends on the system
parameters specified in the IEADMP00, IEAABD00 or IEADMR00 members of
SYS1.PARMLIB by your installation.
At the end of its recovery routine, DFSORT always returns control to the system to
allow termination to continue. The system will then invoke the next higher level
ESTAE recovery routine.
Checkpoint/Restart
Checkpoint/Restart is a facility of the operating system that allows information about
an application to be recorded so that same application can be restarted after
abnormal termination or after some portion of the application has been completed.
Restart can take place immediately or be deferred until the application is
resubmitted.
DFSORT takes checkpoints when requested during a sort that uses the Peerage or
Vale techniques.
Notes:
1. No ANSI Standard Label tape files can be open during Checkpoint/Restart
processing.
2. Do not specify CHKPT=EOV on any DFSORT DD statement.
For more information on the Checkpoint/Restart facility, see z/OS DFSMS
Checkpoint/Restart.
See z/OS DFSORT Messages, Codes and Diagnosis Guide for complete
information about user abends issued by DFSORT.
The DFSORT recovery routine runs any of the functions specified above if they
have not already been run at the time of the abend.
v Abend information message
For unexpected system or user exit routine abends, the DFSORT recovery
routine issues message ICE185A giving information about when the abend
occurred. The description of this message is in z/OS DFSORT Messages, Codes
and Diagnosis Guide.
v Snap dumps
The DFSORT recovery routine provides a snap dump of the system diagnostic
work area (SDWA). The snap dumps are written to a dynamically allocated data
set whether or not a SYSUDUMP (or SYSABEND or SYSMDUMP) DD statement
is included in the application.
v Copy system diagnostic work area
If an invoking program passes the address of an SDWA area in the 24-bit or
extended parameter list, DFSORT will copy the first 104 or 112 bytes of the
system diagnostic work area into the user SDWA area. See Chapter 5, Invoking
DFSORT from a Program, on page 363 for more information.
v Continuation of an application after successful SORTOUT output
If an unexpected abend occurs after the sort, merge, or copy application writes
the SORTOUT data set successfully, DFSORT issues message ICE186A and
completes its normal cleanup and termination functions. The SORTOUT data set
written by DFSORT is closed. The run is successful except for the function
causing the abend. Message ICE186A says that the SORTOUT data set is
usable even though the run has abended. You can then decide to use the
SORTOUT data set or rerun the application.
v DFSORT returns control to the system at the end of its abend recovery
processing so that recovery routines can be invoked.
The DFSORT abend recovery routine functions described above may not be
performed after an abend if NOESTAE is in effect. The DFSORT ESTAE
recovery routine is always established at the beginning of a run. It is deleted
early in DFSORT processing if NOESTAE is in effect.
With NOESTAE and ABEND in effect, the abend dump is produced after the A-type
message is printed and other termination functions are run. As a result, the dump
produced might not reflect the conditions at the time of the error. It may not include
the module that encountered the error.
With NOESTAE and ABSTP in effect, the correct module will be dumped but the
A-type message will not be issued.
The DFSORT ESTAE recovery routine will return control to the system which will
pass control to any ESTAE recovery routine(s) established by invoking programs.
As described earlier, the DFSORT ESTAE recovery routine will save the first 104 or
112 bytes of the system diagnostic work area in the invoking programs SDWA area
if the address of the area is passed to DFSORT.
Since PL/I normally has an ESPIE in effect to intercept program checks (0Cx abend
codes), the DFSORT ESTAE recovery routine is not entered after these errors
unless you have specified NOSPIE. DFSORT abend recovery processing will occur
for all other types of abends.
Invocations from COBOL programs or use of COBOL exits can result in more than
one abend dump.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you any
license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
IBM World Trade Asia Corporation Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106, Japan
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATIONAS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore, this statement may not apply to
you.
IBM may use or distribute any of the information you supply in any way it believes
appropriate without incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose of
enabling: (i) the exchange of information between independently created programs
and other programs (including this one) and (ii) the mutual use of the information
which has been exchanged, should contact:
IBM Corporation
Mail Station P300
2455 South Road
The licensed program described in this information and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement, or any equivalent agreement
between us.
This publication also documents intended Programming Interfaces that allow the
customer to write programs to obtain the services of DFSORT. This information is
identified where it occurs, either by an introductory statement to a chapter or
section or by the following marking:
Trademarks
The following terms are trademarks of the IBM Corporation in the United States or
other countries or both:
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of
Microsoft Corporation in the United States, other countries, or both.
Other company, product, and service names may be trademarks or service marks
of others.
Index 683
data formats 413 defaults
descriptions 657, 664 installation 15
DFSORT statements 663 listing with ICETOOL 16
ICETOOL operators 663 DEFAULTS operator (ICETOOL) 400
OUTFIL statement operands 663 defaults, installation 15
data management rules definitions
system data management rules 12 cataloged procedures 28
data set 11 collating sequence 6
closing 320 control field 5
closing with user exit routines 328, 339 copying 1
defining 11 DD statements 26
handling input with user exit routines 339 direct invocation 4
handling output with user exit routines 339 EXEC statement 27
input 10 installation options 17, 21
shared tape unit 62 JOB statement 27
key-sequenced, considerations 14 key 5
message data set 22 merging 1
notes and limitations 12, 15 program invocation 4
opening with user exit routines 318, 324, 334 sorting 1
output 11 deleting control fields
shared tape unit 62 with INREC 118
page=end.considerations 15 with OUTREC control statement 282
QSAM considerations 14 deleting records 319
requirements 11 E15 user exit 325, 345
system data management rules 12 E35 user exit 351
valid types 11 with INCLUDE control statement 96, 139
VSAM considerations 14 with OMIT control statement 139
data space designing applications to maximize performance 564,
definition 149 571
specifying with EXEC PARM 36 designing new applications 565
specifying with OPTION control statement 149 determining action when intermediate storage is
data types 12 insufficient 320
dataspace sorting devices, improving elapsed time with 567
advantages 577 DFSORT 15
considerations 577 calls to your EFS program 534
definition 577 compatible operating systems 5
date constant 103, 115, 122, 206, 284 dynamic invocation 363
date formats exit routines 314
DISPLAY 662 improving efficiency 564
INCLUDE and OMIT 140 invoking 4
OCCUR 446 job control statements 25, 78
OUTFIL 211 logic examples for input/user exit/output 317
SORT and MERGE 301 messages 22
DBCS ordering 532 operating as a guest under VM 5
DD statements override of options 625
overview 60 overview 1
program DD statements 65 processing order 7
summary 26 processing OUTFIL operands 198
system DD statements 63 program control statements 81, 311
using 60, 78 program phases 315, 533
ddnames terminating with user exit 320
duplicate 62 DFSORT home page 3
DEBUG control statement DFSORT phases
example 90, 94 definition 533
function 83 initialization 535, 560
special handling 545 input 537
using 90, 95 termination 537, 562
DEBUG Statement Examples 94 DFSPARM data set 626
debugging jobs 90 DFSPARM DD statement
decimal number constants 102 defined 26
function 65
Index 685
E35 user exit EFS program (continued)
altering record length 342 addressing and residence mode 532
Changing Records 335 closing data sets 541
EXEC PARM option 39 context area 550
interface with COBOL 352 examining, altering, ignoring control statements 539
LINKAGE SECTION fields for fixed-length example 560
records 354 exit routine 541, 553, 554
LINKAGE SECTION fields for variable-length function 553
records 354 functions 532, 538
Procedure Division Requirements 357 interface parameter list 541, 552
return codes 337 opening and initializing data sets 539
E37 user exit restrictions program in effect 87
closing data sets 339 restrictions when program in effect 87
E38 user exit return codes you must supply 557
handling input data sets 339 supplying messages 541
using with VSAM 339 terminating DFSORT 541
E39 user exit user exit routine
handling output data sets 339 addressing and residence mode 556
using with QSAM/BSAM 339 EFS Program
using with VSAM 339 example 562
E61 user exit EFS01
altering control fields 342 function description 553
information DFSORT passes to your routine 333 parameter list 554
modifying control fields 332 user exit routine 553
uses 332 EFS02
edit masks address=0 562
ICETOOL DISPLAY operator 410, 411 function description 553
OUTFIL 215, 223 parameter list 556
editing records user exit routine 554
See reformatting records EFSDPAFT 559
efficiency DEBUG control statement option 92
using main storage 564 EFSDPBFR 559
EFS 547 DEBUG control statement option 93
efficiency 571 elapsed time
EXEC PARM option 38 improving with devices 567
exit routines 537 END control statement
initialization phase 535 examples 95
input phase 537 function 83
installation option 17 using 95
OPTION control statement option 152 ENDREC parameter
phases 533 OUTFIL control statements option 196, 200
processing 534 enhancing performance with installation options 567
termination phase 537 EODAD 329
using 532, 562 EQUALS 6
what you can do with EFS 538, 541 efficiency 571
EFS interface EXEC PARM option 38
control statement length 549 installation option 18
control statement request list 544 MERGE control statement option 133
control statement string 544, 546 OPTION control statement option 153
D1 format 547 SORT control statement option 304
D2 format 548 EQUCOUNT
defined 541 DEBUG control statement option 93
DFSORT action codes 543 efficiency 571
extract buffer offsets list 550 ERET
function 533 installation option 18
information flags 550 EROPT 329
message list 552 error messages 22
program context area 550 error recovery routine
record lengths list 550 user exit 319
EFS program errors
activating 533 critical 675
Index 687
format (continued) HEADER1 parameter
ISCII/ASCII trailing sign format OUTFIL control statements option 197, 236, 240
See AST (ISCII/ASCII trailing sign) format HEADER2 parameter
leading overpunch sign format OUTFIL control statements option 197, 246
See CLO/OL (leading overpunch sign) format HEADER3 parameter
leading sign format OUTFIL control statements option 254
See CSL/LS (leading sign) format hexadecimal constants 104
packed decimal format hexadecimal display
See PD (packed decimal) format DISPLAY operator 413
trailing overpunch sign format OCCUR operator 448
See CTO/OT (trailing overpunch sign) format HFS 15
trailing sign format HILEVEL=YES
See CST/TS (trailing sign) format MODS control statement option 137
user defined format (D1) Hipersorting
See D1 format advantages to using 576
user defined format (D2) defined 576
See D2 format Hiperspace
zoned decimal format defined 576
See ZD (zoned decimal) format limiting factors 158
format of 24-bit parameter list 366, 371 HIPRMAX
format of extended parameter list 372, 374 efficiency 577
FORMAT=f EXEC PARM option 41
INCLUDE control statement option 96, 98 installation option 18
MERGE control statement option 133 OPTION control statement option 158
OMIT control statement option 139, 141 home page (web) 3
SORT control statement option 303 how EFS works 533, 538
SUM control statement option 309 how user exit routines affect DFSORT
formats for SORT, MERGE, INCLUDE, and OMIT performance 321
control statements 547
formatting
OUTFIL 214 I
four-digit year I/O errors 319
transforming dates 188 ICEGENER
FSZEST installation option 18 efficiency 579
FTOV parameter example 610
OUTFIL control statements option 197, 231 return codes 581
FTP site 4 ICEGENER facility 579, 582
functions of routines at user exits 317, 320 ICEMAC installation options 16, 21
ICETOOL 383
calling from a program 498
G coding rules 392
GENER installation option 18 complete sample job 611
general coding rules 84, 88 description 383
general considerations 12, 13 example of simple job 386
GNPAD installation option 18, 581 examples 387, 388, 395, 399, 426, 442, 452, 457,
GNTRUNC installation option 18, 581 462, 468, 474, 494, 496, 497
ICETOOL/DFSORT relationship 383
invoking 386
H JCL 384
handling input data sets DFSMSG DD statement 384
E18 user exit 328 JOBLIB DD statement 384
E38 user exit 339 restrictions 392
handling input to a merge statements 390
E32 user exit 334 STEPLIB DD statement 384
handling intermediate storage miscalculation summary 384
E16 user exit 327 SYMNAMES DD statemen 384
handling output data sets SYMNOUT DD statemen 384
E39 user exit 339 TOOLIN DD statement 384, 391
handling output to work data sets TOOLMSG DD statement 384, 390
E19 user exit 331 operators 384
handling special I/O 319 COPY 385, 389, 393
Index 689
Join LOCALE (continued)
SPLICE operator 470 installation option 19
OPTION control statement option 161
using 6
K logical operator 116
keeping records 1 LookAt message retrieval tool xvii
key-sequenced data set (KSDS) 14 lookup and change 197, 227, 272
key, defined 5
keyboard 677
M
macro instructions
L See system macro instructions 363
label field 84 main features of sources of DFSORT options 626, 627
length main storage
altered control statement 550 allocating
LRECL for variable-length record 15 consequences of increasing 573
maximum record 12 allocating efficiently 572
original control statement 549 factors affecting requirements 572
record descriptor word (RDW) 15 minimum 571
record lengths list 550 releasing 574
licensed documents xviii tuning 572
limitations using efficiently 571, 575
data set 12 MAINSIZE
length See also SIZE
maximum record 12 allocating storage 572
minimum block 13 OPTION control statement option 162
minimum record 13 releasing main storage 574
record Major Call 1 560
maximum length 12 Major Call 2 560
storage constraints 13 Major Call 3 561
LINES parameter Major Call 4 562
OUTFIL control statements option 197 Major Call 5 562
LINK 363 major control field
writing macro instructions 375 See control field
link-editing managing system data, rules
performance 571 system data management rules 12
user exit routines 323 master console messages 22
linkage conventions 322 Match
linkage editor 64 SPLICE operator 470
linkage examples 323 maximizing performance 564
LIST maximum of fields and constants
EXEC PARM option 42 INREC 126
installation option 18 OUTFIL 225
OPTION control statement option 160 OUTREC 288
with an EFS program 541 MAXLIM
LISTX allocating storage 572
EXEC PARM option 42 installation option 19
installation option 19 releasing main storage 574
OPTION control statement option 160 memory object
with an EFS program 541 definition 163
loading user exit routines 321 specifying with EXEC PARM 44
locale specifying with OPTION control statement 163
affecting INCLUDE and OMIT processing 105 memory object sorting
affecting MERGE processing 133 advantages 578
defined 6 considerations 578
restrictions definition 578
CHALT 146 MERGE control statement
EFS 38, 153 examples 135
LOCALE function 82
efficiency 570, 571 using 132, 135
EXEC PARM option 43 merge examples 605, 607
Index 691
NOVERIFY (continued) operating systems, compatible 5
OPTION control statement option 182 operation field 84
NOVLLONG OPTION control statement
EXEC PARM option 55 examples 189, 194
OPTION control statement option 182 function 82
NOVLSCMP special handling 545
EXEC PARM option 55 using 142, 194
OPTION control statement option 183 OPTION Statement Examples 189, 194
NOVLSHRT options, installation 15
EXEC PARM option 55 OUTFIL
OPTION control statement option 185 DD statement 72
NOVSAMIO digits needed for numeric fields 218
EXEC PARM option 56 edit field formats and lengths 214
NOWRKREL edit mask output field lengths 218
EXEC PARM option 57 edit mask patterns 215
OPTION control statement option 187 edit mask signs 217
NOWRKSEC efficiency 570
EXEC PARM option 57 lookup and change 197, 227, 272
OPTION control statement option 187 producing reports 197, 204
NULLOFL installation option 19 storage limits 162, 262, 573
NULLOFL parameter table lookup and change 227, 272
OUTFIL control statements option 235 OUTFIL control statement
NULLOUT function 83
EXEC PARM option 46 OUTFIL control statements
OPTION control statement option 167 examples 265, 274, 275, 276
NULLOUT installation option 19 function 82
numerice editing and formatting using 194, 274, 275, 276
DISPLAY operator 409 outfil DD statement
NVSAMEMT defined 26
EXEC PARM option 56 function 65
NZDPRINT OUTFIL statements examples 265, 274, 275, 276
EXEC PARM option 58 OUTFIL statements notes 262, 265
OPTION control statement option 188 output data set
requirements 12
valid types 12
O OUTREC control statement
occurrences column alignment 282
OCCUR operator (ICETOOL) 444 differences from OUTREC parameter 282
SELECT operator (ICETOOL) 458 examples 290, 292, 293
ODMAXBF function 83
EXEC PARM option 46 input field 285
installation option 19 separation field
OPTION control statement option 168 binary zero separation 283
OUTFIL control statements option 262 blank separation 283
OMIT control statement character string separation 283
efficiency 570 current date constant 284
example 141 hexadecimal string separation 283
function 82 using 281, 292, 293
using 141 OUTREC parameter
OMIT parameter lookup 197, 227, 272
OUTFIL control statements option 196, 202 OUTFIL control statements option 197, 203, 229
OMIT Statement Example 141 OUTREC statement examples 290, 292, 293
omitting records 1, 139 OUTREC statement notes 289
user-defined data types 532 OUTREL
opening and initializing data sets 318, 539 EXEC PARM option 47
opening data sets installation option 19
E11 user exit 324 OUTSEC installation option 19
E31 user exit 334 overflow 128, 310
EFS 535 OVERRGN 574
user exit routines 318 installation option 19
operand field 84 releasing main storage 574
Index 693
record (continued) REMOVECC parameter
inserting, deleting, and altering 319 OUTFIL control statements option 261
maximum length 12 RENT 322
merging 132 reordering control fields
minimum length 13 See reformatting records 118, 281
modifying with user exit 319 REPEAT parameter
number to be sorted 40 OUTFIL control statements option 233
padding 104, 581 report
passing with user exit routines 324 ANSI carriage control character 197, 204, 232, 241,
processing for OUTFIL 196 246, 248, 252, 254, 257, 262, 263
processing order 7, 116, 127, 128, 289 header, OUTFIL 237
EFS 557 ICETOOL DISPLAY 405, 438
reformatting 281 ICETOOL OCCUR 444, 455
sorting 298 OUTFIL elements 3, 195
storage constraints 13 producing for OUTFIL 197, 204
summing 2, 307 trailer, OUTFIL 241
E35 user exit 338 requesting a SNAP dump 559
with user exits 319 requirements
truncating 104, 581 input data set 11
user-defined data types 532 JCL 25
variable-length main storage
efficiency 566 factors affecting 572
RECORD control statement output data set 11
coding notes 296 RESALL
examples 297 EXEC PARM option 48
function 83 installation option 19
using 293 OPTION control statement option 170
record processing order 557, 558 RESERVEX
record type See ARESALL EXEC PARM option
specifying 293 RESET
records installation option 19
duplicate 307, 444, 458 OPTION control statement option 171
unique residence mode
OCCUR operator (ICETOOL) 444 EFS program 532
SELECT operator (ICETOOL) 458 EFS program user exit routine 556
UNIQUE operator (ICETOOL) 494 user exits 320
recovering from unexpected abends 674 RESINV 574
reformatting records 2, 319 installation option 19
with INREC 118 OPTION control statement option 171
with OUTREC 281 restarting after an abend 673
REGION Restriction
allocating storage 572 invoking DFSORT using ICEMAN 4
determining storage 572 using OUTREC instead of INREC could cause
releasing main storage 574 overflow 130
size 572 Restrictions
Related reading ICETOOL limitations 383
additional functions with ICETOOL SELECT not restrictions for dynamic invocation 379
available with XSUM 311 Return Code
relational condition DFSORT 22
comparison operator 99, 114 return codes
constants EFS 557
character string format 102 Return Codes
date string format 115 ICEGENER 581
decimal number format 102 ICETOOL 505
hexadecimal string format 104 REXX examples 584
defined 98 RMODE 323
description 98, 99 rules for parsing 546
format 99, 104, 114 rules, for managing system data
releasing main storage 574 system data management rules 12
remark field 85 run-time phase 533
running DFSORT with JCL 60, 78
Index 695
SORTMODS DD statement storage (continued)
defined 27 temporary 575
function 66 tracks versus cylinders 566, 622
SORTOUT user exit routine 320, 344
OPTION control statement option 178 storage administrator examples 584
OUTFIL ddname 196 storage usage
SORTOUT DD statement records at E35 user exit 338
defined 26 substring comparison operator 107
function 65 substring comparison tests 108
using 72, 74 relational condition format 107
SORTSNAP DD statement subtracting fields and constants
defined 26 INREC 126
function 66 OUTFIL 225
using 78 OUTREC 288
SORTWKdd DD statement SUM control statement 311
defined 26 description 307
duplicate 62 efficiency 570
function 65 examples 311
using 70 function 83
SORTWKdd DD Statement summary field 308
dataspace sorting 70 using 311
SPANINC SUM statement examples 311
EXEC PARM option 52 SUM statement notes 309, 311
installation option 20 summarizing records 307
option control statement 178 summary field
special handling of OPTION and DEBUG control formats 308
statements 545 table of formats and lengths 308
specification/override of DFSORT options 625, 655 Summary Field Formats and Lengths Table 308
specifying efficient sort/merge techniques 565 summing
specifying input/output data set characteristics records 307, 319
accurately 566 records at E35 user exit 338
SPLICE operator (ICETOOL) 470 summing records 2
SPLIT parameter supplying messages for printing to the message data
OUTFIL control statements option 234 set 541
SPLITBY parameter SVC installation option 20
OUTFIL control statements option 234, 236 Symbols
STARTREC parameter Comment and Blank Statement 511
OUTFIL control statements option 196, 200 example 508
STATS operator (ICETOOL) 492 for fields and constants 507
STEPLIB DD statement in DFSORT Statements 520
defined 26 in ICETOOL Operators
using 63 DISPLAY 526
STIMER ICETOOL Example 527
EXEC PARM option 52 OCCUR 526
installation option 20 RANGE 526
STOPAFT SELECT 526
efficiency 570 SPLICE 526
EXEC PARM option 53 STATS, UNIQUE and VERIFY 526
MERGE control statement option 134 in ICETOOL statements 525
OPTION control statement option 179 INCLUDE and OMIT 522
SORT control statement option 305 INREC and OUTREC 522
storage Keyword Statements 517
efficient 566, 622 Notes 528
exceeding capacity 622, 623 OUTFIL 523
intermediate 575 overview 507
limits, OUTFIL 262 SORT and MERGE 521
main SUM 522
factors affecting requirements 572 Symbol Statements 511
releasing 574 SYMNAMES DD Statement 510
tuning 572 SYMNAMES Statements 510
specifying for user exit routine 136, 138 SYMNOUT DD Statement 510
Index 697
user exit (continued) VLTRIM parameter
E16 327 OUTFIL control statements option 231
E17 328 VSAM
E18 328 data set 11
E19 331 data set considerations 14
E31 334 E18 user exit 329
E32 334 E38 user exit 339
E35 335, 336, 351 E39 user exit 339
E37 339 key-sequenced data set (KSDS) 14
E38 339 maximum record size
E39 339 with INREC control statement 128, 289
E61 332 user exit functions 320
efficiency 571 using RECORD control statement 293
functions 317 VSAMBSP installation option 20
language requirements 314 VSAMEMT
link-editing 323 EXEC PARM option 56
linkage conventions 322 installation option 21
loading routines 321 OPTION control statement option 186
overview 314 VSAMIO
passing control with MODS control statement 136 EXEC PARM option 56
summary of rules 321, 324 installation option 21
using RECORD control statement 293 OPTION control statement option 186
using routines 314, 339 VTOF parameter
using your own routines 340, 362 OUTFIL control statements option 229
user exit linkage conventions 322
USEWKDD
OPTION control statement option 181 W
using control statements from other IBM programs 87, Web 3
88 web site 3
using DD statements 60, 78 work space
using DFSORT program control statements 81, 311 requirements for DFSORT 615
using options that enhance performance 567 using 615, 624
WRKREL
EXEC PARM option 57
V installation option 21
variable-length record OPTION control statement option 187
longest record length 15 WRKSEC
record descriptor word 15 EXEC PARM option 57
VERIFY installation option 21
efficiency 571 OPTION control statement option 187
EXEC PARM option 54
installation option 20
OPTION control statement option 182 X
VERIFY operator (ICETOOL) 496 XCTL
VIO using 363
ICEMAC installation option 77 writing macro instructions 375
installation option 20
VLFILL parameter
OUTFIL control statements option 230 Y
VLLONG Y2 formats
EXEC PARM option 55 description 660
installation option 20 in INCLUDE and OMIT 114, 140
OPTION control statement option 182 in OUTFIL OUTREC 211
VLSCMP in SORT and MERGE 301
EXEC PARM option 55 Y2PAST
installation option 20 EXEC PARM option 58
OPTION control statement option 183 installation option 21
VLSHRT MERGE control statement option 134
EXEC PARM option 55 OPTION control statement option 188
installation option 20 SORT control statement option 305
OPTION control statement option 185
Z
ZD (zoned decimal) format
description 657
DISPLAY operator 408
INCLUDE statement 99
OCCUR operator 446
OUTFIL statements 214
RANGE operator 456
SELECT operator 461
SORT statement 301
STATS operator 493
SUM statement 308
UNIQUE operator 495
VERIFY operator 497
ZDPRINT
EXEC PARM option 58
installation option 21
OPTION control statement option 188
Index 699
700 z/OS V1R5.0 DFSORT Application Programming Guide
Readers Comments Wed Like to Hear from You
z/OS
DFSORT Application Programming Guide
Overall, how satisfied are you with the information in this book?
How satisfied are you that the information in this book is:
When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any
way it believes appropriate without incurring any obligation to you.
Name Address
Company or Organization
Phone No.
___________________________________________________________________________________________________
Readers Comments Wed Like to Hear from You Cut or Fold
SC26-7523-00 Along Line
_ _ _ _ _ _ _Fold
_ _ _and
_ _ _Tape
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _Please
_ _ _ _ _do
_ _not
_ _ staple
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _Fold
_ _ _and
_ _ Tape
______
NO POSTAGE
NECESSARY
IF MAILED IN THE
UNITED STATES
_________________________________________________________________________________________
Fold and Tape Please do not staple Fold and Tape
Cut or Fold
SC26-7523-00 Along Line
Printed in USA
SC26-7523-00