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

Program Execution
HP COBOL Manual for TNS/E Programs520347-003
12-13
PARAM Command
If the access mode is write, the run-time routines use a WRITE request for all
messages. Those requiring a response are assumed to have a response of end of
file.
If the device is a process, the process is responsible for analyzing the messages to
determine if an operator response is needed. If the process is also a COBOL run
unit, it can do this by using the MESSAGE-SOURCE option in its (the process’s)
RECEIVE-CONTROL paragraph to get the appropriate information to use in an
ENTER RECEIVEINFO call. If RECEIVEINFO returns a nonzero value for the
read-count, a reply is expected. In this case, the process can return an appropriate
string value (such as would be supplied by an operator) indicating what action to
take.
If a reply is null or the access mode of the execution log is write, the run-time
routines assume that no action is desired and, if the operation is a file processing
statement, return I-O Status 30 to the program (GUARDIAN-ERR contains the
code indicating what action is expected). If the operation is an ACCEPT statement,
the default values are returned to the receiving item. In the case of tape mount
messages, the run unit terminates abnormally.
PRINTER-CONTROL Parameter
When an application program is writing to a printer, and the printer leaves the
ready state (perhaps it is out of paper or it is off line), the program does not
automatically regain control. The HP COBOL run-time library issues a message to
the home terminal to report the printer fault, and waits for the printer to be restored
to the ready state.
In certain circumstances, the application program needs to regain control and take
some action when an active printer leaves the ready state. For example, the
program might be printing checks and keeping record of the preprinted check
numbers issued to each payee. The program asks the operator for the first check
number in the sequence, then processes checks depending on the number to
increase by 1 each time. When the printer comes to the end of a box of check
forms (or suffers a paper jam and destroys some checks), the program needs to be
informed that a particular write operation was not completed routinely so that it can
ask the operator for the number of the next check it will be printing on.
The PRINTER-CONTROL parameter provides a way for the program to respond to
printer faults. Suppose a PRINTER-CONTROL parameter specifies the file name
CHEX. This causes the run-time library to keep track of each elementary control
function or write request that it sends to the operating environment for the file
CHEX. If one of those operations fails because the printer to which CHEX is
assigned is not ready, the WRITE statement completes with I-O status code “30”
(permanent error condition) and a GUARDIAN-ERR value of 100 (not ready) or
102 (out of paper).