COBOL Manual for TNS/E Programs (H06.03+)

Libraries and Utility Routines
HP COBOL Manual for TNS/E Programs520347-003
13-31
COBOL_REWIND_SEQUENTIAL_
return-code
is an identifier of a numeric data item in which an error value will be returned. The
expected values and their respective meanings are:
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.
Value Meaning
0 Successful execution
1 file-name is missing or is invalid.
5 An operation error occurred (for example, the file could not be rewound).