| Introduction | MTB Statements | File System | Compiler | Applications | Reference Guide | Index |
| Language Structure | Data Division | I/O Format Division | Procedure Division | Mnemonics |
| Syntax: | PREV(lun [,EXCP=statement-label]) |
| Discussion: |
The PREV function returns the value of the key immediately
previous to the current file pointer file attached to the
specified logical unit number. This feature provides a method for
a program to read backwards through a keyed file. (See the
FILE
statement for another method to read backwards through a keyed
file.)
The PREV function does not move the record pointer in the file. To move the record pointer, you must use input/output statements such as READ and WRITE. |
| Example: |
VALUE$ = PREV(1) ! Get previous key in logical unit number 1 |