Z-PRI11

This document covers the following topics:


Description

Print a document.

The document must be in a printable format (i.e. document format Txt or Cnf).

When you print a Cnf document, the printed version shows all Con-form instructions. A Cnf document is not formatted (see Z-PRI11F, Z-PRI11G or Z-PRI11I for this function).

When you access Con-nect from a PC, you can also print the document on the printer with is connected to your PC.

The calling routine should contain a printer definition of the following form:

IF PRINTER-TID EQ 'PC'
   DEFINE PRINTER(#OUT=5)
ELSE
   DEFINE PRINTER(#OUT=5) OUTPUT PRINTER-TID
END-IF

The following rules apply:

  • If Printer-TID equals binary zero (format B8), DEFINE PRINTER is not executed.

  • If Printer-TID equals blank or PC, DEFINE PRINTER (5) is executed regardless of the current device. There is one exception: if Printer-TID equals PC and *DEVICE does not equal PC, return code 5 is issued and the routine ends.

  • Any other value of Printer-TID issues the following, regardless of the current device:

    DEFINE PRINTER (5) OUTPUT PRINTER-TID

When you print a document which is currently stored in the Inbasket file New, the corresponding address list is updated so that the reception status of the document indicates that it has been read. Additionally, the document is moved from the file New to the file Opened.

Successful termination of Z-PRI11 always results in an END TRANSACTION. You are not able to control transaction handling.

Parameters

Parameter Format In Out Remarks
Return-code N2   X  
Cabinet A8 R   The cabinet in which the document is to be printed.
Password A8 R   The password of the above cabinet.
Document-name A32 R*   The name of the document to be printed. Either Document-name or ISN, not both.
ISN P8 R*   The ISN of the document to be printed. Either ISN or Document-name, not both. You can invoke Z-DIS11 prior to this subprogram to obtain the ISN for the desired document.
Printer-TID A8 R   The terminal ID number, LU number or comparable terminal destination for the printer which is to be used.
Page-length N3 O   The number of lines per printed page. Values 1 to 250. Default: 60.

Return Codes

00 Success
02 Invalid cabinet name or - in batch mode only - locked cabinet
03 Password incorrect
04 ISN was not found
05 TID/LU device is not a personal computer
08 Supply either ISN or name, not both
09 ISN does not point to correct object
51 Invalid name
53 Requested object does not exist
57 Document contains no text
80 Document is not correctly structured
88 Document is not in correct format for printing
90 Incorrect page width - must be 1 through 250

Subprograms

Z-0711A
Z-120
Z-122
Z-123
Z-165
Z-175
Z-177
Z-194
Z-197
Z-222
Z-223
Z-400
Z-401
Z-1200&0

Example

0010 DEFINE DATA LOCAL   
0020 01 RETURN-CODE   (N2)
0030 01 CABINET       (A8)
0040 01 PASSWORD      (A8)
0050 01 DOCUMENT-NAME (A32)
0060 01 ISN           (P8)
0070 01 PRINTER-TID   (A8)
0080 01 PAGE-LENGTH   (N3)
0090 END-DEFINE
0100 *
0110 MOVE 'TID     ' TO PRINTER-TID
0120 *
0130 IF PRINTER-TID EQ 'PC'
0140    DEFINE PRINTER(#OUT=5)
0150 ELSE
0160    DEFINE PRINTER(#OUT=5) OUTPUT PRINTER-TID
0170 END-IF
0180 *
0190 FORMAT(#OUT) PS=250 LS=219
0200 *
0210 MOVE 'USER-ID ' TO CABINET
0220 MOVE 'PASSWORD' TO PASSWORD
0230 MOVE 'REPORT-1' TO DOCUMENT-NAME
0240 *
0250 CALLNAT 'Z-PRI11' RETURN-CODE CABINET PASSWORD DOCUMENT-NAME ISN
0260                   PRINTER-TID PAGE-LENGTH
0270 *
0280 IF RETURN-CODE EQ 0
0290   WRITE 'Document was printed' RETURN-CODE
0300 ELSE
0310   WRITE 'Return code' RETURN-CODE
0320 END-IF
0330 *
0340 END