| Introduction | MTB Statements | File System | Compiler | Applications | Reference Guide | Index |
| Language Structure | Data Division | I/O Format Division | Procedure Division | Mnemonics |
| Syntax: | KEY(lun [,EXCP=statement-label]) |
| Discussion: |
The KEY function returns the value of the next key in the keyed
file open on the specified logical unit number. The next key is
the key following the position of the record pointer. (Keys are
stored in ASCII order.)
Notes:
|
| Example: |
OPEN (1) "SALES" . . . NEXTKEY$ = KEY(1,EXCP=9999)In the above example, the KEY function is used to determine the value of the next key in the SALES file. The resulting value depends upon the statements between the opening of the file (when the pointer is positioned at the beginning of the file) and the execution of the KEY function. |