Use this file- or record-level keyword to specify that the workstation user can press the Print key to print the current display.
See the System/36 environment considerations for display files topic for special considerations when specifying the PRINT keyword in files that are used in the System/36™ environment.
PRINT[(response-indicator ['text']) ∨ (*PGM) ∨ ([library-name/]printer-file-name)]
The following four examples illustrate the four ways you can specify the PRINT keyword:
The i5/OS™ operating system spools the output to printer file QSYSPRT unless you specify another printer file for the workstation on the PRTFILE parameter on the CRTDEVDSP or CHGDEVDSP commands. See the PRINT keyword without parameter values section in this topic. | |
PRINT(01 'User presses Print key') | Your program is given control and decides what to do (for example, produce formatted printer output). The response indicator is set on. No data is sent from the device. |
PRINT(*PGM) | Control returns to your program when the Print key is pressed. |
PRINT(LIB1/PRINTFILE1) | The i5/OS operating system spools the output to the specified printer file (which can be defined through DDS or on the PRTFILE parameter on the CRTDEVDSP or CHGDEVDSP commands). An Override with Printer File (OVRPRTF) command, if in effect before the printer file is opened (when the Print key is pressed), can change the printer device name. |
Further considerations of the ways to specify the PRINT keyword are discussed in the following sections.
If you specify the PRINT keyword in any form, the workstation user can print a display containing the message help. In this case, the print operation is performed as if the PRINT keyword were specified with no parameters.
The i5/OS operating system spools the output to the specified printer file (which can be defined through DDS or on the PRTFILE parameter on the CRTDEVDSP or CHGDEVDSP commands).
Nondisplay fields appear as blanks. Duplicated characters entered by pressing the Dup key appear as asterisks (*). Display attributes appear as blanks. If the print function cannot be performed successfully, the i5/OS operating system attempts to complete the print function using the printer file specified on the PRTFILE parameter on the CRTDEVDSP or the CHGDEVDSP command that is used to describe the display device to the system.
For workstation printers attached through the workstation controller, a message indicating that there is a problem is sent to the workstation user requesting the print function. The workstation user can make the printer ready or press the Reset key. To cancel a print request before it is complete, the workstation user can press and hold the Shift key, then press the Print key.
The i5/OS program attempts to print the display image on the associated workstation printer without sending the data through the system. The associated workstation printer is the printer device specified on the PRINTER parameter of the CRTDEVDSP or CHGDEVDSP command that is used to describe the local display device to the system.
Option indicators are valid for this keyword.
The following example shows how to specify the PRINT keyword with no parameter values.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A PRINT 00020A R RECORD1 A
If you specify the PRINT keyword with a response indicator, the i5/OS operating system returns control to your program with the specified response indicator set on. No data is received from the device. The keyboard is locked until your program sends another output operation to the display file. There is no difference in the print function between local and remote workstations. If you specify *PGM, the i5/OS operating system returns control to your program. The only difference between these two forms is the response indicator; all other processing is the same.
The optional text for the response indicator form is included on the computer printout created at program compilation time to explain the intended use of the indicator. This text functions only as a comment. The single quotation marks are required. If you specify more than 50 characters between the single quotation marks, the text is truncated to 50 characters on the program computer printout.
The following example shows how to specify the PRINT keyword with a response indicator.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A PRINT(01 'User presses Print key') 00020A R RECORD1 A
The following example shows how to specify the PRINT keyword with the *PGM special value.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A PRINT(*PGM) 00020A R RECORD1 A
The i5/OS program reads the display buffer and prints the display image using the specified printer file. The printer file that you specify as a parameter value for this keyword can be either an externally described or a program-described file. It also can be either spooled or nonspooled. If you specify an externally described printer file, it must contain a record format with the same name as the file.
The printer file must exist and be authorized to the user of the display when the Print key is pressed. This also applies to the library name if it is specified. If the i5/OS operating system is unable to perform the print function on the specified printer file, it attempts to use the printer file specified on the PRTFILE parameter of the CRTDEVDSP or the CHGDEVDSP command. SPOOL(*YES) should be specified on the CRTPRTF or CHGPRTF command to prevent the keyboard from locking.
If you do not specify the library name, the current library list at program run time is used.
The following example shows how to specify that the display is to be directed to printer file, LIB1/PRINTFILE1.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A PRINT(LIB1/PRINTFILE1) 00020A R RECORD1 A