COBOL Manual for TNS and TNS/R Programs

Program Execution
HP COBOL Manual for TNS and TNS/R Programs522555-006
12-14
PARAM Command
The file is opened the first time the run unit attempts to write a message. This
means that it will not be opened at all for most jobs. If the open operation fails, no
messages can be written anywhere and run unit execution terminates abnormally.
Once opened, the file remains open for the duration of the run unit.
If any error occurs during a write or read operation on the execution log file, no
messages can report this problem and the run unit terminates abnormally.
If the access mode is read/write, the run-time routines use the WRITEREAD
system routine to send messages requiring a response and WRITE for messages
not requiring a response.
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.