Directives
SORT Create File for Sorting
 
Format SORT filename$,max_keysize[,max_rec][,ERR=stmtref]
 
Where:
 
filename$ Name of the SORT file to create. String expression.
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 statement label to which to transfer control.
 
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).
The type of file created can be determined by setting the 'KF'= System Parameter. 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.


*Note* As of Version 4.20, WindX supports the use of this directive via the [WDX] tag; e.g., SORT "[WDX]somefile.ext"... If you are running an earlier version of ProvideX on a WindX PC, you still need to encapsulate the command in an EXECUTE


"[WDX]..." directive. See [WDX] Direct Action to Client Machine.
 
Examples 0010 SORT "CSTFLE",6,100creates a file with the following structure:
 
Keyed file: C:\OTHER\MANUALS\PVX\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:\OTHER\MANUALS\PVX\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