Example:
$ SORT/STATISTICS PRICE1.DAT,PRICE2.DAT PRICE.LIS
OpenVMS Sort/Merge Statistics Records read: 793 Input record length: 80 Records sorted: 793 Internal length: 80 Records output: 793 Output record length: 80 Working set extent: 100 Sort tree size: 412 Virtual memory: 433 Number of initial runs: 2 Direct I/O: 22 Maximum merge order: 2 Buffered I/O: 9 Number of merge passes: 1 Page faults: 3418 Work file allocation: 114 Elapsed time: 00:00:05.98 Elapsed CPU: 00:00:03.63
/WORK_FILES[=n]
$ ASSIGN DRA5: SORTWORK0 $ ASSIGN DB0: SORTWORK1 $ ASSIGN DB1: SORTWORK2 $ SORT/KEY=(POS:1,SIZ:80)/WORK_FILES=3 - _$ STATS1,STATS2,STATS3,STATS4 SUMMARY.LIS
$ ASSIGN DRA5:[WORKSPACE] SORTWORK0
The following input qualifier should be included immediately after the input file specification in the SORT or MERGE command line:
/FORMAT=(RECORD_SIZE:n,FILE_SIZE:n)
RECORD_SIZE: n |
Specifies the input file's longest record length (LRL) in bytes. The
maximum longest record length that can be specified depends on the file
organization:
|
||||||
These values include control bytes for variable records with fixed-length control (VFC) format. | |||||||
FILE_SIZE: n | Specifies input file size in blocks. The maximum file size accepted is 4,294,967,295 blocks. |
$ SORT/KEY=(POS:40,SIZ:2,DESC) - _$CRA0:YRENDAVG.DAT/FORMAT=(RECORD_SIZE:41,FILE_SIZE:3) - _$DESCYRAVG.LIS
The following output qualifiers can be used with the SORT and MERGE commands. To use an output file qualifier, include the qualifier immediately after the output file specification in the SORT or MERGE command line.
/ALLOCATION=n
$ SORT/KEY=(POS:1,SIZ:80) STATS.DAT - _$ SUMMARY.LIS/ALLOCATION=1000/CONTIGUOUS
/BUCKET_SIZE=n
$ SORT/KEY=(POS:1,SIZ:80) STATS1.DAT,STATS2.DAT - _$ SUMMARY.LIS/BUCKET_SIZE=16/RELATIVE
/CONTIGUOUS
$ SORT/KEY=(POS:1,SIZ:80) STATS.DAT - _$ SUMMARY.LIS/ALLOCATION=1000/CONTIGUOUS
/FORMAT=(type:n[,...])
BLOCK_SIZE: n | Specifies the output file's block size, in bytes, if you have directed the file to magnetic tape. If the input file is a tape file, the block size of the output file defaults to that of the input file. Otherwise, the output file block size defaults to the size used when the tape was mounted. |
Acceptable values for n range from 20 to 65,532. To ensure correct data interchange with other Digital systems, however, specify a block size of not more than 512 bytes. For compatibility with systems that are not made by Digital, the block size should not exceed 2,048 bytes. | |
CONTROLLED: n | Specifies variable with fixed-length control (VFC) records in the output file. |
FIXED: n | Specifies fixed-length records in the output file. |
SIZE: n | Specifies the size, in bytes, of the fixed portion of VFC (CONTROLLED) records, up to a maximum of 255 bytes. If you do not specify SIZE, the default is the size of the fixed portion of the first input file. If you specify this size as 0, OpenVMS RMS defaults the value to 2 bytes. |
VARIABLE: n | Specifies variable-length records in the output file. |
Sequential files | 32,767 |
Relative files | 16,383 |
Indexed-sequential files | 16,362 |
$ SORT/KEY=(POS:1,SIZ:80) STATS.DAT SUMMARY.LIS/FORMAT=FIXED:80
/INDEXED_SEQUENTIAL
(The high-performance Sort/Merge utility does not support indexed sequential output file organization. Implementation of this feature is deferred to a future OpenVMS Alpha release.)
$ CREATE/FDL=NEW.FDL AVERAGE.DAT $ SORT/KEY=(POS:1,SIZ:80) DATA.DAT,STATS.DAT - _$ AVERAGE.DAT/INDEXED_SEQUENTIAL/OVERLAY
/OVERLAY
(The high-performance Sort/Merge utility does not support use of the /OVERLAY qualifier. Support of this feature is deferred to a future OpenVMS Alpha release.)
$ CREATE/FDL=NEW.FDL AVERAGE.DAT $ SORT/KEY=(POS:1,SIZ:80) STATS.DAT AVERAGE.DAT/OVERLAY
/RELATIVE
$ SORT/KEY=(POS:1,SIZ:80) STATS.DAT SUMMARY.LIS/RELATIVE
/SEQUENTIAL
$ SORT/KEY=(POS:1,SIZ:80) STATS.DAT SUMMARY.LIS/SEQUENTIAL
The following qualifiers can be used in specification files. (The high-performance Sort/Merge utility does not support specification files. Implementation of this feature is deferred to a future OpenVMS Alpha release.) Note that these qualifiers are valid only within a Sort/Merge specification file.
/CDD_PATH_NAME="cdd-path-name"
/CDD_PATH_NAME="customer"
/[NO]CHECK_SEQUENCE
/NOCHECK_SEQUENCE
/COLLATING_SEQUENCE=(SEQUENCE=sequence-type
[,MODIFICATION=("char1" operator "char2")]
[,IGNORE=character or character range,...] [,FOLD]
[,[NO]TIE_BREAK])
SEQUENCE | Specification files support the ASCII, EBCDIC, multinational, and user-defined collating sequences. See Section 11.4 for information about these collating sequences. | ||||||||||
MODIFICATION |
Specifies a change to the collating sequence specified in the SEQUENCE
option. You can modify the ASCII, EBCDIC, Multinational, or
user-defined sequence. The sequence being modified must be specified
with the SEQUENCE qualifier even if the sequence is the default (ASCII).
|
||||||||||
The following kinds of changes are permitted in the MODIFICATION option:
|
|||||||||||
IGNORE | Specifies that Sort/Merge ignore a character or character range in the collating sequence when making an initial comparison. Note that, when tie-breaking takes place, Sort/Merge considers the characters specified with the IGNORE value. | ||||||||||
FOLD | Specifies that all lowercase letters be given the collating value of their uppercase equivalents. For ASCII, EBCDIC, and user-defined sequences, the lowercase letters are a to z. | ||||||||||
Because the lowercase letters in the Multinational sequence already have the collating value of their uppercase equivalents, using FOLD is unnecessary. | |||||||||||
[NO]TIE_BREAK | Specifies whether or not Sort/Merge should use numeric values to break any ties between characters that have equivalent values. By default, tie-breaking occurs with the Multinational sequence. Specifying NOTIE_BREAK overrides this default and ensures that no further comparisons are made after the initial comparison. | ||||||||||
A TIE_BREAK option must be specified for the ASCII, EBCDIC, and user-defined sequences in order for tie-breaking to occur. TIE_BREAK should be used when specifying the FOLD or MODIFICATION value for the these sequences. |
/CONDITION=(NAME=condition-name,
TEST=(field-name operator
test-condition [logical-operator...]))
/KEY=(IF condition-name THEN value ELSE value)
/DATA=(IF condition-name THEN "new-contents" ELSE "new-contents")
NAME | Specifies the name of the condition that you are testing. This condition-name can be used in /KEY, /DATA, /OMIT, and /INCLUDE qualifiers after it has been defined using the /CONDITION qualifier. | ||||||||
TEST |
Specifies the conditional test.
|
/DATA=field-name
/DATA=(IF condition THEN "new
contents" ELSE "new contents")
/DATA=(IF condition-name THEN "new-contents" ELSE "new-contents")
field-name | Specifies the name of a field in a record. The field-name must be defined previously in a /FIELD qualifier. |
condition-name | Specifies a condition-name that has been defined previously in a /CONDITION qualifier. |
new-contents | Specifies how the record is to be altered. The new-contents can be a constant or a field-name that has been defined in a /FIELD qualifier. |
Examples:
See Section 11.8 for examples of
the use of the /DATA qualifier in specification files.
/FIELD=(NAME=field-name,POSITION:n,SIZE:N,[DIGITS:n,]data-type /FIELD=(NAME=field-name,VALUE:n,SIZE:N,[DIGITS:n,]data-type)
NAME | Specifies the name of the field. The field-name cannot have any embedded spaces, must begin with an alphabetic character, and can be no longer than 31 characters. | ||||||
POSITION: n | Specifies the position of the field in the record. | ||||||
VALUE: n | Assigns a value to a constant field for use in a /CONDITION, /DATA, or /KEY statement. If you specify VALUE: n, do not specify /POSITION: n because the field is a constant and not part of an input record. | ||||||
SIZE: n |
Specifies the size of a field containing character or binary data. In
the specification file, SIZE implies byte lengths. The data type
determines what values are acceptable, as follows:
|
||||||
DIGITS: n | Specifies the size of a field containing decimal data. The size of a field containing decimal data must not exceed 31 digits. Note that DIGITS:n is used only when describing a field containing decimal data. | ||||||
data-type | Specifies the data type of the field. You are not required to specify the data-type if it is character; Sort assumes character data type by default. See Section 11.3.3 for a list of the data types recognized by Sort/Merge. |
/FIELD=(NAME=SALARY,POSITION:10,DIGITS:8,DECIMAL)
/INCLUDE=(CONDITION=condition[,KEY=...] [,DATA=...])
CONDITION | Refers to the condition-name specified in a previous /CONDITION qualifier. |
KEY | Defines a key field because the default record type defined in the /KEY qualifier is not being used. |
DATA | Defines a data field because the default record type defined in the /DATA qualifier is not being used. |
/FIELD=(NAME=ZIP,POSITION:20,SIZE:6) /CONDITION=(NAME=LOCATION, TEST=(ZIP EQ "01863")) /INCLUDE=(CONDITION=LOCATION)
/KEY=field-name
/KEY=(field-name,order) /KEY=([IF
condition THEN value ELSE]...) value [,order]
/KEY=(IF condition-name THEN value ELSE value)
field-name | Specifies the name of the key field. The field-name has been previously specified in a /FIELD qualifier. |
order | Specifies the order of the sort. The ASCENDING option specifies ascending order for a Sort or Merge operation. This option is the default. The DESCENDING option specifies descending order for a Sort or Merge operation. |
value | Specifies the key. The value can be a constant or a field-name that has been defined in a /FIELD qualifier. |
/FIELD=(NAME=SALARY,POSITION:10,DIGITS:8,DECIMAL) /KEY=(SALARY,DESCENDING)
/FIELD=(NAME=ZIP,POSITION:20,SIZE:6) /CONDITION=(NAME=LOCATION, TEST=(ZIP EQ "01863")) /KEY=(IF LOCATION THEN 1 ELSE 2)
/FIELD=(NAME=ZIP,POSITION:20,SIZE:6) /CONDITION=(NAME=LOCATION, TEST=(ZIP EQ "01863")) /OMIT=(CONDITION=LOCATION)
/PAD="."
/PROCESS=tag
/STABLE
6489P019.HTM OSSG Documentation 22-NOV-1996 13:17:03.98
Copyright © Digital Equipment Corporation 1996. All Rights Reserved.