COBOL Manual for TNS and TNS/R Programs

Libraries and Utility Routines
HP COBOL Manual for TNS and TNS/R Programs522555-006
13-50
COBOL85^REWIND^SEQUENTIAL and
COBOL_REWIND_SEQUENTIAL_
Usage Considerations:
File Criteria
file-name must be a valid COBOL file name, the file associated with file-
name must be open at the time of the call and the file-control entry for file-name
must specify ORGANIZATION SEQUENTIAL.
If these criteria are not met, return-code (if specified) is set to 1, I-O Status for
file-name is set to “30” (if file-name is a COBOL file name), GUARDIAN-
ERR is set to 0, and no action is taken on the file (the rewind operation is
considered to be unsuccessful, but execution of the run unit continues).
Successful Rewind Operation
If the rewind operation is successful, the run-time routine rewinds the file if
rewinding or the concept of rewinding applies to the file, I-O Status is set to “00,”
and GUARDIAN-ERR is set to 0.
If Rewind Does Not Apply to the File
If rewinding does not apply to the file (a printer for example), I-O Status is set to
“07,” GUARDIAN-ERR is set to 0, and the operation is a “no-op.”
File Position Indicator
For all files, the file position indicator is set as if the file were newly opened. If
alternate keys are specified for the file, the key of reference is set to the prime key.
Calling COBOL85^REWIND^SEQUENTIAL or COBOL_REWIND_SEQUENTIAL_
From the CRE
A CRE HP COBOL program can call either COBOL85^REWIND^SEQUENTIAL
(the COBOL-environment routine) or COBOL_REWIND_SEQUENTIAL_ (the
equivalent CRE routine). If it calls COBOL85^REWIND^SEQUENTIAL, it actually
calls COBOL_REWIND_SEQUENTIAL_ indirectly.