COBOL Manual for TNS and TNS/R Programs

Libraries and Utility Routines
HP COBOL Manual for TNS and TNS/R Programs522555-006
13-95
COBOLSPOOLOPEN
file-number
is the Guardian or OSS file number. If the file is not open, file-number is 0.
If, after the file was opened, the I-O status code was “05,” rather than “00” (see
Nonexistent Files), file-number is -1.
error
is the last Guardian error number. If the file is an OSS file, error is 0.
Usage Consideration: Do not use COBOL_FILE_INFO_ 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 COBOL_FILE_INFO_ would return an inappropriate
value of zero or an arbitrary, undefined value.
COBOLSPOOLOPEN
COBOLSPOOLOPEN is available to COBOL-environment HP COBOL programs, but it
is recommended that they use COBOL_SPECIAL_OPEN_ instead. CRE programs
cannot use COBOLSPOOLOPEN and must use COBOL_SPECIAL_OPEN_ instead.
Similar functionality is also available through use of a DEFINE of class SPOOL. This
documentation is included for historical reasons.
COBOLSPOOLOPEN provides Level 2 access to the HP spooler product from an
HP COBOL program, enabling you to set various job parameters, such as report title
and number of copies, from within the program.
Topics:
Level 2 Spooler Protocol
Establishing a Declarative-File Connection
Error Code
Level 2 Spooler Protocol
Access to the HP spooler for Level 2 operation requires a special protocol that is not
supported directly in HP COBOL.
To open the spooler for Level 2 operation, an HP COBOL program must use an
ENTER statement that calls COBOLSPOOLOPEN in place of the HP COBOL OPEN
statement. This routine’s parameters do not include analogs of the open mode (for
example, OUTPUT) or the REVERSED and NO REWIND phrases of the OPEN
statement. Instead, OUTPUT is always assumed, and other options have no meaning
for the spooler.