HP RPG/iX Utilities Reference Manual (30318-90006)
3-46
commands.
Control Fields
(N, O, or F) Entries
When your file has more than one Record Section:
• The number of control fields do not have to be the same for all Record Sections.
• The total lengths of all the control fields do not have to be the same for all Record Sections (it is the max-
imum of these lengths that is entered in Header Specification columns 13-17).
Normal and Opposite Control Fields (N and O) Entry
These are fields used by the program to sort your input records. They are fields normally taken from the
input records, although you can alter or add to them using forced control fields. (See later sections for
more information concerning the use of forced control fields.)
Opposite Control Fields
At times you may wish to sort records so that some control fields are in ascending order and some are in
descending order. You use opposite control fields to accomplish this.
Your Header Specification establishes the default sorting order. You will sort in ascending order if you
have specified descending order in your Header Specification and called for an opposite control field. You
will sort in descending order if your Header Specification called for ascending order and you enter O for an
opposite control field. XSORT changes your control fields while building the work records if you specify
opposite control fields. There is little reason to retain these fields and usually they are dropped -- by
entering an X in column 28 of the Header line. If you wish to retain the original control fields in your
output records in a meaningful form, repeat the information as a data field.
Sequencing Information with Control Fields
You determine the sequence of records in your Record-out sorts and the record addresses in your Address-
out sorts by the order in which you describe control fields in your field description entries. How this occurs
is illustrated below.
Column 7 Entry Meaning To Program
N This is a normal control field. The field will be sorted according to the sequence
specified in column 18 of the Header Specifications.
O This is an opposite control field. It tells the program to sort the data in the
sequence opposite to that specified in column 18 of the Header Specifications.
F This is a forced control field. The entries in columns 9-19 indicate how the con-
trol field is to be changed.
D This is a data field (used for SORTR only).
* This is a comment line.