Introduction MTB Statements File System Compiler Applications Reference Guide Index

Language Structure Data Division I/O Format Division Procedure Division Mnemonics

RECNUM function

Syntax: RECNUM(lun [,EXCP=statement-label])
Discussion: The RECNUM function returns the record number (numeric) of the keyed file that is open on the specified logical unit number.

Notes:

  1. The RECNUM function is valid only for keyed files.

  2. The RECNUM function does not move the record pointer.
Example:
OPEN (1) "ORDERS"
.
.
.
RECORDNUM = RECNUM(1,EXCP=9999)
In the above example, the RECNUM function is used to determine the value of the record number in the ORDERS file. If an exception occurs when this statement is executed, program control will transfer to exception-statement-label 9999.