![]() |
| Introduction to Printer File in IBM i (AS400) |
What is Printer File (PRTF) in IBM i
The Printer File is used as a medium to transfer the data from the program to the printer. CRTPRTF command can be used to create the printer file object. The attribute for the printer files object would be PRTF.
Work with Objects
Type options, press Enter.
2=Edit authority 3=Copy 4=Delete 5=Display authority 7=Rename
8=Display description 13=Change description
Opt Object Type Library Attribute Text
PRTF3A *FILE EASYCLASS1 PRTF SPACEA keyword in External
Printer File parameters (SPOOL, DEV, OUTQ, SPLFOWN)
There are many parameters in the CRTPTF command but some of them are explained below.
SPOOL
SPOOL parameter is used either to spool the printer file data. If it *YES the data is first spooled to a particular output queue then it gets printed and if *NO the data is directly going to the printer.
S Create Printer File (CRTPRTF)
Type choices, press Enter.
Edge stitch: EDGESTITCH
Reference edge . . . . . . . . *NONE
Reference edge offset . . . .
Number of staples . . . . . .
Staple offsets . . . . . . . .
+ for more values
Saddle stitch: SADLSTITCH
Reference edge . . . . . . . . *NONE
Number of staples . . . . . .
Staple offsets . . . . . . . .
+ for more values
Font resolution for formatting FNTRSL *DEVD
Defer write . . . . . . . . . . DFRWRT *YES
Spool the data . . . . . . . . . SPOOL *YES
Spooled output queue . . . . . . OUTQ *JOB
Library . . . . . . . . . . . +
DEVICE (DEV)
It is used for printing printer files. It specifies the name of a printer device description. For *NO (non-spooled), this identifies the printer device used to produce the printed output.
Create Printer File (CRTPRTF)
Type choices, press Enter.
File . . . . . . . . . . . . . . FILE
Library . . . . . . . . . . . *CURLIB
Source file . . . . . . . . . . SRCFILE *NONE
Library . . . . . . . . . . .
Source member . . . . . . . . . SRCMBR *FILE
Generation severity level . . . GENLVL 20
Flagging severity level . . . . FLAG 0
Device: DEV
Printer . . . . . . . . . . . *JOB
Printer device type . . . . . . DEVTYPE *SCS
Text 'description' . . . . . . . TEXT *SRCMBRTXT
OUTQ
For spooled output, the file is placed on the output queue determined by the OUTQ parameter.
Create Printer File (CRTPRTF)
Type choices, press Enter.
Edge stitch: EDGESTITCH
Reference edge . . . . . . . . *NONE
Reference edge offset . . . .
Number of staples . . . . . .
Staple offsets . . . . . . . .
+ for more values
Saddle stitch: SADLSTITCH
Reference edge . . . . . . . . *NONE
Number of staples . . . . . .
Staple offsets . . . . . . . .
+ for more values
Font resolution for formatting FNTRSL *DEVD
Defer write . . . . . . . . . . DFRWRT *YES
Spool the data . . . . . . . . . SPOOL *YES
Spooled output queue . . . . . . OUTQ *JOB
Library . . . . . . . . . . .
Spool File Owner (SPLFOWN)
The spooled file is owned by the current effective user profile of the job.
Create Printer File (CRTPRTF)
Type choices, press Enter.
Form type . . . . . . . . . . . FORMTYPE *STD
Copies . . . . . . . . . . . . . COPIES 1
Expiration date for file . . . . EXPDATE *NONE
Days until file expires . . . . DAYS
Page range to print: PAGERANGE
Starting page . . . . . . . . 1
Ending page . . . . . . . . . *END
Max spooled output records . . . MAXRCDS 100000
File separators . . . . . . . . FILESEP 0
Spooled output schedule . . . . SCHEDULE *FILEEND
Hold spooled file . . . . . . . HOLD *NO
Save spooled file . . . . . . . SAVE *NO
Output priority (on OUTQ) . . . OUTPTY *JOB
User data . . . . . . . . . . . USRDTA *SOURCE
Spool file owner . . . . . . . . SPLFOWN *CURUSRPRF
Types of Printer Files
There are two types of Printer Files available in IBM i:
Program described printer file
A printer file (records and fields) defined within an HLL application program is called a program described printer file. This can be used only within the program and the source would be written in O-SPECS of the RPG program.
Externally described printer file
Externally described printer file (records and fields) defined in external DDS. It can be used within a different RPG program.
IBM Supplied printer files in IBM i
The default printer file for the system is QSYSPRT.
Advantage of Externally described printer file over program described printer file
Externally described printer file (records and fields) defined in external DDS. It can be used multiple RPG programs whereas Program described printer file can be used only within the program and the source would be written in O-SPECS of the RPG program.
Important points related to the Printer file
The maximum number of record formats and fields is 1024.
The maximum number of fields in any one record format is 32767.
The maximum combined length of all named fields and indicators in a record format is 32767 bytes
.png)