COBOL Manual for TNS and TNS/R Programs

Libraries and Utility Routines
HP COBOL Manual for TNS and TNS/R Programs522555-006
13-93
COBOL_FILE_INFO_
In the CRE, 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.
COBOL_FILE_INFO_
The COBOL_FILE_INFO_ routine is for both the OSS and Guardian environments. In
the Guardian environment, it works only in the CRE (in the non-CRE environment, use
the routine COBOLFILEINFO).
The COBOL_FILE_INFO_ routine is for these situations:
An application needs to perform some operation not defined in HP COBOL on a
file normally managed by the HP COBOL run-time routines. This application must
obtain the file system file number assigned when the file was opened.
An application can put the file-system file name of a file into an application-
generated error message.