ADD INDEX |
Add Key to Keyed File |
ADD INDEX keydescription$ TO filespec [,ERR=stmtref]
filespec |
Can be a numeric expression indicating the open channel number to use or a string expression containing the pathname of the file to which the key will be added. If using the file channel, it must be to a keyed or memory file, and if it is a keyed file, the channel must be locked. |
keydescription$ |
Description of the key using the same format as KEYED statement. |
stmtref |
Program line number or statement label to which to transfer control. |
Mandatory keyword, not case-sensitive. |
(Support for using a file channel was added in PxPlus 2023 Update 1.)
The ADD INDEX directive allows keys to be added to a PxPlus Keyed file without having to rebuild the file. When adding keys to the file:
DROP INDEX Drop Key from Keyed File
RENAME..INDEX Rename Keys in Keyed File
add index ["KeyName":2:1:30]+[1:1:6] to "cstfile"