COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-240
START
The value of key is restricted by the presence or absence of position. If
position is present, key must be either:
A prime record key or leftmost subordinate of a prime key for an indexed or
queue file
An alternate key or leftmost subordinate of an alternate key for an indexed,
queue, or relative file
If position is absent, key can be one of:
The relative key for a relative file
The prime record key or leftmost subordinate of the prime key for an
indexed or queue file
An alternate key or leftmost subordinate of an alternate key for a file of any
organization
A reference modifier can be applied to key, but leftmost-character-
position must be the constant 1. For reference modifier syntax, see
Reference Modifier Syntax.
position
specifies that a combination of alternate key or prime key (specified by key in
the KEY phrase) and position-key (specified either by the file prime key or
by a unique alternate key) is to be used to position the file. This phrase is not
permitted for files having sequential organization, or files having the
INSERTIONORDER attribute.
BEFORE
specifies that the file position indicator is set to the record before the
position defined by the values of key and position-key.
AFTER
specifies that the file-position indicator is set to the record after the position
defined by the values of key and position-key.
Note. BEFORE is available only for the NMCOBOL compiler.
Note. Only use BEFORE when the file will subsequently be read in reverse. If the
file is not read in reverse, reading is slightly less efficient.
POSITION position-key
VST222.vsd
AFTER
BEFORE