SORT-MERGE/XL General User's Guide (32650-90883)

68 Chapter6
SORT-MERGE/XL Commands
ALTSEQ
DISCUSSION
Each modification of the collating sequence changes the ordinal values in the translation
table assigned to the characters specified by
leftspec
. Refer to the >SHOW command for a
discussion of the translation table. If
rightspec
is longer than
leftspec
, the extra
characters are ignored. If
leftspec
is longer than
rightspec
and neither EACH nor MERGE
has been specified,
rightspec
is padded with blanks to make it equal in length to
leftspec
. For example, the command, >ALTSEQ "SAW"="TG" gives S, A, and W the ordinal
values T, G, and space. (See the discussion below for explanations of
modspec
with EACH
and MERGE.) These assignments of new ordinal values are only for collating purposes. That
is, the identity of the character is not lost; data is unchanged and appears in its original
form in the output.
You must issue a >DATA command, specifying data type and a collating sequence type
before you can use the >ALTSEQ command in any SORT/XL or MERGE/XL operation. The
system displays the error message THE DATA COMMAND MUST BE ISSUED BEFORE THE
ALTSEQ COMMAND CAN BE ISSUED, if the >ALTSEQ command is not preceded by a >DATA
command.
NOTE
The operation of SORT/XL (or MERGE/XL) is slower when you define a
collating sequence with the >ALTSEQ command than when a standard ASCII
or EBCDIC collating sequence is used.
Using modspec With EACH
If EACH is specified, the modifications of the collating sequence are the same as explained
above, except if
leftspec
is longer than
rightspec
,
rightspec
is concatenated to itself a
sufficient number of times to make it equal in length to
leftspec
. For example, the
command, >ALTSEQ EACH "ADW"="FG", give A, D, and W the ordinal values obtained by
taking the ASCII code decimal values of F, G, and F. Assuming the basic collating sequence
has been specified as ASCII, this means A=70 appears in the sixth row, fifth column of the
translation table, D=71 in the sixth row, eighth column, and W=70 in the eighth row,
seventh column. Note that 70 and 71 are the ASCII code decimal values of the characters F
and G, respectively. For additional information refer to the "EXAMPLES" section below.
Using modspec With MERGE
When MERGE is specified in the
modspec
parameter, the values in the translation table
assigned to the characters specified by
leftspec
and
rightspec
, and the characters in
between are modified. Characters are selected alternatively from
leftspec
and
rightspec
and the translation table is modified so the characters collate in this order. The
first character is always selected from
leftspec
. If
leftspec
precedes
rightspec
in the
collating sequence, the sequence is modified so the characters between the two ranges
collate after the merger of the ranges. If
rightspec
precedes
leftspec
, the characters
between the two ranges collate before the first character of the first range. When either
range is exhausted, the characters from the other range are simply appended until that
range is also exhausted. Note that the strings specified by
leftspec
and
rightspec
must
be strictly increasing and contiguous whenever MERGE is specified.