Key Command [K]. Robelle Suprtool 5.7
Annonce
Annonce
Key Command [K]
Specifies the next sort field for an extract task, using an explicit byte position in the record, not a field name. See "Sort Command [SO]" on page 268 for specifying sort fields by IMAGE field name or Defined field, or by field name in an SD file. Up to
20 Sort and Key commands may be specified per extract task; the first is the major sort field.
[KEY] byteposition,bytelen [,type] [,DESC]
(Default: type=BYTE, ASCENDING order).
Parameters
Desc specifies that the field is to be sorted in Descending order.
The byteposition is a number between 1 and the length of the input records, specifying where the sort field begins. The bytelen parameter is a number from 1 to the length of the record, specifying how long the sort field is.
The type is a word that gives the desired data-type of the field for sorting purposes:
Type
BYTE
INT/INTEGER
DOUBLE
REAL
LONG
IEEE
PACKED
PACKED*
DISPLAY
LOGICAL
CHARACTER
Description
(unsigned, straight compare)
(two's complement)
(two's complement)
(Classic floating-point)
(Classic floating-point)
(IEEE floating-point)
(packed-decimal)
(packed-decimal, last nibble unused)
(zoned-decimal numeric field)
(unsigned, like BYTE, 2 characters)
(for Native Language Support)
For compatibility with Sort.Pub.Sys, the Key command also accepts FPOINT as the data-type for IEEE numbers.
Examples
The first example sorts an integer (PIC S9(4) COMP) field which starts on the 11th byte of the input record. We sort the entire input file based on one key:
216 • Suprtool 5.7 for MPE
Suprtool Commands
>input bigfile {input from a disc file}
>key 11,2,int {key is an integer that starts}
>output outfile { at the 11th byte of Bigfile}
>xeq {create Outfile and prompt for}
{ more Suprtool commands}
>input discfile {another input file}
>key 14,4,double,desc {double integer (PIC S9(9) COMP)}
>output ofile2 {sort input in descending order}
>exit
The following examples show the various data-types and combinations that are available with the Key command:
>key 1,10 {byte data-type}
>key 1,10,desc {descending sort sequence}
>key 11,4,double {I2 or J2, S9(9) COMP}
>key 1,6;11,4,ieee {X6 string and an E2 field at byte 11}
>key 21,6,packed {P12, S9(11) COMP-3}
>key 21,6,packed* {P12, S9(10) COMP-3, wasted byte}
Notes
The command name, Key, is optional. Any command that starts with a numeric character is assumed to be a Key command. The Verify command shows all of the current key fields, and the Reset command cancels them. If no sort fields are defined prior to the Xeq or Exit command, Suprtool performs a copy, not a sort.
Suprtool Commands
Suprtool 5.7 for MPE• 217
Download
Annonce