Previous Topic: TRACENext Topic: WRITE TO LOG/OPERATOR


WRITE PRINTER

Purpose

Sends data from a dialog to a printer or to a file.

Syntax

►►─── WRITE PRINTER ────┬─────────────┬───┬──────────┬────────────────────────►
                        └┬─ ERASE ───┬┘   └─ ENDRPT ─┘
                         └─ NEWPAGE ─┘

 ►────┬─ SCREEN CONTENTS ─────────────────────────────────────────────────────►
      └┬──────────┬─ FROM message-location-variable ──────────────────────────
       └─ NATIVE ─┘

 ►─────────────────────────────────────────────┬──────────────────────────────►
  ────┬─ TO end-message-location-variable ──┬──┘
      └─ LENGTH message-length ─────────────┘

 ►────┬──────────────────────┬────────────────────────────────────────────────►
      └─ COPIES copy-count ──┘

 ►────┬────────────────────────┬──────────────────────────────────────────────►
      └─ REPORT ID report-id ──┘

 ►────┬─────────────────────────┬──────────────────────┬──────────────────────►
      ├─ CLASS  printer-class ──┘                      │
      │                                                │
      └─ DESTINATION printer-destination ──┬───────┬───┘
                                           └─ ALL ─┘
 ►────┬────────┬───┬────────┬───┬────────────────────┬─── . ──────────────────►◄
      └─ HOLD ─┘   └─ KEEP ─┘   └─ error-expression ─┘

Parameters

ERASE

Specifies that the data being transmitted is to be printed on a new page.

NEWPAGE may be used in place of ERASE.

ENDRPT

Specifies that the data being transmitted is the last record of the specified report. If ENDRPT is specified, the report is printed before the current task terminates.

SCREEN CONTENTS

Transmits the contents of the currently displayed screen to the print queue. This option is valid only for 3270-type terminals. If SCREEN CONTENTS is specified for another terminal type, an error condition results.

NATIVE

Specifies that the data stream being transmitted contains line and device control characters. If NATIVE is not specified, DC/UCF automatically inserts the necessary characters.

FROM message-location-variable

Specified the location of the data to be transmitted to the print queue.

Message-location-variable is the name of a variable data field in the dialog's record buffers.

TO end-message-location-variable

Specifies the end of the buffer area that contains the data to be transmitted.

End-message-location-variable is the name of a dummy byte field or the name of a variable data field that contains a data item not associated with the data being transmitted.

The field specified by end-message-location-variable must immediately follow the last byte of the buffer area that contains the data to be transmitted.

LENGTH message-length

Specifies the length of the buffer area that contains the data to be transmitted.

Message-length is either the name of a numeric variable data field that contains the length in bytes or the length itself, in bytes, expressed as a numeric constant.

COPIES copy-count

Specifies the number of report copies to print.

Copy-count-number is either the name of a numeric variable data field that contains the copy count or the number of report copies itself, expressed as a numeric constant in the range 1 through 255.

If COPIES is not specified, the number of copies defaults to 1.

REPORT ID report-id

Specifies the report with which the transmitted data is associated. The report id must be an integer in the range 1 through 255.

Report-id is either the name of a numeric variable data field that contains the report id or the report id itself expressed as a numeric constant.

If REPORT ID is not specified, the report id defaults to 1.

CLASS printer-class

Specifies the print class, in the range 1 through 64, to which the report is assigned.

Printer-class is either The name of a numeric variable data field that contains the print class or the print class itself, expressed as a numeric constant.

If no print class is specified, the physical terminal default is used.

DESTINATION printer-destination

Specifies the printer to which the report is routed.

Printer-destination is either the name of a variable data field that contains the 1 to 8-character destination or the destination itself, enclosed in single quotation marks.

If no print destination is specified, the physical terminal default is used.

ALL

Specifies that the report is to be printed on all of the logical terminals at the specified print destination. If ALL is not specified, the report is printed on only one of the logical terminals.

HOLD

Specifies that DC/UCF is not to print the report until a system operator releases it with a DCMT VARY REPORT command.

Note: For more information about DCMT commands, see the CA IDMS System Tasks and Operator Commands Guide.

KEEP

Specifies that each time DC/UCF finishes printing the report, the report is to be kept instead of deleted. The report can be reprinted or deleted with a DCMT VARY REPORT command.

If KEEP is not specified, the report is deleted once it is printed.

error-expression

Specifies the status codes that are returned to the dialog.

Usage

Definition

The WRITE PRINTER command is used to transmit data from the issuing dialog to a DC/UCF printer terminal and to initiate printing of the transmitted data. Data is passed first to a report queue maintained by DC/UCF and then to the printer.

Each line of data transmitted by a WRITE PRINTER request is considered a record. Each record is associated with a particular report in the report queue. A report consists of one or more records. The report queue can contain up to 256 active reports for any one task.

If autostatus is not in use, a dialog's error-status field indicates the outcome of a WRITE PRINTER command:

Status Code

Meaning

0000

The request was executed successfully

4807

An I/O error occurred in placing the record in the print queue

4818

The DC/UCF system has no logical terminals associated with a printer

4821

The specified printer destination is invalid

4838

The variable storage field that contains the record to be printed was not allocated

4845

The output terminal type is not correct for the WRITE PRINTER request

4846

A terminal I/O error occurred while attempting to print the contents of a screen.

Considerations

More information:

CA ADS Application Compiler (ADSA)

System Records

CA ADS Runtime System

Control Commands

Error Handling