HP RPG/iX Utilities Reference Manual (30318-90006)
3-36
6 Chapter 5 Record Type Specifications
Introduction
Record Type Specifications tell XSORT which records in a file you wish to have sorted. If you want all the
records in a file to be sorted, and they have all been prepared in the same format, you do not have to fill out
this section of your XSORT specifications. Often, however, you use these entries to select records for the
sort based on comparisons. Your Record Type Specifications will instruct XSORT to compare data in one
field (factor 1) with a constant value or data in another field on the same record (factor 2) to decide whether
to include (select) or omit (reject) the record for processing.
Record Types
Data records from the input files may be identified by "type" according to characteristics defined in XSORT
Record Type specifications. All records in any Record Type have one or more unique characteristics in
common--for example, a 3 in position 5 AND not an X in position 80. Multiple characteristics used to
identify one Record Type are tied together using the AND operation ("A" in column 7 of Record Type
specifications).
Sections
A "section" is a subset of the input records which is defined by naming one or more Record Types to be
included or omitted from it. All records included in a section will be sorted and formatted in the same
manner, according to Field Description specifications. The term "section" also refers to the XSORT
specifications used to define the section. These consist of Record Type lines which identify the Record
Types of the section, followed immediately by Field Descriptions, showing how the section is to be sorted
and formatted on output. These sections of specs (one or more) must all follow the Header, ALTSEQ, and S
Option specifications.
Multiple Record Types named for one section are tied together using the OR operation ("O" in column 7 of
Record Type specifications) whenever several include sets or several omit sets are defined consecutively.
(See discussion of sets below.)
The specification sections are used in order of their appearance to identify and categorize each input
record. The first section to "accept" an input record for processing is the one used to determine how it will
be sorted and formatted. If a section "rejects" the input record, XSORT moves on to the next section to
attempt identification. If no section "accepts" the record, it will not be included in any sort processing.
Include-all
is a section of specifications consisting of a single Record Type line containing "I" in column 6 and blanks in
columns 7 through 39, followed by Field Description lines. This says that all remaining input records are
to be included in this section unconditionally. If used, it must be the last line of the last section defined for
the sort job. Include-all is generally used as a "catch-all" mechanism to identify any records not already
accepted for processing by any of the preceding specification sections.
Implied Include-all
is a section of specifications consisting only of Field Descriptions. When used, it must be the only
specification section defined for the job. It says that all input records are to be included in the sort