Previous Topic: Banner Exit

Next Topic: CA CCI Interface


Printer Exit Interface

A printer exit is an installation-written NCL procedure. The printer exit enables the implementation of output destinations other than JES or VTAM, for example, a mailing system or a file.

When a print request that has a destination of a printer exit is closed or released, the printer exit is executed by the system to perform initialization processing, then once for each line of data and finally to perform termination processing.

The variables passed to the printer exit by the system are as follows:

&$PSACTION

This variable is set to indicate the processing that is to be performed. This variable is set to one of the following values:

INIT

Initialization processing is to be performed

DATA

Data line processing is to be performed

TERM

Termination processing is to be performed

&$PSTERM

This variable is set to indicate the type of termination when the &$PSACTION variable is set to TERM. This variable is set to one of the following values:

NORMAL

Normal termination

EXIT

Terminated by printer exit setting return code 8

CANCEL

Print request canceled by the procedure sending the output

&$PSEXITDATA

This variable is set to the exit data defined in the printer definition. Exit data in the printer definition is overridden on the OPEN call to $PSCALL.

&$PSUSERID

This variable is set to the user ID of the user who generated the print request.

&$PSREQ#

This variable is set to the number of the print request.

&$PSREQDATE

This variable is set to the date the print request was generated in the format DD-MMM-YYYY.

&$PSREQTIME

This variable is set to the time the print request was generated in the format HH.MM.SS.

&$PSDATA

This variable is set to the line of data that is to be processed.

&$PSSKIP

This variable is set to the skip amount specified for the line of data. Valid values are NEWPAGE, 0, 1, 2, and 3.

&$PSUSCORE

This variable is set to the underline setting specified for the line of data. Valid values are 1 and 2.

&$PSBOLD

This variable is set to the bold setting specified for the line of data. Valid values are YES and NO.

The variables that is set by the printer exit are as follows:

&$PSUSRDc

These variables is set to user data, where c is 1 to 5 alphanumeric and/or national characters. These variables are never set or cleared by the system, therefore must be completely managed by your installation.

The system variable &RETCODE is set by the printer exit as follows:

0

Continue processing.

8

An error occurred. Terminate processing and set the status of the print request on the spool to HELD-ERROR or DIRECT-ERR. &SYSMSG is set to an error message that is to be written to the activity log and stored in the error message field in the printer request.