325
SORT Directive
Create File for Sorting
Format
SORT filename$,max_keysize[,max_rec][,ERR=stmtref]
Where:
Name of the SORT file to create. String expression.
filename$
max_keysize Maximum key size to be maintained for this file. Numeric
expression.
max_rec
Estimated number of records that the file is to contain. Default is no
initial allocation of file space, with no limit on final size. Numeric
expression.
stmtref
Program line number or label to transfer control to.
Description
Use the SORT directive to create a data Sort file (a file with a key but no data record
portion). You must include the size of the key along with the name. The maximum
Sort key size allowed is 127. If the given filename already exists, ProvideX returns
Error #12: File does not exist (or already exists).
p.668. If 'KF' is not zero then the Sort file will be created as an EFF file. Only through
use of the 'KF' parameter will Sort files be created as EFF files
WindX supports the use of this directive via the [WDX] tag; e.g., SORT
See Also
File Types, User's Guide.
Examples
0010 SORT "CSTFLE",6,100 creates a file with the following structure:
Keyed file: C:\Program Files\Sage Software\ProvideX\CST\CSTFLE
Maximum Record size ..........: 0 (Sort file)
Maximum # records ............: 100
Current # records ............: 0
Size of key block ............: 2048 bytes
External key size ............: 6
0010 SORT A$+"_"+B$,10,100,ERR=1090 creates the following structure:
Keyed file: C:\Program Files\Sage Software\ProvideX\CST\CST_TST
Maximum Record size ..........: 0 (Sort file)
Maximum # records ............: 100
Current # records ............: 0
Size of key block ............: 3072 bytes
External key size ............: 10