This document covers the following topics:
Display a list of logical printers.
This subprogram should be invoked iteratively until the return code 77 indicates the end of the list.
Note:
When you operate under Natural Advanced Facilities, the name of the
logical printer profile is returned in the parameter Printer-TID.
Parameter | Format | In | Out | Remarks |
---|---|---|---|---|
Return-code | N2 | X | ||
Start-value | A32 | O | The name of a logical printer. If Start-value is not specified, a list of all logical printers is returned. When you specify a name (e.g. "sag"), the list starts with the specified name and continues until the end of the list is reached. When you specify a name with an asterisk (e.g. "sag*"), only the names that start with the specified characters are returned. | |
Number | N2 | O | The maximum number of logical printers that are returned with each call. When you do not specify a value, or when you specify a value greater than 20, the default value 20 is used. | |
Printer-table (20) | ||||
Printer-name | A32 | X | The name of the logical printer. | |
Printer-TID | A8 | X | The terminal ID number, LU number or comparable terminal destination for the printer which is used when the user enters the name of the logical printer. | |
Printer-profile | A32 | X | The printer profile which is assigned to the logical printer. | |
Work-parameter | A64 | For internal use. See The Work Parameter. |
00 | Success |
77 | End of list |
90 | No logical printer(s) found |
None
0010 * 0020 * Return all logical printer names beginning with 'Z' 0030 * 0040 DEFINE DATA LOCAL 0050 1 RETURN-CODE (N2) 0060 1 START-VALUE (A32) 0070 1 NUMBER (N2) 0080 1 PRINTER-TABLE (20) 0090 2 PRINTER-NAME (A32) 0100 2 PRINTER-TID (A8) 0110 2 PRINTER-PROFILE (A32) 0120 1 WORK-PARAMETER (A64) 0130 * 0140 END-DEFINE 0150 * 0160 MOVE 'Z*' TO START-VALUE 0170 * 0180 REPEAT UNTIL RETURN-CODE EQ 77 0190 CALLNAT 'Z-DIS79' RETURN-CODE START-VALUE NUMBER 0200 PRINTER-TABLE(*) WORK-PARAMETER 0210 * 0220 IF NOT RETURN-CODE = 0 OR = 77 0230 WRITE 'RETURN CODE' RETURN-CODE 0240 STOP 0250 END-IF 0260 * 0270 PRINT PRINTER-TABLE(*) 0280 * 0290 END-REPEAT 0300 END