IB Statements/position

From CometWiki

< IB Statements(Difference between revisions)
Jump to: navigation, search
(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...)
 
Line 1: Line 1:
'''POSITION statement'''  
'''POSITION statement'''  
-
'''Syntax:'''  POSITION (lun) KEY=argument [,EXCP=statement label]   
+
'''Syntax:'''  POSITION (lun) KEY=argument [,EXCP=statement label | NOEXCP]   
'''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.  
'''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.  

Latest revision as of 22:21, 28 May 2009

POSITION statement

Syntax: POSITION (lun) KEY=argument [,EXCP=statement label | NOEXCP]

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

Personal tools