COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-238
START
HP COBOL includes two extensions that are of particular interest if you are writing a
server program:
file-name
is the file description name of the file to position. It must have an access mode of
sequential or dynamic and be opened for INPUT or I-O but not for HP COBOL Fast
I-O.
Phrase Description
GENERIC Lets you position a file at the first record in a subset of a file that consists of all
records that satisfy a certain (EQUALS) key relation. After such a START, you
can execute sequential READ statements (READ NEXT, for dynamic-access
mode) to read all records of the subset. When, eventually, a record does not
satisfy the key relation, the run-time routine simulates an at-end condition.
POSITION Lets you position a file at a specific point in a set of duplicate values of an
alternate key (as specified in the KEY phrase). The position-key must be
a unique value: a prime or relative key or a unique alternate key. By using this
feature, a context-free server can return a series of groups of records to its
requester. With each group, it returns the value of the unique key last used.
The requester can then send both the alternate key value for the KEY phrase
and the unique value for the POSITION phrase to the server, to specify where
to begin the next group.
START file-name
KEY phrase
APPROXIMATE
GENERIC
TIME LIMIT wait-time
INVALID
KEY
imperative-stmt-1
END-START
NOT INVALID
KEY
imperative-stmt-2
VST219.vsd