IB Statements/position
From CometWiki
(New page: '''POSITION statement''' '''Syntax:''' POSITION (lun) KEY=argument [,EXCP=statement label] '''Discussion:''' The POSITION statement moves the file pointer to a specified key. If the...)
Newer edit →
Revision as of 10:29, 20 May 2009
POSITION statement
Syntax: POSITION (lun) KEY=argument [,EXCP=statement label]
Discussion: The POSITION statement moves the file pointer to a specified key. If the specified key is not found, the file pointer is moved to the next higher key in ascending ASCII order. The lun must be opened to a keyed file. The KEY argument may be a string constant or string variable.
The file pointer will be positioned to the specified key or to the next higher record if the key is not found.
This statement does not result in runtime exceptions. For example, an exception 32 is not returned if the specified key is not found. Likewise, an exception 2 is not returned if the specified key is beyond the ASCII range of the keys in the file.
Example: POSITION (1) KEY=CUSTNO$, EXCP=9999