Collate

From BR Wiki
Jump to navigation Jump to search

The Collate BRConfig.sys specification indicates which collating sequence the system should use. It can also be used with the Config Collate command or within a program line using the Execute statement.

Also used in the Option (Statement).

Comments and Examples

A collating sequence provides the means for organizing the binary values that represent letters of the alphabet, numbers, and other symbols. Each binary value (and thus each letter, number, or symbol) is assigned a number. The number that a particular character is assigned will differ according the collating sequence being used. The COLLATE specification tells Business Rules! which collating sequence to use.

Syntax

Start-up Default

COLLATE NATIVE  ! ASCII sequence

Parameters

COLLATE NATIVE specifies the ASCII collating sequence. In this sequence, the binary representations of the numbers 0-9 precede those of the uppercase letters A-Z, which in turn precede their lowercase counterparts. The numbers 0-9, then, are represented by ASCII codes 048-057; uppercase letters are represented by ASCII codes 065-090, and lowercase letters are represented by codes 097-122.
(See a complete listing of ASCII codes for details.)

The COLLATE ALTERNATE specification specifies a collating sequence similar to EBCDIC in that the numbers 0-9 follow uppercase and lowercase letters (other values will differ). With COLLATE ALTERNATE, 0-9 are represented by codes 176-195.

Technical Considerations

1.) The CONFIG command may be used during program execution to override the BRConfig.sys file's COLLATE specification.
2.) Business Rules! saves programs with whatever COLLATE option it is currently operating under. If you write a program when the system is using the default, for instance, the program runs with COLLATE NATIVE. If you resave the program when the system is using COLLATE ALTERNATE, however, the program then runs with COLLATE ALTERNATE.
3.) It is important to be consistent in your use of the COLLATE specification, as it affects all character comparisons-including AIDX, DIDX, MAX$, MIN$ and ORD A, as well as the SORT Facility's RECORD specification and character comparisons used in IF statements.
4.) The SORT function uses the current COLLATE specification unless a new one is specified in the SORT parameters. NOTE that the COLLATE ALTERNATE option overrides the FILE specification's "N" parameter when used with the SORT function (see Sort Facility for more information).
5.) Index files use the COLLATE option that is specified when the index is created or recreated; it does not matter what option is currently in effect in programs that use the index. See the Index command for a parameter to override this.

See Also

Collate Alternate