Printer file overview
Printer files describe how the system operates on the data as it passes between your application program and a printer.
A printer file handles every request for printing with one exception. It applies only to the Print key when the display station has an attached remote workstation controller. In this situation, the printer that is named in the device description for that display station receives the printed version of the display screen. The remote workstation controller, not the system, handles this.
Printer files contain many parameters that tell the system how the output should be formatted, what font to use for the printed output, whether to print on both sides of the page, and more. For example, the parameters that control how your output is handled and where it goes are:
- Spool the data (SPOOL). *YES is the default value for the SPOOL
parameter.
When the SPOOL parameter is set to *YES, the output from an application program (a spooled file) is sent to an output queue (OUTQ). When SPOOL = *YES, the system looks at the OUTQ parameter in the printer file to find out which output queue (OUTQ) to send the spooled file to. For example, the OUTQ value in your printer file can be OUTQ1. However, in the default printer file, QSYSPRT, the value specified is *JOB. This means that the QSYSPRT printer file tells the system to look at your job's OUTQ attribute to determine the name of the output queue (OUTQ).
When the SPOOL parameter is set to *NO, the output from an application program is sent directly to a printer. When SPOOL = *NO, the system looks at the DEV parameter in the printer file to find out which printer to send the output to. For example, the DEV value in your printer file can be PRT01. However, in the default printer file, QSYSPRT, the value specified is *JOB. This means that the QSYSPRT printer file tells the system to look at your PRTDEV job's attribute to determine the name of the printer device (DEV).
- Device (DEV). The device parameter indicates the name of a printer device description. If SPOOL = *NO is specified, the device parameter identifies the printer device used to produce the printed output. If SPOOL = *YES is specified, the device (DEV) parameter is ignored unless *DEV is specified for the output queue parameter. In that case, the default output queue for the specified printer is used for the spooled files.
- Spooled output queue (OUTQ). The output queue parameter indicates which output queue your spooled files are sent to. If you have a program that creates large print jobs you might consider sending them to an output queue that will hold those spooled files until most of your printer work for the day is done. Doing this can help users who have lots of small jobs get their jobs printed in a reasonable amount of time.
- Spooled file owner (SPLFOWN). The SPLFOWN parameter specifies which user profile owns a file. The spooled file can be owned by the current job, a QPRTJOB for the current user, a group profile for the current user, or the group profile of the current job's user. For example, for system job debugging purposes, you might want the current job to own all service dumps, instead of the current user. To accomplish this, you can set the parameter to the special value of *JOB for the QPSRVDMP printer file.
There are two different types of printer files:
- Program-described printer files rely on the high-level language program to define records and fields to be printed.
- Externally described printer files use data description specifications (DDS) rather than the high-level language to define records and fields to be printed. DDS gives the application programmer much more format and print control over the printed output.
You can create your own printer files by using the Create Printer File (CRTPRTF) CL command, or you can use system-provided printer files. See Printer file parameter considerations for more detailed information about certain printer file parameters.
The following list contains the IBM-supplied printer files:
- QSYSPRT: A program-described printer file in library QSYS.
- QPRINT: Default spooled output printer file for normal print.
- QPRINTS: Default spooled output printer file for special forms.
- QPRINT2: Default spooled output printer file for two copies of output.
- QPSPLPRT: Default spooled output printer file for the spooling subsystem.
If another printer file is not specified, the printer uses the default printer file. The default printer file for the system is QSYSPRT.