COBOL Manual for TNS/E Programs (H06.03+)
Libraries and Utility Routines
HP COBOL Manual for TNS/E Programs—520347-003
13-70
COBOLFILEINFO
error-code
is a numeric data item described as USAGE COMPUTATIONAL PICTURE 9999
(or S9999)or USAGE NATIVE-2. The COBOLFILEINFO routine returns the last file
system file-system error code to this data item. The value returned is always
positive.
The access mode (see Linkage Section) of error-code must be STANDARD.
file-name
is a DISPLAY data item of at least 24 characters where the actual 24-byte internal
file name is returned. The internal form of the file name is three 8-character fields
containing the three portions of the file name, with trailing spaces inserted and with
no period (.) separators.
If file-name is composed entirely of spaces or has an 8-character volume
name, it cannot be converted to internal form. To convert it to internal form, use the
COBOL_FILE_INFO_ routine.
The access mode (see Linkage Section) of file-name must be STANDARD.
file-number
is a numeric data item described as USAGE COMPUTATIONAL PICTURE S99.
The COBOLFILEINFO routine returns the file’s open number to this data item.
file-number has the value -1 in each of these cases:
•
The file is not open.
•
The file is OPTIONAL and not present (even if it is open).
•
After the file was opened, the I-O status code was “05,” rather than “00” (see
Nonexistent Files).
The access mode (see Linkage Section) of file-number must be STANDARD.
Usage Consideration: Do not use COBOLFILEINFO to obtain the operating
environment error number associated with the failure of any input-output operation that
is performed simply with COBOL input-output verbs (such as READ). The HP COBOL
special register GUARDIAN-ERR was created for that purpose. Certain operations,
such as a READ statement operating on the $RECEIVE file, deliver meaningful values
to GUARDIAN-ERR, but a call to COBOLFILEINFO would return an inappropriate
value of zero or an arbitrary, undefined value.










