Printer Device Programming
Printer Device Programming
iSeries
Printer Device Programming
Version 5
SC41-5713-04
iSeries
Printer Device Programming
Version 5
SC41-5713-04
Note
Before using this information and the product it supports, be sure to read the information in
“Notices” on page 551.
Contents v
HP printer job language (PJL) . . . . . . . . 273 Chapter 14. Working with the image
| Simple network management protocol (SNMP) . . 273 print transform function . . . . . . . 303
Benefits of using ASCII TCP/IP network-attached What is the image print transform function? . . . 303
printers . . . . . . . . . . . . . . . 273 Why use the image print transform function? . . 303
How ASCII TCP/IP network-attached printing Printing with image print transform function . . . 304
works . . . . . . . . . . . . . . . . 274 Printing to an ASCII printer . . . . . . . 304
Restrictions when using ASCII TCP/IP Printing to an IPDS printer . . . . . . . . 304
network-attached printers . . . . . . . . 276 Printing with remote output queues . . . . . 305
Printer device description parameters that support How output attributes are derived . . . . . 305
ASCII TCP/IP network-attached printers . . . . 277 Determining if input data stream is in final form 305
Configuring and starting ASCII TCP/IP Printing with convert image API . . . . . . . 306
network-attached printers . . . . . . . . . 280 Image configuration objects. . . . . . . . . 306
Special values of image configurations . . . . 306
Chapter 13. Working with the host Converting postscript data streams . . . . . . 312
print transform function . . . . . . . 283 Fonts . . . . . . . . . . . . . . . 312
Why use the host print transform function? . . . 283 User supplied fonts . . . . . . . . . . 313
How the host print transform function works . . 284 Font substitutions . . . . . . . . . . . 314
Using AFP-to-ASCII transform function . . . . 285 PostScript data streams . . . . . . . . . 315
Using bar codes . . . . . . . . . . . 286 How page size is determined . . . . . . . . 315
Limitations of AFP-to-ASCII transform function 286 Troubleshooting . . . . . . . . . . . . 315
Using the host print transform in raster mode . . 287 Additional documentation . . . . . . . . . 316
Why use raster mode? . . . . . . . . . 287
Enabling raster mode. . . . . . . . . . 287 Chapter 15. Other printing functions
Limitations of raster mode . . . . . . . . 287 provided by the OS/400 program . . . 317
Enabling the host print transform function using PrintManager/400 . . . . . . . . . . . . 317
printer device description parameters . . . . . 288 Data Description Specifications (DDS) . . . . . 318
Parameters supporting the host print transform Advanced Printer Function . . . . . . . . . 318
function . . . . . . . . . . . . . . 288 Functions of APF . . . . . . . . . . . 318
Working with printer device descriptions . . . . 289 Graphical Data Display Manager (GDDM) . . . 319
Creating printer device descriptions using a Required AS/400 System Hardware . . . . . 319
command . . . . . . . . . . . . . 290 Required AS/400 System Software . . . . . 320
Automatically creating printer device Required Knowledge . . . . . . . . . . 320
descriptions . . . . . . . . . . . . . 290 QWP4019 Program . . . . . . . . . . . 321
Changing an existing printer device description 290 QWP4019 Parameter Names and Functions . . 321
Displaying the printer device description . . . 291 How Does the QWP4019 Program Work? . . . 323
Using the host print transform function with an QWP4019 Program Examples . . . . . . . 323
emulator . . . . . . . . . . . . . . . 291
Using the host print transform function with the
IBM Client Access Express work station function 291
Chapter 16. Other printing functions
Using the host print transform function with the provided by licensed programs and
3486/3487/3488 InfoWindow display . . . . 293 AS/400 system hardware . . . . . . 325
Using the host print transform function with the Advanced function printing utilities/400 . . . . 325
3477 InfoWindow display . . . . . . . . 294 What is AFP utilities/400? . . . . . . . . 325
Using the host print transform function with the Overlay utility . . . . . . . . . . . . 325
3197 display station . . . . . . . . . . 295 Print format utility . . . . . . . . . . 327
Using the host print transform function with the Resource management utility . . . . . . . 328
ASCII work station controller . . . . . . . 296 Advanced DBCS printer support/400 . . . . . 329
Using the host print transform function with Business graphics utility (BGU) . . . . . . . 330
OS/2 5250 work station feature . . . . . . 297 What is BGU? . . . . . . . . . . . . 330
Using the host print transform function with Data access capability . . . . . . . . . 331
OS/2 5250 emulation . . . . . . . . . . 299 Client Access Express. . . . . . . . . . . 332
Using the host print transform function with the Network printer function . . . . . . . . 332
RUMBA/400 program . . . . . . . . . 299 Printer emulation . . . . . . . . . . . 333
Using the host print transform function with the Introducing sharing personal printers . . . . 334
IBM enhanced 5250 or the IBM S36/38 work IBM InfoWindow 3477, 3486, 3487, and 3488
station emulation program . . . . . . . . 300 printer support . . . . . . . . . . . . . 335
Using the host print transform function with the ASCII work station controller . . . . . . . . 335
IBM remote 5250 emulation program . . . . 301 Sending and printing files with TCP/IP . . . . 336
| Chapter 18. The IBM Internet Printing Appendix D. Working with Fonts, Font
| Protocol (IPP) server for AS/400 . . . 351 Character Sets, Code Pages, CHRIDs,
| What is the Internet Printing Protocol? . . . . . 351 and Coded Fonts . . . . . . . . . . 387
| Why use the IPP server?. . . . . . . . . . 351 Fonts and the AS/400 System . . . . . . . . 387
| What is supported by the IPP server? . . . . . 351 Downloading . . . . . . . . . . . . 387
| Setting up the IPP server . . . . . . . . . 352 Font Character Sets and Font Global Identifiers
| Setting up your Internet browser . . . . . . 352 (FGID) . . . . . . . . . . . . . . . 388
| Using the Administrator Interface . . . . . 352 Font Character Sets . . . . . . . . . . 388
| Configuring the IPP server . . . . . . . . . 353 Font Global Identifiers (FGIDs) . . . . . . 390
| Creating an IPP Printer Configuration . . . . 354 Code Pages . . . . . . . . . . . . . . 392
| Viewing an IPP printer configuration . . . . 354 Standalone Code Pages . . . . . . . . . 393
| Deleting an IPP printer configuration . . . . 354 Character Set and Code Page Combination
| Managing the IBM IPP server . . . . . . . . 354 (CHRIDs). . . . . . . . . . . . . . 395
| Troubleshooting . . . . . . . . . . . . 355 Coded Fonts. . . . . . . . . . . . . 396
Font Capturing . . . . . . . . . . . . . 397
Activating Font Capturing . . . . . . . . 397
Part 6. Appendixes . . . . . . . . 357 Making Character Sets and Code Pages Eligible
for Capturing . . . . . . . . . . . . 397
Appendix A. Examples of Working Eligibility Rules . . . . . . . . . . . 398
with Printing Elements . . . . . . . 359 Migrating Font Libraries from Other Operating
Structure of Examples in This Appendix . . . . 359 Environments . . . . . . . . . . . . 398
Working with Your User Profile . . . . . . . 359 Considerations . . . . . . . . . . . . 398
Displaying Your User Profile . . . . . . . 359 Font Substitution Tables . . . . . . . . . . 400
Changing Your User Profile . . . . . . . 360 Font Attributes . . . . . . . . . . . . 400
Working with System Values . . . . . . . . 360 Font Substitution . . . . . . . . . . . 400
Displaying the System Value for the System Font Substitution by Font ID Range . . . . . 401
Printer. . . . . . . . . . . . . . . 360 Host Resident to Printer Resident Font
Changing System Values . . . . . . . . 361 Character Set Mapping . . . . . . . . . 401
Working with Output Queues . . . . . . . . 361 Printer Resident to Host Resident Font
Using the Printer File to Select a Different Character Set Mapping . . . . . . . . . 401
Output Queue . . . . . . . . . . . . 362 Printer Resident to Host Resident Code Page
Moving a Spooled File to a Different Output Mapping . . . . . . . . . . . . . . 401
Queue . . . . . . . . . . . . . . . . 363 Character Identifier (CHRID) Values Supported 402
Different Methods to Move Spooled Files . . . 363 Host Resident to Printer Resident Code Page
Working with Printer Writers (WRKWTR) . . . . 365 Mapping . . . . . . . . . . . . . . 402
Assigning a Printer to a Different Output Queue 365 Lines Per Inch (LPI) Values Supported . . . . 402
Locating Spooled Files . . . . . . . . . . 367 Characters Per Inch (CPI) Values Supported . . 402
Using the Work with Spooled Files (WRKSPLF) 4019 Printer Information. . . . . . . . . 402
Command . . . . . . . . . . . . . 367 4234 Compressed Font Substitution . . . . . 402
Using the Work with Job (WRKJOB) Command 367
Options You Can Select Using WRKSPLF or Appendix E. Printer Data Streams . . 493
WRKJOB . . . . . . . . . . . . . . 367 SNA Character String (SCS) . . . . . . . . 493
How Print Attributes Are Implemented by SCS 493
Contents vii
Final-Form Text: Document Content Architecture Examples of using QPQCHGCF . . . . . . 529
(FFT DCA) . . . . . . . . . . . . . . 494 Restrictions on using the QPQCHGCF program 530
Advanced Function Printing Data Stream (AFPDS) 495 Coded fonts whose font character sets are
Source Programs That Generate AFPDS . . . 495 resident in the 3130 . . . . . . . . . . 530
Advanced Function Printing . . . . . . . 496 QPQCHGCF instructions for marking coded
Intelligent Printer Data Stream (IPDS) . . . . . 496 fonts. . . . . . . . . . . . . . . . 531
Introduction to IPDS Architecture . . . . . 496
The IPDS Page Environment . . . . . . . 498 Appendix G. Feedback Area Layouts 533
Processing IPDS Commands . . . . . . . 502 Open Feedback Area for Printer . . . . . . . 533
The IPDS Command Format . . . . . . . 503 Device Definition List . . . . . . . . . 536
IPDS Operating States . . . . . . . . . 503 I/O Feedback Area . . . . . . . . . . . 537
Default Handling . . . . . . . . . . . 505 Common I/O Feedback Area . . . . . . . . 538
Mixed Object: Document Content Architecture I/O Feedback Area for Printer Files . . . . . 540
(MO:DCA) . . . . . . . . . . . . . 505
American National Standard Code for Information
Appendix H. Using DDS with
Interchange (ASCII) . . . . . . . . . . . 508
PostScript . . . . . . . . . . . . . . 508 High-Level Languages (HLL) . . . . . 541
Data Description Specifications (DDS) . . . . . 541
DDS Coding Example Using the Row/column
Appendix F. Double-Byte Character
Method of Positioning . . . . . . . . . 541
Set Support . . . . . . . . . . . . 511 DDS Coding Example Using the Absolute
Double-Byte Character Set Fundamentals . . . . 511 Method of Positioning . . . . . . . . . 541
DBCS Code Scheme . . . . . . . . . . 512 COBOL and RPG Source Code . . . . . . . 542
Shift-Control Characters . . . . . . . . . 514 Example Output from the DDS, COBOL, and RPG
Invalid Double-Byte Code and Undefined Source . . . . . . . . . . . . . . . . 545
Double-Byte Code . . . . . . . . . . . 515 Example 1: DDS and Row/Column Positioning 545
Using Double-Byte Data . . . . . . . . . 515 Example 2: DDS and Absolute Positioning. . . 546
Double-Byte Character Size. . . . . . . . 515
Processing Double-Byte Characters . . . . . . 516
Appendix I. What Does a Font Look
Basic Characters . . . . . . . . . . . 516
Extended Characters . . . . . . . . . . 516 Like? . . . . . . . . . . . . . . . 547
What Happens When Extended Characters Are Getting Started . . . . . . . . . . . . . 547
Not Processed . . . . . . . . . . . . 516 DDS Source Code . . . . . . . . . . . 548
Device File Support . . . . . . . . . . . 517 C Source Code . . . . . . . . . . . . 549
What a DBCS File Is . . . . . . . . . . 517 Pascal Source Code . . . . . . . . . . 549
When to Indicate a DBCS File . . . . . . . 517 RPG Source Code . . . . . . . . . . . 549
How to Indicate a DBCS File . . . . . . . 517 COBOL Source Code . . . . . . . . . . 550
Improperly Indicated DBCS Files . . . . . . 519
Making Printer Files Capable of DBCS . . . . 519 Notices . . . . . . . . . . . . . . 551
Printer Support. . . . . . . . . . . . . 521 Programming Interface Information . . . . . . 552
Special DBCS Printer Functions . . . . . . 521 Trademarks . . . . . . . . . . . . . . 552
Double-Byte Character Printing Considerations 523
Spool Support . . . . . . . . . . . . . 527 Bibliography . . . . . . . . . . . . 555
Applying Overrides in Printing . . . . . . 527
3130 Printer Resident Font Support . . . . . . 528
Index . . . . . . . . . . . . . . . 557
How to use the QPQCHGCF program. . . . . 528
For more information on Operations Navigator, see the iSeries Information Center.
The iSeries Information Center contains advisors and important topics such as CL
commands, system application programming interfaces (APIs), logical partitions,
With every new hardware order, you receive the following CD-ROM information:
v iSeries 400 Installation and Service Library, SK3T-4096-00. This CD-ROM contains
PDF manuals needed for installation and system maintenance of an IBM ~
iSeries 400 server.
v iSeries 400 Setup and Operations CD-ROM, SK3T-4098-00. This CD-ROM contains
IBM iSeries Client Access Express for Windows and the EZ-Setup wizard. Client
Access Express offers a powerful set of client and server capabilities for
connecting PCs to iSeries servers. The EZ-Setup wizard automates many of the
iSeries setup tasks.
The OS/400 printing function continues to support line printers and a subset of
IBM IPDS printers and print functions when PSF/400 is not installed.
Full support for all IPDS printers is provided by the integrated AFP printing
function. The printing function used to process application output is determined
by the device description of the target printer. Only printers defined as
DEVTYPE(*IPDS) and AFP(*YES) (both specified in the printer device description)
are controlled by the AFP printing function.
DDS Keywords
v Box (BOX)
v Coded font (CDEFNT)
v Data Stream Command (DTASTMCMD)
v Document Index Tag (DOCIDXTAG)
v End Page (ENDPAGE)
v End Page Group (ENDPAGGRP)
v Font character set (FNTCHRSET)
v Graphic data file (GDF)
v Invoke medium map (INVMMAP)
v Line (LINE)
v Overlay (OVERLAY)
v Page segment (PAGSEG)
v Position (POSITION)
v Start Page Group (STRPAGGRP)
v Text rotate (TXTRTT)
v Z fold (ZFOLD)
v Force (FORCE)
v Duplex (DUPLEX)
v Outbin (OUTBIN)
PrintManager/400
PrintManager/400 remains part of the OS/400 operating system. Print Services
Facility for OS/400 is required if you use PrintManager/400 to place data on
AS/400 spool or select page and form definition resources (AFP print objects as
used on System/390 and RS/6000).
To know the answer to these and other printing questions you need to:
v Understand the elements that make printing happen.
v Understand which elements have precedence over other elements. For example;
your job description has precedence over your user profile in determining which
printer your output will print on.
After reading through this chapter and the examples in Appendix A. Examples of
Working with Printing Elements, you will be familiar with the elements that make
printing happen and you will be able to:
v Display your user profile.
v Change your user profile.
v Create an output queue.
v Move spooled files from one output queue to a different output queue.
v Start printers printing.
v Stop printers from printing.
v Assign a printer to print spooled files from an output queue that it is currently
not assigned to.
Note to Readers:
Read through the following list to familiarize yourself with the elements, but do
not worry about trying to memorize each definition. A thorough explanation of the
elements and how they interact with each other will follow.
Printing Elements
Element Definition
Spooled File
A file that holds output data waiting to be printed.
Application
An application program is run
Program
or the Print key is pressed.
Runs or a
Print Key
Is Pressed
A system-supplied program
Printer Writer takes spooled files from
Program output queues and sends
them to a printer.
As the diagram illustrates, there are many elements (such as printer files and
output queues) and many actions (creating spooled files, starting printer writer
programs) involved in processing your printing requests.
The remainder of the chapter explains the elements and the processes that combine
to produce printed output.
Generally, when the user initiates a print request or runs a program, a printer file
is accessed, a spooled file is generated, and that spooled file is sent to an output
queue. The next three topics discuss the relationship between printer files, spooled
files, and output queues.
Printers attached to the AS/400 system are supported by the operating system
through printer files. Printer files describe how the system is to operate on the
data as it passes between your application program and a printer.
A printer file handles every request for printing. You can create your own printer
files by using the Create Printer File (CRTPRTF) command, or you can use
system-provided printer files.
Note: There is one exception to this. 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 screen. The remote work station
controller, not the AS/400 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. The parameters that control how your output is
handled and where it goes are:
1 Spool the data (SPOOL)
2 Device (DEV)
3 Spooled output queue (OUTQ)
4 Spooled File Owner(SPLFOWN)
| If another printer file is not specified, the printer uses the default printer file. The
| default printer file for the system is QSYSPRT. The following page identifies the
| SPOOL, DEV, OUTQ, and SPLFOWN parameters on the default printer file,
| QSYSPRT.
Display Spooled File
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 could 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).
For example, for debugging purposes, you might want the current job to spool and
own all service dumps, instead of an individual user. To accomplish this, you
could set the parameter to the special value of *JOB for the QPSRVDMP printer
file.
Spooling is a system function that saves data in a database file for later processing
or printing. This data, which is saved and eventually printed, is called a spooled
file.
When spooling is used, spooled files) are created from the application program, a
system program, or the pressing of the Print key. These files are put on disk in
places called output queues.
The diagram below shows an AS/400 system with three application programs.
When these application programs are run, they take information from a printer
file.
Information in the printer file determines if the output should be spooled, and
which output queue the spooled file is sent to.
A key concept to remember is that you can create and use multiple printer files
and multiple output queues to accomplish your printing needs. Also, two different
AS/400
Output Queue
Application Program Name = OUTQONE
Using a Printer File
Called PRTFONE Spooled File
Printer File Spooled File
Name = PRTFONE Spooled File
OUTQ = OUTQONE
Printer File
Application Program
Using a Printer File Name = PRTFTWO
Called PRTFTWO OUTQ = OUTQTWO
Output Queue
Name = OUTQTWO
Application Program
Using a Printer File Spooled File
Called PRTFTHREE Spooled File
Printer File
Spooled File
Name = PRTFTHREE
OUTQ = OUTQTWO
RV2H326-0
By creating and using your own printer file instead of using a system-supplied
printer file, you can specify the printing control instructions that your application
program receives.
You can use the Create Printer File (CRTPRTF) command to create your own
printer file.
For more detailed information and examples about printer files, see Chapter 2.
Printer file support.
System-created output queues are commonly called device output queues and have
the same name as the printer device.
For example: when you configure a printer using the Create Device Description
(Printer) (CRTDEVPRT) command, if you assign the printer name PRT01 in the
DEVD parameter, the system creates an output queue named PRT01.
For example: let us assume that you have only one printer available. One of your
application programs creates a job that has 600 pages of printed output. Since all
users are using the same printer, you do not want to print the 600-page job until
everyone has finished working for the day.
One solution is to create two separate output queues. One output queue receives
the spooled files from the application program that creates the 600 pages of printed
output. The other output queue receives the spooled files from the jobs run by
other users, as shown in the diagram below.
Output Queue
Application
Program Spooled File
(600-page job) Printer
Output Queue
Other Users’
Jobs Spooled Files
(all other jobs)
RV2H325-0
The program that creates the 600-page job sends the spooled file to a specific
output queue. That output queue does not have a printer assigned to it. Therefore,
the 600-page spooled file has to wait until a printer is assigned; meanwhile, the
spooled files that are in the other output queue can be printed.
Multiple output queues can also be used with deferred printing. To print a large
spooled file which exceeds the current limit for the printer’s output queue, the
printer can be assigned to an output queue without any limit. Another solution is
to set the maximum spooled file size to print during a specified time. For example,
a maximum spooled file size of 100 pages could be set from 08:00:00 to 17:30:00
hours. During this time, only spooled files of 100 or less pages would print. After
5:30 PM, any spooled file prints. Spooled files which are too large are placed in
deferred status (*DFR) until they can be printed. See “Controlling printing from an
output queue by spooled file size” on page 131 and “Controlling multiple output
queues” on page 136 for more information on using multiple output queues with
deferred printing.
The remainder of this chapter discusses the elements that control or direct the
printing activity.
v The printer writer program.
This element is identified by 2 in the diagram below.
Note: The Start Remote Writer (STRRMTWTR) command is similar to the Start
Printer Writer (STRPRTWTR) command. The STRRMTWTR command
provides function that allows spooled files to be sent to a remote system
for printing. For more information, see “Chapter 4. Remote System
Printing” on page 159.
+ v Printer files, job attributes, user profiles, workstation descriptions, job
+ descriptions, and system values.
+ These elements are identified by 3 in the diagram below.
These important attributes, common to the elements that control printing, are:
v Output queues
v Printer devices
Note: Do not confuse the printer writer program with an actual printer device or a
printer file. The printer device is a physical printer and the printer writer is
the program that allows you to assign an actual printer device to an output
queue and select spooled files from the output queue to be printed.
The diagram below illustrates how the printer writer program interacts with the
output queue and the physical printer to take spooled files from an output queue
and send them to a printer.
Application
Program
Runs or a
Print Key
Is Pressed
Printer Writer
Printer File
Program
System-Supplied (system-
or User-Created supplied)
Output Queue
Spooled File
Spooled File Printed
Spooled File Output
RV2H324-0
|
Printer device descriptions have to be created for each printer attached to the
system. If you use automatic configuration, this is done for you by the system,
with the exception of printers attached to an ASCII work station controller. Or you
can use the Create Device Description (Printer) (CRTDEVPRT) command to assign
a name to each printer.
The Start Printer Writer (STRPRTWTR) command and the Work with Writers
(WRKWTR) command provide you with the ability to assign any configured
printer to any output queue.
Notes:
1. Even though the name of the command (Work with Writers) indicates you are
working with printer writers, you are actually using the printer writer program
to make a match between an output queue and a physical printer.
2. If your printer stops for any reason (out of paper, for example), the AS/400
system does not automatically assign a different printer to continue printing the
jobs in the output queue that your printer was assigned to. You have to
manually assign another printer to that output queue.
| Assuming that the method used to start the job does not override the output
| queue or printer device values specified in the device description, the order
| followed for job initiation is: job description, user profile, workstation description,
| For job run time, the order followed is printer file and job attributes. In the
| following diagram you can see how these stages work. For additional information
| about job attributes and manipulating job attributes, see the Work Management
| topic in the online Information Center.
|
Note: If the printer identified in the system value does not exist on your AS/400
system, the output goes to output queue QPRINT.
| For more detailed information about job attributes, see the Work Management
| topic in the AS/400 Information Center.
To become a user of the system you must have a user profile. In most cases,
someone having security officer authority adds new users to the system. A user
profile is created for each new user added to the system. The user profile has three
parameters (highlighted on the following page) that provide information to
determine where the user’s printed output will go.
1 Job Description
2 Output Queue
3 Printer Device
Job description: In the example user profile, this parameter and its value of
QDFTJOBD (item 1 in the following example) mean that when the user requests
a printing job, the system scans the QDFTJOBD job description to determine which
output queue (OUTQ) and printer device (PRTDEV or DEV) it should use. If the
job description has the value of *USRPRF specified for these parameters, the
system comes back to the user profile and continues to look for the printer and the
output queue to use.
The system looks, in the user profile, at the parameters of output queue and
printer device.
Output queue: In the example user profile, you can see the output queue value
(item 2) specified is *WRKSTN. This tells the system to use the value specified in
the output queue (OUTQ) parameter of the workstation description as the output
queue name.
Each user signs on to the system at a display station. Many display stations can be
attached to an AS/400 system. Each display station that is attached to the system
has a workstation description.
From a printing standpoint, the parameters labeled 1 Printer device and 2
Output queue are very important.
When you sign on to the system, if no defaults or system values have been
changed, your output will be sent to the output queue and the printer device
specified in the workstation description of the display station where you are
signed on.
Note: Any batch job submitted from the interactive job would use the same printer
device or output queue that is currently specified in the workstation
description.
Output queue: In the example workstation description, you can see the output
queue value (item 2) specified is *DEV. This tells the system to use the value
specified in the printer device parameter of the printer file as the output queue
name.
| In our example, the value in the PRTDEV parameter of the job description is
| *USRPRF, which tells the system to look at the PRTDEV parameter in the user
Printer device: In the example workstation description, you can see the printer
device value (item 1) specified is *SYSVAL. This tells the system to look at the
system value QPRTDEV. This IBM-supplied system value has a printer assigned to
it. For example: PRT01 could be the value assigned to the system value QPRTDEV.
| As you learned earlier in this chapter, printer files contain many parameters that
| describe how the system is to operate on the data as it passes between your
| application program and the printer. One of these parameters, the output queue
| (OUTQ) parameter, tells the system which output queue receives your spooled
| files.
| This means that the QSYSPRT printer file tells the system to look at your job
| attributes to determine the name of the output queue (OUTQ).
| For more detailed information about job attributes, see the Work Management
| topic in the AS/400 Information Center.
| Display Spooled File File . . . . . : QPDSPFD
| Control . . . . . Columns 1 - 78
| Find . . . . . .
| 2/09/98 Display File Description
|
| DSPFD Command Input
| File . . . . . . . . . . . . . . . . . . . : FILE QSYSPRT
| Library . . . . . . . . . . . . . . . . . : *LIBL
| Type of information . . . . . . . . . . . . : TYPE *ALL
| File attributes . . . . . . . . . . . . . . : FILEATR *ALL
| System . . . . . . . . . . . . . . . . . . : SYSTEM *LCL
| File Description Header
| File . . . . . . . . . . . . . . . . . . . : FILE QSYSPRT
| Library . . . . . . . . . . . . . . . . . . : QSYS
| Type of file . . . . . . . . . . . . . . . : Device
| Device type . . . . . . . . . . . . . . . . : Printer
| Auxiliary storage pool ID . . . . . . . . . : 01
| Device File Attributes
| Externally described file . . . . . . . . . : No
| File level identifier . . . . . . . . . . . : 0980109013920
| Creation date . . . . . . . . . . . . . . . : 01/09/98
| Text 'description' . . . . . . . . . . . . : TEXT System non-describ
| Spool the data . . . . . . . . . . . . . . : SPOOL *YES
| Maximum devices . . . . . . . . . . . . . . : 1
| User specified DBCS data . . . . . . . . . : IGCDTA *NO
| Maximum file wait time . . . . . . . . . . : WAITFILE *IMMED
| Share open data path . . . . . . . . . . . : SHARE *NO
| Record format level check . . . . . . . . . : LVLCHK *NO
| Number of record formats . . . . . . . . . : 1
| User buffer length . . . . . . . . . . . . : 0
| Number of devices . . . . . . . . . . . . . : 1
| Separate indicator area . . . . . . . . . . : INDARA No
| Coded character set identifier . . . . . . : CCSID 0
| Printer Attributes
| Device . . . . . . . . . . . . . . . . . . : DEV *JOB
| Printer device type . . . . . . . . . . . . : DEVTYPE *SCS
| Page size PAGESIZE
| Length . . . . . . . . . . . . . . . . . : 34
| Width . . . . . . . . . . . . . . . . . . : 132
| Measurement Method . . . . . . . . . . . : *ROWCOL
| Lines per inch . . . . . . . . . . . . . . : LPI 6
| Characters per inch . . . . . . . . . . . . : CPI 10
| Front margin . . . . . . . . . . . . . . . : FRONTMGN *DEVD
| Back margin . . . . . . . . . . . . . . . . : BACKMGN *FRONTMGN
| Overflow line number . . . . . . . . . . . : OVRFLW 30
| Fold records . . . . . . . . . . . . . . . : FOLD *NO
| Degree of page rotation . . . . . . . . . . : PAGRTT *AUTO
| Hardware justification . . . . . . . . . . : JUSTIFY 0
| Print on both sides . . . . . . . . . . . . : DUPLEX *NO
| Defer Write . . . . . . . . . . . . . . . . : DFRWRT *YES
| Unprintable character action RPLUNPRT
| Replace character . . . . . . . . . . . . : *YES
| Replacement character . . . . . . . . . . : ' ' X'40'
| Print text . . . . . . . . . . . . . . . . : PRTTXT *JOB
| Align page . . . . . . . . . . . . . . . . : ALIGN *NO
| Control character . . . . . . . . . . . . . : CTLCHAR *NONE
The name of the system value that specifies the name of the default system printer
is QPRTDEV. The value supplied by IBM for the system value QPRTDEV is
PRT01.
Displaying the QPRTDEV system value: As a user of the system, you can
display any of the IBM-supplied system values.
To display the QPRTDEV system value, type DSPSYSVAL QPRTDEV and press the
Enter key.
If the value supplied by IBM has not been changed, the name of the system printer
is PRT01.
If you are the person responsible for adding new users to the system, you can
avoid confusion by specifying the necessary print device values you want in the
user’s user profile.
Go to “Examples: where your printing would go” on page 23 for some examples
that show how the printing elements work with each other.
You can do one or more of the following to affect your print activity:
v You can use the spooled file owner parameter to store the printed output under
a different job and user.
| Also assume that there has not been a switch to an alternate user profile.
| The system looks a the PRTDEV parameter in the job description, that value is
| *USRPRF. This tells the system to look at the PRTDEV parameter in the user
| profile. In this example, that value is *WRKSTN. This tells the system to look at
| the PRTDEV parameter in the workstation description. This tells the system to look
| at hte system value QPRTDEV and to use the output queue on the system that has
| the same name as the system printer named in the system value QPRTDEV. In this
| example, that is PRT01. PRT01 is stored in the job attribute PRTDEV.
| When a spooled file is to be created, the system looks at the OUTQ parameter in
| the printer file for the output queue name. In this example, that value is *JOB. This
| tells the system to look at the OUTQ attribute for the job. The OUTQ job attribute
| was set to *DEV during the job initiation stage. The OUTQ job attribute, *DEV, tells
| the system to look at the DEV parameter in the printer file. The value in the DEV
| parameter of the printer file is *JOB. That value tells the system to look at the
| PRTDEV attribute of the job. If the IBM-supplied value for QPRTDEV has not been
| changed, the printer device name is PRT01 and the output queue name is PRT01.
| If the IBM-supplied value for QPRTDEV has not been modified, the printer device
| name is PRT01 and the output queue name is PRT01.
| In example 2, the output queue would be PRT04. The system found the output
| queue parameter value of PRT04 in the printer file rather than a value that would
| point it to your OUTQ job attribute.
| Also assume:
| v The job did not switch to an alternate user profile.
| v The current user has a group profile GRP.
|
|
|
| Note: Because the SPLFOWN parameter of the printer file is *CURGRPPRF, the
| spooled file will be created under job xxxxxx/GRP/QPRTJOB (where xxxxxx
| is 000000–999999). For more information on the SPLFOWN parameter see
| the CL Reference topic in the AS/400 Information Center.
| The system looks at the OUTQ value in the current job description. The value
| *USRPRF, in the job description, tells the system to look at the OUTQ parameter in
| the user profile. The value in the OUTQ parameter of the user profile is
| *WRKSTN. This tells the system to look at the OUTQ parameter in the workstation
| description. In the workstation description, the OUTQ parameter is *DEV. In the
| job attributes, the OUTQ job attribute gets set to *DEV.
| The system looks PRTDEV parameter in the job description. The value *USRPRF, in
| the job description, tells the system to look at the PRTDEV parameter in the user
| profile. The value *WRKSTN, in the user profile, tells the system to look at the
| PRTDEV parameter in the workstation description. The value *SYSVAL, in the
| workstation description, tells the system to look at the system value and use the
| value set for QPRTDEV. The value in QPRTDEV is PRT01. PRT01 becomes the
| value for the PRTDEV job attribute.
| Also assume that there has been a switch to an alternate user profile USR.
|
|
|
| Note: The SPLFOWN parameter of the printer file is *JOB, and the job has
| switched to user profile USR. The current job will create the spooled file. For
| more information on the SPLFOWN parameter see the CL Reference topic in
| the AS/400 Information Center.
+ The system looks at the OUTQ parameter in the printer file for the output queue
+ name. The value, in this example, *JOB, tells the system to look at the OUTQ job
+ attribute. Because the SPFLOWN parameter is set to *JOB, the job attribute OUTQ
+ of the current job is used. The value is PRT03. In this example, the spooled file
+ goes to output queue PRT03.
| Note: The SPLFOWN parameter of the printer file is *CURUSRPRF, and the job
| has switched to user profile USR. The spooled file will be created under job
| xxxxxx/USR/QPRTJOB (where xxxxxx is 000000–999999). For more
| information on the SPLFOWN parameter see the CL Reference topic in the
| AS/400 Information Center.
| The system looks at the OUTQ parameter in the job description. That value, PRT04
| tells the system that it does not need to look any further and sets the OUTQ job
| attribute to PRT04.
| The value *USRPRF in the PRTDEV parameter of the job description, tells the
| system to look at the PRTDEV attribute of the user profile. In the user profile, the
| value *WRKSTN tells the system to look at the PRTDEV parameter in the
| workstation description. That value, *SYSVAL tells the system to look at the system
| value QPRTDEV and to use the output queue that is named in that value. In this
| example, the value is PRT01 and it is stored in the job attribute PRTDEV.
| The system looks at the OUTQ parameter in the printer file for the output queue
| name. That value *JOB, tells the system to look at the OUTQ attribute of the job.
| There is a data area, QPRTJOB in QUSRSYS, that is owned by the user profile
| QSPL that has a logical value of false. Because of this data area, the system will
| look at the OUTQ attribute for job xxxxxx/USR/QPRTJOB. In the
| xxxxxx/USR/QPRTJOB, the OUTQ attribute value *DEV tells the system to look at
| the DEV parameter in the printer file. The value *JOB in the DEV parameter of the
| printer file, tells the system to look at the PRTDEV attribute of the current job.
| That value is PRT01.
Also assume that there has been a switch to an alternate user profile USR.
|
+ Note: The SPLFOWN parameter of the printer file is *CURUSRPRF, and the job
+ has made a switch to user profile USR. The spooled file will be created
+ under job xxxxxx/USR/QPRTJOB (where xxxxxx is 000000–999999). For
+ more information on the SPLFOWN parameter see the CL Reference topic in
+ the AS/400 Information Center.
+ The system looks at the OUTQ parameter in the printer file for the output queue
+ name. That value, *JOB, tells the system to look at the OUTQ job attribute. The
+ system will look at the OUTQ job attribute of the current job, which is PRT03.
| Also assume:
| v There has been a switch to alternate user profile USR.
| v The current user has a group profile X.
| v The data area QPRTJOB, of type *LGL, with a value of false (0), exists in library
| QUSRSYS and is owned by QSPL user profile.
|
Note: The SPLFOWN parameter of the printer file is *CURUSRPRF, and the job
has switched to alternate user profile USR. The spooled file will be created
under job xxxxxx/USR/QPRTJOB (where xxxxxx is 000000–999999).
+ The system looks at the OUTQ parameter in the printer file for the output queue
+ name. That value, *JOB, tells the system to look at the OUTQ job attribute. Because
+ data area QPRTJOB with a logical value of true exists, the system will look at the
+ OUTQ job attribute of in the current job, which is PRT04.
+ Also assume that there has not been a switch to an alternate user profile.
|
| In example 8, at job initiation, the following takes place:
| The system looks at the OUTQ parameter in the job description. That value
| *USRPRF tells the system to look at the OUTQ parameter in the user profile. The
| value of the OUTQ parameter in the user profile is OUTQ1. Because this is the
| name of a specific output queue, this value is stored as the OUTQ value in the job
| attributes.
| The system looks at the PRTDEV parameter in the job description. That value
| *USRPRF tells the system to look at the PRTDEV parameter in the user profile. The
| PRTDEV value in the user profile is PRT02. Because this is the name of a specific
| printer device, the system stops looking and stores this value as the PRTDEV value
| in the job attributes.
+ In this example, your printer device would be PRT02. This is because the system
+ looked first into the printer file and found the PRTDEV parameter value to be
+ *JOB, which sent it to the job attribute PRTDEV.
| In this example, the printer file specified SPOOL = *NO. Your output would go
| directly to PRT02 for printing and no output queue would be used.
+ Also assume that there has not been a switch to an alternate user profile.
| The system looks at the OUTQ parameter in the job description. That value,
| *USRPRF tells the system to look at the OUTQ parameter in the user profile. In the
| user profile, the OUTQ parameter value is *WRKSTN. This value tells the system
| to look at the OUTQ parameter in the workstation description. The OUTQ value in
| the workstation description is PRT02. This value is stored as the OUTQ value in
| the job attributes.
| The system looks at the PRTDEV value in the job description. That PRTDEV value
| in the job description is *USRPRF. That value tells the system to look at the
| PRTDEV value in the user profile. The PRTDEV value in the user profile is
| *WRKSTN. That value tells the system to look at the PRTDEV value in the
| workstation description. The PRTDEV value in the workstation description is
| PRT03. This value is stored as the PRTDEV value in ithe job attributes.
| The system looked at the printer file and found the PRTDEV parameter value to be
| *JOB, which tells the system to look next in the job printer attribute PRTDEV.
| In this example, the printer file specified SPOOL = *NO. Your output would go
| directly to PRT03 for printing and no output queue would be used.
| REMEMBER:
| You must know the value (*YES or *NO) of the SPOOL parameter in
| the printer file to determine if your output goes to an output queue
| or to a printer. If SPOOL = *YES, a spooled file goes to an output
| queue. If SPOOL = *NO, the output goes directly to a printer.
The names for the output queue and printer device are resolved when the system
searches through the user profile, job description, workstation description, and
system values.
Following are examples that illustrate where output goes from a job that runs in
batch.
Example 1
Assume:
v There has not been a switch to an alternate user profile.
v The spooled file owner is *CURUSRPRF.
v The user’s output queue (OUTQ) is OUTQ1 and the printer device (PRTDEV) is
PRT1.
v The Submit Job (SBMJOB) command is used to submit the job to batch.
v The output queue parameter on the SBMJOB command is specified as
*CURRENT.
v The printer device parameter on the SBMJOB command is specified as
*CURRENT.
When the job runs in batch, the resulting spooled file is sent to OUTQ1 and that
spooled file prints on the printer assigned to OUTQ1.
If no spooling was used when printing, the output would go to printer device
PRT1.
The reason OUTQ1 and PRT1 are used is that *CURRENT is the value passed to
the batch job by the user.
Example 2
Assume:
v There has not been a switch to an alternate user profile.
v The spooled file owner *CURUSRPRF value on the printer file has not been
overridden.
v The user’s output queue (OUTQ) is OUTQ1 and the printer device (PRTDEV) is
PRT1.
v The Submit Job (SBMJOB) command is used to submit the job to batch.
v The output queue parameter on the SBMJOB command is specified as *USRPRF.
v The user profile has *WRKSTN as the value for the output queue parameter.
v The printer device parameter on the SBMJOB command is specified as PRT99.
When the job runs in batch, the resulting spooled file is sent to the output queue
named PRT99 and the spooled file prints on PRT99. The *WRKSTN value for
output queue is interpreted as *DEV and an output queue having the same name
as the printer device is selected.
Example 3
Assume:
v There has not been a switch to an alternate user profile.
v The spooled file owner *CURUSRPRF value on the printer file has not been
overridden..
v The user’s output queue (OUTQ) is OUTQ1 and the printer device (PRTDEV) is
PRT1.
v The Submit Job (SBMJOB) command is used to submit the job to batch.
v The output queue parameter on the SBMJOB command is specified as *USRPRF.
v The user profile has *WRKSTN as the value for the output queue parameter.
v The printer device parameter on the SBMJOB command is specified as
*WRKSTN.
When the job runs in batch, the resulting spooled file is sent to the system printer.
This is because the *WRKSTN value for output queue is interpreted as *DEV and
the printer device value of *WRKSTN is interpreted as *SYSVAL.
If no spooling was used when printing, the output would go to the printer defined
as the system printer. This is the printer name assigned to the system value
QPRTDEV.
Record the names of the output queue and the printer device in the empty blocks
to the right of the diagram. The completed diagrams with the correct names for the
output queues and printer devices are available on the next page.
Note: Keep in mind the SPOOL parameter value when deciding on your answer.
+ Again, the system looked first at the printer file, but this time it found SPOOL =
+ *NO. Next, it looked at the device value in the printer file, which is *JOB. It then
+ looked at the device value in the job attribute PRTDEV.
If you had difficulty identifying the correct output queue and printer device you
should go to “Controlling print activity” on page 13 and read the information again
on controlling printing activity.
The following table provides a list of all the parameters of the CRTPRTF command.
It also indicates if those parameters can be changed or temporarily overridden
through the Override Printer File (OVRPRTF) command or through a program
written in a high-level language (HLL) such as RPG, COBOL, PL/I, C, or BASIC.
If, at this time, you want to become familiar with this command, type CRTPRTF
and press F4 (Prompt). Or you can go to “What parameters make up a printer
file?” on page 41 and view a chart that lists all the printer file parameters.
The next section of this chapter contains examples where an application program
calls (uses) a user-created printer file. The examples focus on a program-described
printer file and an externally described printer file.
The reason the terms externally described or program-described are important is that
by specifying *NONE on the SRCFILE parameter of the CRTPRTF command, the
user is telling the system that the high-level language the application program is
written in will control how the printed output appears on a printed page.
To show you how printer files interact with application programs there is an
example of a printer file using program-described files and one using externally
described files (DDS).
Do you want to read through the example of the program described printer file or
through the example of the externally described printer file?
Program Described
Externally Described
↓ Go to “Using an externally-described printer file with an application
program” on page 59.
READ ADDRESS 10
*IN10 DOWEQ'0'
ADD2 IFEQ *BLANKS
MOVE '1' *IN55
ELSE
MOVE '0' *IN55
END
*********************************************************************
2 EXCPTPRINT
*********************************************************************
READ ADDRESS 10
END
*********************************************************************
3 MOVE '1' *INLR
*********************************************************************
CKCITY BEGSR
MOVEA*BLANKS CTAR
MOVEA*BLANKS STAR
MOVEA*BLANKS ZPAR
MOVEA*BLANKS CSAR
MOVEACITY CTAR
MOVEAST STAR
MOVEAZIP ZPAR
Z-ADD1 X 20
Z-ADD1 Y 20
EXSR LOOKBL 1ST WORD.
ADD 1 X
CTAR,X IFGT *BLANKS 2ND WORD
MOVE ' ' CSAR,Y
ADD 1 Y
EXSR LOOKBL
4 ADD 1 X
CTAR,X IFGT *BLANKS 3RD WORD
MOVE ' ' CSAR,Y
ADD 1 Y EXSR LOOKBL
END
END
MOVE ',' CSAR,Y
ADD 1 Y
MOVE ' ' CSAR,Y
ADD 1 Y
MOVE STAR,1 CSAR,Y
ADD 1 Y
LOOKBL BEGSR
CTAR,X DOWGT*BLANKS
MOVE CTAR,X CSAR,Y
ADD 1 X
ADD 1 Y
END
ENDSR
*********************************************************************
RTE 1 2 PRINT
Open processing
Part 1 of the application program opens files that are called by the application
program.
When a program opens files, an object of type *FILE is connected to the program
for processing. Among the files opened in this example, and of particular interest
at this point, is the printer file whose name is LABELPRT. You can find the printer
file name LABELPRT next to the 1 in the program listing.
A printer file is opened to prepare the system so that the application can put data
into a spooled file or print it out directly to a printer. Information from the
high-level language application program, the printer file, and any printer file
overrides is combined.
The printer file open operation is controlled by parameters specified in the printer
file, the high-level language program, and in printer file overrides (through the
OVRPRTF command). See “Overriding printer files” on page 69 for more
information on overrides.
As an example, if the printer file specified lines per inch (LPI) of 8, and an
OVRPRTF command specified an LPI of 6, the LPI of 6 would be used since the
override value specified by the OVRPRTF command takes precedence over the LPI
value specified in the printer file.
Some of the values are discussed in more detail than others, because some of the
parameters have many more possible values than others.
FILE
Specifies the qualified name by which the printer file being called is known.
DEV
Specifies the name of a printer device description. The device description is an
object that contains information describing a particular device (printer in this
case) or logical unit that is attached to the system. For nonspooled output, this
identifies the printer device used with the printer file to produce the printed
output. For spooled output, if OUTQ(*DEV) is also specified, the default
output queue for the specified printer is used for the spooled file.
DEVTYPE
Specifies the type of data stream created for a printer file. This parameter
indicates whether the resulting data stream should be:
If the DEVTYPE is *SCS, the CPI parameter is used for the conversion. The
CPI value should match the pitch of the specified FONT, or the FONT
parameter should be *CPI. Let’s use the same values as in the previous
Note: Do not specify an AFP Unicode migration font character set and code
page for this printer file parameter. Specify a Unicode font using the
FNTCHRSET DDS keyword in the DDS Print Reference in the online
AS/400 Information Center.
CDEFNT
Specifies the coded font and point size to be used at printing time.
A coded font is an AFP resource that is made up of a font character set name
and a code page name. A point size is required for outline fonts.
For more information about coded fonts and their relationship to font character
sets, code pages, and font global identifiers (FGIDs), go to “Using the coded
font (CDEFNT) parameter” on page 100.
PAGDFN
Specifies the page definition to be used to format line data.
Print Services Facility/400 (PSF/400) requires a page definition when *LINE or
*AFPDSLINE is specified for the device type. An inline page definition gets
built from the printer file parameters if you specify either *LINE or
*AFPDSLINE, and you specify *NONE for the page definition.
FORMDF
Specifies the form definition to use when printing a file. A form definition is a
resource object that defines the characteristics of the form. Characteristics
include duplexing, overlays, position of page data on the form, number of
copies, modification of pages, and input drawer. When printing to a printer
that is configured as AFP(*YES), a form definition is required. If you do not
provide a form definition, an inline form definition will be built from the
printer file parameters.
AFPCHARS
Specifies one or more AFP characters (coded fonts) to use with line data and a
page definition.
TBLREFCHR
Specifies whether or not table reference characters are present in the line data.
When you use forms control characters with the data, the table reference
character follows the forms control characters, but precedes the data bytes. If
you do not specify forms control characters, the table reference character is the
Note: Overlays and page segments do not rotate with the rest of the page.
Output processing
Part 2 of the application program performs the operations of reading, compiling,
and sending the output to the output queue specified in the OUTQ parameter of
the CRTPRTF command or to the printer specified in the DEV parameter of the
CRTPRTF command. In this example, the SPOOL parameter has a value of (*YES).
This means the output will become a spooled file in the designated output queue.
The following printer file parameters are the CRTPRTF parameters looked at by
the system program and application program during the output processing portion
of the application program. Unless otherwise noted, these parameters also apply to
externally-described printer files.
SRCFILE
Specifies the qualified name of the source file and member, if one exists, that
contains the data description specifications (DDS).
This example does not use a DDS source file. Thus, when the application
program calls the printer file LABELPRT and looks at the SRCFILE parameter,
the value will be *NONE.
Front side overlays are valid only for printers configured for Advanced
Function Printing*. For more information on overlays, go to “Using the overlay
(FRONTOVL and BACKOVL) parameters” on page 89.
BACKOVL
Specifies the overlay to be used on the back side of a piece of paper. Possible
values are:
v *NONE (No overlay is used.)
v Qualified overlay-name (The name of the overlay to be used, the library the
overlay is in, and whether to use the constant back function.)
v *FRONTOVL (Use the overlay specified for the FRONTOVL parameter.)
Back side overlays are valid only for printers configured for advanced function
printing. For more information on overlays, go to “Using the overlay
(FRONTOVL and BACKOVL) parameters” on page 89.
MAXRCDS
Specifies, for spooled output only, the maximum number of records in the
spooled file for spooled jobs using this printer file.
DFRWRT
DFRWRT(*YES) means the system controls the amount of output held in the
buffer before being sent to the printer.
For spooled files, DFRWRT(*NO) means spooled data is sent to the printer
when a page of output is available or when the system buffer is full. (Buffers
are usually 512 bytes.) DFRWRT(*NO) has effect on spooled files only if
SCHEDULE(*IMMED) is specified.
For direct output, DFRWRT(*NO) means data is sent to the printer each time
the application program performs a write operation.
Close processing
Part 3 of the application program performs the close operations of the
application program.
When the application program has finished the output processing part of the
application program, it performs a close operation on all the files it opened during
the open processing portion of the application program.
The following printer file parameters from the CRTPRTF command are the
parameters looked at by the system program and the application program during
the close portion of the application program.
SCHEDULE
Specifies, for spooled files only, when the spooled file is made available to the
printer writer program.
This is the RPG-coded application program. The reverse-image numbers within the
program correspond to the list on the following pages. That list explains how this
program works and specifically how the program opens and uses the printer file.
v Part 1 opens the printer file
v Part 2 sends the output to the designated output queue
v Part 3 closes the opened files
v Part 4 processes the data
************************************************************************
FADDRESS IF E K DISK
1 FLABELPR3O E PRINTER
************************************************************************
CTAR 20 1
CSAR 30 1
STAR 2 1
ZPAR 8 1
READ ADDRESS 10
************************************************************************
WRITEHEADNG
*IN10 DOWEQ'0'
EXSR CKCITY
2 WRITEDETAIL1
ADD2 IFNE *BLANKS
WRITEDETAIL3
END
WRITEDETAIL4
READ ADDRESS 10
END
************************************************************************
************************************************************************
3 MOVE '1' *INLR
************************************************************************
CKCITY BEGSR
MOVEA*BLANKS CTAR
MOVEA*BLANKS STAR
MOVEA*BLANKS ZPAR
MOVEA*BLANKS CSAR
LOOKBL BEGSR
CTAR,X DOWGT*BLANKS
MOVE CTAR,X CSAR,Y
ADD 1 X
ADD 1 Y
END
ENDSR
******************************************************************
Open processing
Part 1 of the application program opens files that are called by the application
program. Among those, and of particular interest at this point, is the printer file
whose name is LABELPR3. You can locate LABELPR3 next to 1 in the program
listing.
A printer file is opened to prepare the system so that the application can put data
into a spooled file or print it out directly to a printer. Information from the
high-level language application program, the printer file, and any printer file
overrides is combined.
The printer file open operation is controlled by parameters specified in the printer
file, the high-level language program, and in printer file overrides (through the
OVRPRTF command). See “Overriding printer files” on page 69 for more
information on overrides.
Output processing
Part 2 of the application program performs the operations of reading, compiling,
and sending the output to the output queue specified in the OUTQ parameter of
the CRTPRTF command, or to the printer specified in the DEV parameter of the
CRTPRTF command. In this example, the SPOOL parameter has a value of (*YES)
which means the output will become a spooled file in the designated output
queue.
Unless otherwise noted, the printer file parameters listed in “Output processing”
on page 56 are also valid for externally-described printer files.The following
printer file parameters from the CRTPRTF command are additional parameters that
are looked at by the application program during the output processing.
SRCFILE
Specifies the qualified name of the source file and member, if one exists, that
contains the data description specifications (DDS).
Since this example uses DDS, look at 1 in the program listing and see that
the name of the printer file is LABELPR3. LABELPR3 was compiled using the
source from the member and file that are listed here. See “DDS keywords” for
an example of the compiled DDS and a list of DDS keywords.
Note: The DDS will be compiled before the application program runs. The
application program never looks at the DDS file and member, only at
the compiled results.
Option
Specifies the type of printout that will be produced when the printer file is
created.
GENLVL
Specifies the severity level of DDS messages that cause file creation to fail.
This example uses three DDS keywords: SPACEB, UNDERLINE, and HIGHLIGHT.
DDS keywords: Below is a listing of all available DDS keywords associated with
printer files.
The following list contains all the DDS keywords that you can use to help you
control how your printed output will look. Remember, some DDS keywords can
only be used if the target printer supports them. For example: COLOR can only be
specified if the target printer is a 4224.
For more detailed information on how to create and code DDS source files and to
find out which printers support which DDS keywords, see the DDS Reference
topic in the online AS/400 Information Center.
ALIAS
Alternative Name. Use this field-level keyword to specify an alternative name
for a field. When the program is compiled, the alternative name is brought into
the program instead of the DDS field name. The high-level language compiler
in use determines if the alternative name is used. Refer to the appropriate
high-level language reference manual for information about ALIAS support for
that language.
ALIAS
Bar Code. Use this field-level keyword to print a field as a user-specified bar
code. BARCODE is valid for IPDS printers. (A bar code is a pattern of bars of
various widths containing data to be interpreted by a scanning device.)
BLKFOLD
Blank Fold. Use this field-level keyword for named fields that overflow onto
subsequent print lines, to cause folding to occur at a blank rather than at the
end of a line. If the blank fold keyword is not specified, the line folds at the
end of the physical print line.
| BOX
| Box. Use this record-level keyword to specify the position on a page where a
| box should be drawn. You can specify the corners and the weight (thickness)
| of the lines in the box. Additionally, you can specify the color of the lines of a
| box and whether to have box shading. If you select box shading, you can also
| specify the color of the box shading. For more information on the DDS box
| keyword, DDS Reference topic in the AS/400 Information Center.
| CCSID
| Coded Character Set Identifier. Use this file-, record-, or field-level keyword to
| specify that a ’G’ type field supports UCS-2 data instead of DBCS graphical
| data.
CDEFNT
Coded Font. Use this record- or field-level keyword to specify the coded font
and point size for printing a named or constant field or fields within a record.
For more information on the DDS coded font keyword, go to DDS Reference
topic in the AS/400 Information Center.
CHRID
Character identifier. Use this field-level keyword to specify that a graphic
character set and code page other than the device default can be used for this
field. This can be important when extended alphabetics (characters such as u
with an umlaut or c with a cedilla) are to be printed.
CHRSIZ
Character Size. Use this record- or field-level keyword to expand the width
Note: Overlays and page segments do not rotate with the rest of the page.
PAGSEG
Page Segment. Use this record-level keyword to specify the inclusion of a page
segment to be printed at a specific location on a page. For more information on
the DDS page segment keyword, go to the DDS Reference topic in the AS/400
Information Center.
POSITION
Position. Use this field-level keyword to specify the position of a field using
the units specified on the unit of measure (UOM) printer file parameter. For
more information on the DDS position keyword, go to the DDS Reference topic
in the AS/400 Information Center..
PRTQLTY
Print Quality. Use this record- or field-level keyword to vary the print quality
within the file.
The PRTQLTY keyword is allowed only on records or fields for which a
CHRSIZ or BARCODE keyword applies.
REF
Reference. Use this file-level keyword to specify the name of a file from which
field descriptions are to be retrieved.
REFFLD
Referenced Field. Use this field-level keyword when referring to a field under
one of these three conditions:
v The name of the referenced field is different from the name in positions 19
through 28.
v The name of the referenced field is the same as the name in positions 19
through 28, but the record format, file, or library of the referenced field is
different from that specified with the REF keyword.
v The referenced field occurs in the same DDS source file as the referencing
field.
SKIPA
Skip After. Use this file-, record-, or field-level keyword to specify that the
printer device is to skip to a specific line number after it prints one or more
lines.
SKIPB
Skip Before. Use this file-, record-, or field-level keyword to specify that the
printer device is to skip to a specific line number before it prints the next
line(s).
Close processing
Part 3 of the application program performs the close operations of the
application program.
When the application program has finished the output processing part of the
application program, it performs a close operation on all the files it opened during
the open processing of the application program.
The application program looks at the SCHEDULE parameter from the CRTPRTF
command during the close portion of the application program. For more
information on how the SCHEDULE parameter is used to control when the
spooled file is made available to a printer writer, go to “Using the SCHEDULE
parameter” on page 76.
Bonnie Fohrman
Box 123
RR 1
Chatfield, IA 55924
Cindy Olson
502 9th Ave.
RR2
St. George Cove, IN 46043
Lynn Smith
808 5th St.
Peru, IN 46234
Michael Jones
Box 215
Preston, MN 55923
Pat Edwards
123 River Road
St. Charles, MN 55945
Cindy Olson
502 9th Ave.
RR2
St. George Cove, IN 46043
Lynn Smith
808 5th St.
Peru, IN 46234
Pat Edwards
123 River Road
St. Charles, MN 55945
Overrides are particularly useful for making minor changes to the way a program
functions or for selecting the data on which it operates, without having to
recompile the program. Their principal value is in allowing you to use general
purpose programs in a wider variety of circumstances. Examples of items where
overrides may be used are:
v Changing the name of the file to be processed
v Indicating whether output is to be spooled
v Changing printer characteristics such as lines per inch and number of copies
It is also possible to use overrides to direct data input or data that is output to a
device of a different type. For example, sending data that is intended for a diskette
to a printer instead. This use of overrides requires somewhat more foresight than
the override applications listed above. The program must be able to accommodate
the different characteristics of the two devices involved. For information about the
special considerations that are required for overrides that change the file type or
redirect files, see the Distributed Data Management topic in the AS/400
Information Center.
You can use overrides to change most, but not all, of the file attributes that are
specified when the file is created. In some cases, you can specify attributes in
overrides that are not part of the original file definition. Refer to the command
descriptions available in the online help for more information.
Overriding a file is different from changing a file in that an override does not
permanently change the attributes of a file. For example, if you override the
number of copies specified in a printer file by requesting six copies instead of two,
the file description for the printer file still specifies two copies, but six copies are
printed. The override command tells the system which file to open and what its
file attributes are.
Applying overrides
There are three different types of file overrides. These are:
v Overriding file attributes
For example, you could temporarily change the number of copies you want
printed from one to three by overriding the value specified on the COPIES
parameter.
v Overriding file names or types
For example, you could temporarily change which printer file the program uses.
v Overriding file names and file attributes of the new file
For example, you could temporarily change the printer file used and also
temporarily change some of the values specified in the new printer file.
For example, assume that you create a printer file named OUTPUT with these
attributes:
v Page size: 66 by 132
v Lines per inch: 6
v Copies of printed output: 2
v Pages for file separators: 2
v Overflow line number: 55
The printer file named OUTPUT is specified in your application program with an
overflow line number of 58. However, before you run the application program, you
want to change the number of copies of printed output to 3 and the overflow line
to 60. The override command looks like this:
OVRPRTF FILE(OUTPUT) COPIES(3) OVRFLW(60)
When you call the application program, three copies of the output are printed.
When the application program opens the file, the file overrides, program-specified
attributes, and file attributes are merged to form the open data path (ODP) which
is used to manage the file during the running of the program. File overrides have
precedence over program-specified attributes. Program-specified attributes have
precedence over file-specified attributes. In this example, when the file is opened
and output operations are performed, spooled output will be produced with a
page size of 66 by 132, six lines per inch, three copies, two file separator pages,
and overflow at 60 lines.
Program-Specified
Attributes Open Data Path
SPOOL(*YES)
PAGESIZE(66 132)
OVRFLW(58) LPI(6)
COPIES(3)
FILESEP(2)
OVRFLW(60)
Override Command
COPIES(3)
OVERFLW(60)
RV2H328-0
The file REPORTS must have been created (CRTPRTF command) before it can be
used.
If you want to override to a different type of file, you use the override command
for the new type of file. For example, if you are overriding a diskette file with a
printer file, use the Override with Printer File (OVRPRTF) command.
Overriding file names or types and file attributes of the new file
This form of overriding files is simply a combination of overriding file attributes
and overriding file names or types. With this form of override, you can override
the file that is to be used in a program and you can also override the attributes of
the overriding file. For example, you want the output from your application
program to be printed using printer file REPORTS instead of printer file OUTPUT
(OUTPUT is specified in the application program). In addition to having the
application program use printer file REPORTS, you want to override the number
of printed copies to three. Assume printer file REPORTS was created with the
following command:
CRTPRTF FILE(REPORTS) SPOOL(*YES)
PAGESIZE (68 132) LPI(8)
OVRFLW(60) COPIES(2) FILESEP(1)
Then call the application program, and three copies of the output are printed using
the REPORTS printer file.
Note that this is not equal to the following two override commands:
Override 1
OVRPRTF FILE(OUTPUT) TOFILE(REPORTS)
Override 2
OVRPRTF FILE(REPORTS) COPIES(3)
Only one override is applied for each call level for an open of a particular file, so if
you want to override the file that is used by the program and also override the
attributes of the overriding file from one call level, you must use a single
command. If two overrides are used, the first override will cause the output to be
printed using the REPORTS printer file, but the second override will be ignored.
CL program overrides
If a CL program overrides a file and then calls a high-level language program, the
override remains in effect for the high-level language program. However, if a
high-level language program calls a CL program that overrides a file, the override
is deleted automatically when control returns to the high-level language program.
High-level language program:
CALL CLPGM1
CL program:
OVRPRTF FILE(PRTF1) TOFILE(MSTOUT)
.
The file opened is PRTF1, not MSTOUT. This is because the override in the CL
program is deleted when the CL program ends.
By specifying *PRTF as the file name on the OVRPRTF command, you can apply
one override to all printer files
The override specified on the OVRPRTF command with *PRTF is applied if there is
no other override for the printer file name at the same call level. The following
example shows how *PRTF works:
Override 1
OVRPRTF FILE(OUTPUT) COPIES(6) LPI(6)
Override 2
OVRPRTF FILE(*PRTF) COPIES(1) LPI(8)
CALL PGM(X)
When program X opens the file named OUTPUT, the opened file has the following
attributes:
COPIES(6)
From Override 1
LPI(6) From Override 1
When program X opens the file named PRTOUT, the opened file has the following
attributes:
COPIES(1)
From Override 2
LPI(8) From Override 2
Deleting overrides
If you want to delete an override before the program has completed running, you
can use the Delete Override (DLTOVR) command. This command deletes only
You can delete all printer file overrides at this call level by specifying *ALL for the
FILE parameter.
Following is an example that shows two printer file overrides, PRTC and PRT3.
The override is changing the COPIES parameter value in both cases. The third line
of the example shows the Delete Override (DLTOVR) command with the FILE
parameter value set to *ALL. This means the overrides to PRTC and PRT3 are
deleted.
OVRPRTF FILE(PRTC) COPIES(2)
OVRPRTF FILE(PRT3) COPIES(4)
DLTOVR FILE(*ALL)
Displaying overrides
You can use the Display Override (DSPOVR) command to display printer file
overrides. You can display all printer file overrides or overrides for a specific
printer file.
However, when the FILE parameter has a value of *ALL, the system presents a
display with all the active overrides to all the file types supported on the system.
Using FILE(*ALL) on the DSPOVR command is an indirect way to learn what
overrides are active for any printer files; a more direct way is to issue a DSPOVR
command for each printer file.
Using the CHGPRTF command makes the specified changes permanent for the
current active session and for all future sessions. You can still apply overrides to a
printer file that has been changed. However, the override is only active for the
current session.
Let’s assume that you have a mailing label program that uses a printer file named
LABELPR3. You now want to have two sets of mailing labels every time the
mailing label program is run and you want the spooled file to go to the output
queue named LABELS. The CL command would look like:
CHGPRTF FILE(LABELPR3) COPIES(2) OUTQ(LABELS)
When any application program that uses printer file LABELPR3 is run, the spooled
file will go to output queue LABELS and two copies of the mailing labels will be
printed. For more information on the CHGPRTF command, see the CL Reference
topic in the Information Center.
However, to use the functions provided by many of the printer file parameters that
are supported for AFPDS, the spooled file must be created with a printer file that
specifies a device type of *AFPDS. These parameters include FRONTMGN,
BACKMGN, FRONTOVL, BACKOVL, FNTCHRSET, CDEFNT, and IGCCDEFNT.
In cases where the AS/400 system does not actually generate the AFP data stream
(the list above) either a printer file is not used or the DEVTYPE parameter for the
printer file is ignored.
Throughout this manual, AFPDS output that is created on the AS/400 system with
a printer file specifying DEVTYPE(*AFPDS) is referred to as *AFPDS created on the
AS/400 system.
This spooled file can then be sent to an ASCII printer attached to an AS/400
system. It is recommended that you not use file or job separators when you specify
DEVTYPE(*USERASCII).
Note: Do not put hex 03 transparency commands in the data stream. Instead, put
only ASCII commands the target printer can understand. The AS/400
system inserts the hex 03 commands with the correct lengths; thus, no
EBCDIC to ASCII translation occurs.
*JOBEND considerations
The SCHEDULE(*JOBEND) spooled files of a job are grouped together on their
output queues when the job completes. All SCHEDULE(*JOBEND) spooled files of
the same job that are grouped together on a queue are produced together by the
writer. Another spooled file can be added to the top of the queue while the writer
is producing a SCHEDULE(*JOBEND) spooled file. After a writer produces one file
of a job that is SCHEDULE(*JOBEND), it checks the following file on the queue. If
this file is from the same job and is also SCHEDULE(*JOBEND), the writer
produces it next. However, if the file is from a different job or is not
SCHEDULE(*JOBEND), the first file on the queue is produced next.
*IMMED considerations
When a writer is producing a SCHEDULE(*IMMED) spooled file, it may catch up
to the program producing the output. When this happens, the writer must wait for
the program to produce more output. Because of this, you should be careful using
*IMMED for the schedule option. When this happens, the writer cannot process
other spooled files. Moreover, the device cannot be used for any other work.
Normally, spooled files that are created with SCHEDULE(*IMMED) specified are
assigned a smaller internal buffer than spooled files that are created with
SCHEDULE(*JOBEND) or SCHEDULE(*FILEEND) specified. Using
SCHEDULE(*IMMED) to assign a smaller internal buffer may allow the spooled
data to be produced sooner, but can also adversely affect performance because
more disk operations are needed for the same amount of spooled data.
+ A large internal buffer is always used for spooled print files that use certain special
+ device requirements. Special device requirements include:
+ v Defined characters
+ v Graphics 4214
+ v Graphics 4234
+ v Graphics 522x
The priority of a spooled file when it is created is set from the printer file. Use the
Create Printer File, Change Printer File, or Override with Printer File commands to
set the OUTPTY parameter to the desired value before the file is opened. After the
file is opened, the output priority of the spooled file can be changed by using the
CHGSPLFA command.
If the value on the STRPRTWTR align parameter is *WTR, the printer writer keeps
track of spooled files that are to be printed and issues a forms alignment message
whenever it determines that forms alignment is needed.
If this value is *FIRST, the forms alignment message is issued only for the first
spooled file printed.
The following cause the printer writer to issue a forms alignment message:
v Delete or hold spooled file command (option *IMMED) issued against a spooled
file with a status of WTR
v Printer writer or spooled file restarted
v Previous spooled file was created with ASCII data (virtual print) and current
spooled file was not
v Forms length of previous spooled file is different than current spooled file
v File being printed is the first file to print after a printer writer has been started
v Forms type is changed (after a G reply to a CPA3394 or CPA3395 message)
Note: A B reply to these messages allows you to skip or not receive the
alignment message.
v Incorrect control characters have been detected on a work station printer in the
previous file
v The Cancel key on a work station printer has been pressed while the previous
file is being printed
v A C (Cancel) reply has been given to the inquiry message for unprintable
characters detected on a work station printer in a previous file
v An H (Hold) reply has been given to some inquiry messages on a work station
printer
v A printer writer has recovered from a communications failure on a remote work
station printer
If the value on the STRPRTWTR align parameter is *FILE, the printer writer looks
at the attributes of the spooled file created by the application program. Specifically,
the printer writer looks at the align parameter value of the spooled file attributes
to determine if it should send a forms alignment check.
If the align parameter value of the spooled file attributes is *YES, the printer writer
sends a message to check forms alignment on the target printer.
If the align parameter value of the spooled file attributes is *NO, the printer writer
does not send any messages to check forms alignment on the target printer.
If you want to avoid any forms alignment messages, you can specify *FILE for the
align parameter on the Start Printer Writer (STRPRTWTR) command and *NO as
the align parameter value of the printer file. With this combination of values, the
AS/400 system does not send any messages to check alignment.
The system automatically senses when the output is too large to fit on the paper
that is loaded in the printer for the following: 3831, 3835, 3900, InfoPrint 3000, and
InfoPrint 4000 printers. It also senses whether the paper is larger than 8 1/2 inches
by 14 inches. In the information below, the expression “too large to fit on the
form” refers to a page size that is defined in the printer file parameters. If both the
length and width exceed 8.5 inches, or if the length or width is greater than 14
inches, the information is too large for the form. For example, a page defined to be
13.2 inches-wide and 11 inches long is too large for a form that is 8.5 inches-wide
and 14 inches-long. This would be a candidate for computer output reduction
(COR). This applies for printers other than the 3831, 3835, 3900, InfoPrint 3000, and
InfoPrint 4000.
If PAGRTT = *AUTO
v If the output is too large to fit on the form, computer output reduction is
performed automatically.
v If the page is wider than it is long, the page is rotated 90 degrees. If it is not
wider than it is long, the page is not rotated.
v *AUTO is only supported for spooled files with a device type (DEVTYPE) of
*SCS, *IPDS, or *AFPDS that is created on an AS/400 system. It is not supported
for files with a device type of *USERASCII, *LINE, *AFPDSLINE, or *AFPDS
that is not created on an AS/400 system.
If PAGRTT = *DEVD
v If the output is too large to fit on the form, computer output reduction is
performed automatically.
v If the page is wider than it is long, the page is rotated 90 degrees. If it is not
wider than it is long, the page is not rotated.
Note: When the PAGRTT parameter value is *AUTO or *DEVD, computer output
reduction (COR) is not provided if the spooled file has any of the Device
Requirements fields set to Y. Use the Work with Spooled Files (WRKSPLF)
command and select option 8=Attributes to view the device requirements
for any spooled file.
If PAGRTT = *COR
v Output is rotated 90 degrees.
v Page size is set to 11 by 8.5 inches.
v Font substitution occurs as follows:
– 12-pitch fonts are replaced with 15-pitch fonts.
– 15-pitch fonts are replaced with 20-pitch fonts.
– All other fonts are replaced with a 13.3-pitch font (with the exception of the
4028 printer, which uses a 15-pitch font).
Note: When the PAGRTT parameter value is *COR, computer output reduction
is not provided if the spooled file is *AFPDS, was created on the AS/400
system, and has any of the Device Requirements fields set to Y.
Use the Work with Spooled Files (WRKSPLF) command and select option
8=Attributes to view the device requirements for any spooled file. In
addition, *COR is not supported for spooled files with a device type of:
– *USERASCII
– *LINE (if the spooled file is sent to a printer configured with
AFP(*YES))
– *AFPDSLINE
– *AFPDS (if the spooled file was not created on the AS/400 system)
X X X X
Page 1, on a 3835 Page 1, on a
paper.
on portrait
degrees rotation,
printer, at 90
Page 1, on a 3835
paper.
landscape
rotation, on
at 0 degrees
3835 printer,
Page 1, on a
printer, at 90 3835 printer,
degrees rotation, at 0 degrees
on landscape rotation, on
paper. portrait
paper.
Page 2
Page 2
Page 2
Page 2
Page 3
Page 3
Page 3
Page 3
Page 4
Page 4
RV3H005-0
Side
Back
Back Side
Front Side
Back Side
RV2H310-1
Note: A page segment or overlay included using the DDS PAGSEG or OVL
keyword is not rotated with the rest of the printed output. This is also true
of an overlay (front or back) specified on the printer file.
You must specify the degree of rotation when the page segment or overlay
is created. Advanced Function Printing Utilities/400 can be used to create
overlays and page segments.
For information on MULTIUP when the REDUCE parameter value is *NONE, see
“Using the MULTIUP(1, 2, 3, or 4) and REDUCE(*NONE) parameters” on page 86.
The MULTIUP parameter allows you to print more than one logical page of data
on a piece of paper. Depending on the printer that you are using, you can print
from one to eight logically formatted pages on one physical piece of paper.
Using a printer that supports duplex printing, you could have four logical pages
printed on each side of the physical paper, thus reducing the number of physical
pages printed from eight to one.
Note: If overlays (using the front overlay (FRONTOVL) and back overlay
(BACKOVL) parameters) are included in output using MULTIUP support,
the overlay applies to the whole sheet. That is, the front overlay is placed on
the front side of the paper and the back overlay on the back side.
Page 1 Page 2
Page 1 Page 2
Page 1 Page 2
Page 1 Page 2
Page 1 Page 2
Page 1 Page 2
Page 1 Page 2
Page 1 Page 2
MULTIUP support
MULTIUP support is available on the following printers:
v 3130 3812 3816 3820 3825 3827 3828 3829 3831 3835 3900 3912 3916 3930 3935
4028 4312 4317 4324 Infoprint 20 Infoprint 32
These are IPDS printers that support page rotation (PAGRTT) and pages per side
(MULTIUP).
For all the above-described printers, the following diagrams are examples of how
the output will print depending on the PAGRTT and MULTIUP values.
Page 1
Page 1
Page 1
Page 1
Page 1
Page 1
Page 1
Page 2
Page 2
Page 2
Page 2
Page 2
If the logical page width is less than or equal to 8 inches and the logical page
length is less than 5 inches, the font is not changed.
If the logical page width is greater than 8 inches, or the logical page length is
greater than 5 inches, the font is selected based on the following table:
Note: Any references to the 4028 printer in the following tables also apply to the
3912, 3916, 4312, 4317, 4324, InfoPrint 20, and InfoPrint 32 printers. The
following footnotes apply to all of the tables about MULTIUP Font
Substitution that are included here.
Notes:
1. If the target printer does not have font 230 resident, it uses font 223.
2. If the target printer is a 4028 and has font 283 (20 pitch) resident, it uses font
283. Otherwise it uses font 281 (20 pitch).
3. If the target printer is a 3130 or 3935, it will use font 416 with point size of 4
(30 pitch). If the target printer is a 4028 and does not have font 290 resident but
does have font 283 resident, it will use font 283. If the target printer is a 4028
and does not have font 290 or 283 resident, it will use font 281 (20 pitch).
Table 2. MULTIUP font substitution for page rotation 0 or 180 with MULTIUP(2)
Page Width (Characters) Page Length (Inches) Font Used Pitch (CPI)
1
1 through 123 characters Less than or equal to 5 230 15
inches
1 through 123 characters Greater than 5 inches 254 17
124 through 139 characters All 254 17
2
140 through 163 characters All 281 202
Greater than or equal to 164 All 2903 273
characters
Page 1 Page 2
Page 1 Page 2
Page 1 Page 2
Page 1 Page 2
Page 1 Page 2
Page 1 Page 2
Page 1 Page 2
Page 1 Page 2
If the logical page width is less than or equal to 5 inches and the logical page
length is less than 8 inches, the font is not changed.
If the logical page width is greater than 5 inches, or the logical page length is
greater than 8 inches, the font is selected based on the following table:
Page 1 Page 3
Page 1 Page 3
Page 1 Page 3
Page 1 Page 3
Page 1 Page 3
Page 1 Page 3
Page 1 Page 3
Page 2 Page 4
Page 2 Page 4
Page 2 Page 4
Page 2 Page 4
Page 2 Page 4
Page 2 Page 4
Page 2 Page 4
If the logical page width is less than or equal to 3.75 inches and the logical page
length is less than 5 inches, the font is not changed.
If the logical page width is greater than 3.75 inches, or the logical page length is
greater than 5 inches, the font is selected based on the following table:
Table 4. MULTIUP font substitution for page rotation 0 or 180 with MULTIUP(4)
Page Width (Characters) Page Length (Inches) Font Used Pitch (CPI)
1 through 54 characters Less than or equal to 5 230* 15
inches
1 through 54 characters Greater than 5 inches 254 17
55 through 61 characters All 254 17
2
Characters 62 through 71 All 281 202
Greater than or equal to 72 All 2903 273
characters
Page 2 Page 4
Page 2 Page 4
Page 2 Page 4
Page 2 Page 4
If the logical page width is less than or equal to 5 inches and the logical page
length is less than 3.75 inches, the font is not changed.
If the logical page width is greater than 5 inches, or the logical page length is
greater than 3.75 inches, the font is selected based on the following table:
Table 5. MULTIUP font substitution for page rotation 90 or 270 with MULTIUP(4)
Page Width (Characters) Page Length (Inches) Font Used Pitch (CPI)
1
1 through 73 characters Less than or equal to 5 230 15
inches
1 through 73 characters Greater than 5 inches 281 20
74 through 83 characters Less than or equal to 3.75 254 17
inches
74 through 83 characters Greater than 3.75 inches 281 20
2
84 through 97 characters All 281 202
Greater than or equal to 98 All 2903 273
characters
To use hardware MULTIUP you can select any MULTIUP value (1 through 4), and
you must specify *NONE as the value on the REDUCE parameter of the printer
file. It is then up to the application to ensure the output fits in the partition
(portion) of the page. The partitioning of the page is determined by the printer.
This combination of MULTIUP and REDUCE parameter values also allows
multiupping of data streams restricted by software multiupping. For example,
*LINE and *AFPDSLINE data streams can be multiupped as can data streams
which contain advanced functions and host resident fonts.
Page 1
Page 1 Page 2
Page 2
Page 3 Page 4
X
Page 3
Page 2
Page 4
Page 5 Page 6
Page 1
Page 5
Page
RV3H000-1
X X
Page 1 Page 2 Page 3
RV3H002-1
Page 3
Page 1
Page 1 Page 2
Page 4
Page 2
Page 3 Page 4
Page 7
Page 5
X
Page 5 Page 6
Page 1 Page 2
Page 8
Page 6
Page 11 Page 12
Page 9
Page 7 Page 8 Page 3 Page 4
Page 10
Page 9 Page 10
Page 11 Page 12
RV3H003-1
X X
Page 1
Page 2
Page 2 Page 4
Page 1 Page 3
Page 3
Page 4
Page 6 Page 8 X
Page 5
Page 6
Page 4
Page 3
Page 5 Page 7
Page 7
Page 8
Page 2
Page 1
Page 10 Page 12
Page 9
Page 10
Page 9 Page 11
Page 11
Page
RV3H047-0
Note: If the device description of the printer has the value for the print while
converting (PRTCVT) parameter set to *YES, the spooled file can print the
pages up to the point where the bar code was encountered no matter what
the fidelity parameter value is.
With your application program, you can use overlays that you created yourself
using the Advanced Function Printing Utilities/400 licensed program, or overlays
sent from System/390.
For more information about the Advanced Function Printing Utilities/400 licensed
program, go to “Advanced function printing utilities/400” on page 325.
The following diagram is an example of an overlay you can create using the AFP
utilities. Additionally, the diagram shows how the merged spooled file data
(Variable Page Data in the diagram) can be integrated into one document.
The merged document can be printed on any IPDS printer configured with
AFP(*YES) in the printer’s device description.
The overlays can only be merged with a spooled file that was created using a
device type (DEVTYPE) of *SCS, *IPDS, or *AFPDS. The *AFPDS must have been
created on an AS/400 system.
Merge
Finished Product
RV2H309-0
To use the contents of the same overlay with different degrees of rotation (0 and 90
degrees), you create the overlay twice, once for 0 degrees and once for 90 degrees.
Assuming that you want the text and the overlay to be read in the same direction,
the overlay offset values (down and across) on the printer file need to change
depending on the degree of rotation of the text (PAGRTT parameter). That is, an
overlay created with 90 degrees rotation is most often used with text that is rotated
90 degrees.
Following are examples of how to determine the overlay parameter values when
page rotation (PAGRTT) is used.
0 1 2 3 4 5 6 7 8 9
5
Another line of text
6 .
.
7
10
11 RV2H337-1
When PAGRTT is 0, the focus point for determining the overlay parameter values
is the top left of the overlay (indicated by the X in the example).
Use the numbers beside the example page to determine the overlay down (3) and
across (2) values.
Overlay parameter values are (3,2). Example 2: Determining Overlay Values with
Page Rotation (PAGRTT) of 90 Degrees. The following example assumes:
v Page size (PAGESIZE) parameter values are (9,11)
v Page rotation (PAGRTT) parameter value is (90)
2 X
.
.
.
.
3
10
11 RV2H338-1
When PAGRTT is 90, the focus point for determining the overlay parameter values
is the bottom left of the overlay (indicated by the X in the example).
Use the numbers beside the example page to determine the overlay down (2) and
across (4) values.
Overlay parameter values are (2,4). Example 3: Determining Overlay Values with
Page Rotation (PAGRTT) of 180 Degrees. The following example assumes:
v Page size (PAGESIZE) parameter values are (11,9)
v Page rotation (PAGRTT) parameter value is (180)
0 1 2 3 4 5 6 7 8 9
4 .
.
5 Another line of text
6 X
7
9 .
.
10 Second line of text
First line of text
11 RV2H339-1
When PAGRTT is 180, the focus point for determining the overlay parameter
values is the bottom right of the overlay (indicated by the X in the example).
Overlay parameter values are (6,4). Example 4: Determining Overlay Values with
Page Rotation (PAGRTT) of 270 Degrees. The following example assumes:
v Page size (PAGESIZE) parameter values are (9,11)
v Page rotation (PAGRTT) parameter value is (270)
0 1 2 3 4 5 6 7 8 9
6 X
7
Another line of text
Second line of text
First line of text
8
.
.
.
.
10
11 RV2H340-1
When PAGRTT is 270, the focus point for determining the overlay parameter
values is the top right of the overlay (indicated by the X in the example).
Use the numbers beside the example page to determine the overlay down (6) and
across (3) values.
Margins define the starting point of printed output on a piece of paper. The
FRONTMGN parameter specifies the starting point on the front side of the paper;
the BACKMGN parameter specifies the starting point on the back side of the
paper.
There are two types of margins: front and back. Offset values, down and across,
are used to fix the position of the margin. Across is defined as left to right. Down
is defined as top to bottom.
The following diagram shows a no-print border. The size of the no-print border
can vary from printer to printer.
0 1 2 3 4 5 6 7 8 9
3
Shaded Area Represents
4 the No-Print Border
10
11 RV2H341-1
Note: If you use margins and overlays together, the offsets have the same unit of
measure (UOM) specified: inches (*INCH) or centimeters (*CM), but not
inches and centimeters together.
To find out if data area QPRTVALS exists on your system, use the following
command:
DSPDTAARA DTAARA(QUSRSYS/QPRTVALS)
If the data area QPRTVALS exists, but position 4 is not set to ’Y’ (uppercase), use
the following command:
CHGDTAARA DTAARA (QUSRSYS/QPRTVALS (4 1)) VALUE ('Y')
If you do not have data area QPRTVALS on your system, you can create one by
using the following commands:
1. CRTDTAARA DTAARA(QUSRSYS/QPRTVALS) TYPE(*CHAR) LEN(256) VALUE(' Y')
Note: The finishing margin is an invisible line along which finishing operations,
such as edge stitching, are done. You specify the position of the finishing
margin, relative to the physical edge, in the reference edge offset element of
the parameter.
Element 1: Reference Edge
Specifies which edge to use for finishing. Possible values are:
*DEVD
The default that is used by the device.
*BOTTOM
The reference edge is the bottom edge.
*LEFT The reference edge is the left-hand edge.
*RIGHT
The reference edge is the right-hand edge.
*TOP The reference edge is the top edge.
The diagram below shows the reference edge offset from the left edge with 2
staples. It uses the following values:
v Element 1: Reference edge—*LEFT
v Element 2: Reference edge offset—*DEVD
v Element 3: Number of staples—*DEVD
v Element 4: Staple offsets—*DEVD
You need to check your printer documentation to determine which elements, and
values of elements, are supported. Where your printer does not support any of the
values for a specific element, specify a value of *DEVD for the element.
Element 1: Reference Edge
Specifies which edge to use for the saddle stitch. Possible values are:
*DEVD
The default that is used by the device.
*TOP The reference edge is the top edge.
*LEFT The reference edge is the left-hand edge.
Element 2: Number of Staples
Specifies the number of staples to use for saddle stitching. Possible values
are:
*DEVD
The default value for the device. This is the value that is used if
*DEVD is also specified for the staple offsets value of this
parameter. When specifying *DEVD for this and for the staple
offset value, the number of staples will be the default that is used
by the device. If you specify one or more offsets, the number of
staples is the same as the number of staple offsets specified.
number of staples
The valid value range is from 1 to 122 staples.
Element 3: Staple Offsets
Specifies the distance between staples that are used in the edge stitching. If
the staple-placement will be on the left or right edge of the paper, the first
staple offset is determined by: measuring from the intersection of the
finishing margin and the bottom edge of the paper to where the center of
the staple will be. Subsequent staple offsets are measured from the same
point (not from the previous staple). If the staple-placement will be at the
top or bottom edge of the paper, the first staple offset is determined by:
measuring from the intersection of the finishing margin and the left edge
of the paper, to where the center of the staple will be. Subsequent staple
offsets are measured from the same point (not from the previous staple).
Possible values are:
In an externally-described file (DDS), the user can use the IGCCDEFNT DDS
keyword to specify a DBCS font. This font will be used to print any DBCS data
encountered in that field or record. If the user has a DBCS-graphic field specified,
the printer file IGCCDEFNT parameter is used unless the IGCCDEFNT DDS
keyword has been specified at the record or field level.
When using a font character set, a character set and a code page must be specified
on the font character set (FNTCHRSET) parameter of the printer file being used. A
point size may be specified for outline fonts. It will be ignored for raster fonts.
You cannot specify a coded font if you use the FNTCHRSET parameter on the
printer file.
You can find out which font character sets and code pages come with the AS/400
system by using the Work with Font Resources (WRKFNTRSC) command and
specifying QFNTCPL for the library and *FNTCHRSET or *CDEPAG as the object
attribute.
Font character sets and code pages are downloaded from the AS/400 system to an
IPDS printer when the spooled file is printed. They are supported on all IPDS
Note: When a printer file is created and a character set and code page are
specified for the font character set (FNTCHRSET) parameter, column spacing
is done using this printer file level parameter. Any fonts or code pages
specified in the DDS FNTCHRSET keyword are ignored and the font and
code page specified in the printer file parameter FNTCHRSET are used.
A coded font is the combination of a font character set and a code page. This
combination is assigned a name and called a coded font.
Note: The coded font contains only the names of the font character set and code
page. It does not contain the font and code page data.
A point size may be specified for outline fonts. It will be ignored for raster fonts.
You can find out which coded fonts come with the AS/400 system by using the
Work with Font Resources (WRKFNTRSC) command and specifying QFNTCPL for
the library and *CDEFNT as the object attribute.
Note: If you have obtained coded fonts from other sources but have them in a
different library, the WRKFNTRSC command can display the coded fonts
located in that library.
You can specify a library for the coded font specified on the printer file. However,
if the font character set and code page that make up the coded font are not in a
library that is defined to your library list, the coded font is not found.
Open considerations
The following considerations apply to opening printer files for spooled output:
v The output queue should be created for the type of output your program
produces so that system operator intervention can be kept to a minimum while
a printer writer is producing output. You should consider the following when
creating an output queue:
– What form of output is being produced (printer or diskette).
Output considerations
The following considerations apply to output operations performed on spooled
files:
Force-end-of-data considerations
The force-end-of-data (FEOD) operation can make part of the spooled file available
to the writer unless SCHEDULE(*JOBEND) or HOLD(*YES) are specified for the
file. This operation lets you write parts of a spooled file; for example, you can
write one order at a time. You should not use the force-end-of-data operation for
normal output. A new spooled file is started after each FEOD operation.
Close considerations
When the schedule value is *FILEEND, the output file is made available to the
printer writer. The file resources used by the program are deallocated.
If an application program is writing data when the system ends abnormally, the
spooled output is shown containing 0 pages on spool displays such as the
WRKOUTQ, WRKSPLFA, and WRKJOB displays. Records that were stored in
internal system buffers are lost.
Spooled files that contain no records (open and close, but no output) are
automatically deleted by the system when the application closes the device file.
Writers will not select these files for printing unless SCHEDULE(*IMMED) is
specified and the writer selects the file before it is closed.
For information about the machine data, see “Chapter 8. Working with line data”
on page 223.
To include the print control information in the data, you specify one of the
following American National Standard first-character forms-control codes in the
first position of each data record:
When you use first character forms control data for a printer file, the print control
information created by the high-level language compiler is ignored. The character
in position 1 of the record is used as the print control character for that record.
The CHLVAL parameter allows you to associate a specific skip-to line number with
an American National Standard channel identifier. For example, if you specify
CHLVAL(2 20), channel identifier 2 is allocated with line number 20; therefore, if
you place the forms-control 2 in the first position of a record, the printer skips to
line 20 before printing the line.
Note: If the printer stops at a particular line number and the next record processed
has a channel value forms-control number that is the same value as the line
number the printer is on, the printer advances to that value (line number)
on the next page. In the example in the paragraph above, if the printer had
been on line 20 already, the printer would then have advanced to line 20 of
the next page.
Each control identifier can be specified only once on the parameter. If no line
number is defined for a channel identifier and that channel identifier is
encountered in the data, the printer takes the default of spacing one line before
printing.
The printer output is spooled to the output queue PRINT. Channel identifier 1 is
associated with line 1, channel identifier 2 is associated with line 10, and channel
identifier 12 is associated with line 60.
To provide flexibility in your print job, the pitch of the font identifier (FONT
parameter) should match, where possible, the value specified on the CPI
parameter. By setting the FONT parameter to FONT(*CPI), the system selects a
font of the same pitch as the CPI parameter value. A print job intended for a
printer that supports fonts can then be printed on another printer without
significant change in the appearance of the printed output. For example, a printer
file which has FONT(222), Gothic font with 15 pitch, and CPI(15) could print on a
3812, 4224, or 5219 Printer (which use the FONT parameter) or also could print on
a 4214, 4230, 4234, 4247, 5224, or 5225 Printer (which support 15 characters per
inch). If this print job were directed to a printer that only supports 10 characters
per inch, then printer file redirection would be used.
When using an SCS externally described printer file, normally the value specified
in the CPI parameter is used to position fields on the printed page. For example, if
a printer file has 10 characters per inch specified, and FIELDA is specified to start
in column 51, then there would be 50 blanks to the left of FIELDA (50 blanks at 10
characters per inch is 5 inches).
RSLH114-0
When using proportionally spaced fonts, fold and truncation (FOLD parameter)
may not work as intended. This is because the system does not keep track of the
width of each individual character.
The following printers also support typographic fonts: the 3812, 3130, 3160, 3816,
3820, 3825, 3827, 3829, 3831, 3835, 3900, 3916, 3930, 3935, 4028, 4312, 4317, 4324,
InfoPrint 3000, and the InfoPrint 4000. You can specify a typographic font by
indicating point size (height of font). A point measures 1/72 of an inch. An 8-point
font would be 1/9 of an inch high, and a 24-point font would be 1/3 of an inch
high. When using fonts that contain tall characters, it may be necessary to double
or triple space, to avoid having lines overlap when printing the page.
Note: The amount of printed space for a field varies depending on which
characters are in a field. Enough space should be left between fields to allow
for the widest characters (uppercase characters) expected in that field.
In the previous example, if CPI(10) and FONT(1351) had been specified, and the
printer used was a 3812 Printer, then FIELDA specified to start in column 51
In this example, FIELDA would start 2.975 inches from the left margin of the paper
regardless of how many fields were defined to its left. When using an increment
value (+n) instead of a column number (positions 42 through 44 in DDS
specification), fields are positioned the same for proportionally spaced fonts as
they are for fixed pitch fonts. That is, the field is positioned based on the width of
the blank for the specified font. The following example illustrates that using either
absolute column numbers or relative increment numbers (+n) will supply the same
result.
A
RSLH115-3
Font substitution
If the font identifier specified on the FONT parameter is not supported by the
printer being used, printer data management selects a substitute font that is
supported by the printer (if possible). A substitute font is at the same pitch or a
higher pitch whenever possible to ensure that as much data as possible fits on the
printed page. A complete list of fonts supported and the substitute font selected for
each printer that supports the FONT parameter is shown in “Appendix D. Working
with Fonts, Font Character Sets, Code Pages, CHRIDs, and Coded Fonts” on
page 387.
For the SCS 3812, 3816 and 5219 Printers, font substitution can be made only at the
file level. For font changes made in the document, font substitution is not done. In
this case, spool redirection (described previously) is used.
The maximum number of fonts that can be sent to a printer file is 48. When more
than 48 fonts are requested, an error message is sent.
A slight adjustment is sometimes made to the first or last line of a page when the
lines per inch (LPI) parameter value is greater than 6. This adjustment prevents
IPDS printers from reporting position check errors due to part of a character
printing off the top or bottom of the page. For the first line on a page, a slight
downward adjustment is made. For the last line on a page, a slight upward
adjustment is made. This adjustment is about 1/72 of an inch. No other lines on
the page are adjusted. This adjustment is made only for spooled files with
DEVTYPE of *SCS or *IPDS when printed on IPDS-capable printers. It is
recommended that the first line on a page not be used for printing if the lines per
inch (LPI) parameter on the printer file is 8 or greater.
To find which graphic symbol sets are available on your system, enter the CL
command:
DSPOBJD OBJTYPE(*GSS) OBJ(QGDDM/*ALL)
CL commands that you can use to do this are: CRTPRTF, CHGPRTF, and
OVRPRTF.
A print band is selected by switches on the 5262 operator’s panel. The operator
must select both a language ID and a band image using these switches.
The 4245, 6252, and 6262 Printers detect the print band the printer is using.
When a print band changes for a print job, no inquiry message is sent to the
message queue associated with the printer writer. You can specify a different form
type for that job, such as blank payroll forms or blank invoices. A message to
change the form type is sent to the printer writer message queue to notify the
operator of the change to the print band.
For example, assume that a physical file on the system contains data in the Basic
French character set, and includes the character é. In the code page used with the
Basic French character set, this character is hex C0. The data could have been
entered on a display device that can handle the character or could have been sent
to the system from another system over a communications line. When hex C0 is
sent to a printer that is set up for the United States Basic character set, the hex C0
is printed as {. Depending on the printer and the hexadecimal value sent, the
hexadecimal value could be an unprintable character. The way the printer handles
a specific hex code point (for example, hex C0) depends on the current value of the
CHRID parameter in the printer file. You can specify the following parameter
values for the CHRID parameter:
v With an explicit value specified for the CHRID parameter, the printer interprets
the data as if the data were in the character set and code page specified.
v With CHRID(*SYSVAL) specified, the printer file takes the value specified in the
QCHRID system value when the output is created.
v With CHRID(*DEVD) specified, the printer uses the CHRID that was set with
the device control panel or that was specified when the printer device
description was created.
v If you have specified CHRID(*JOBCCSID) the printer interprets the data as if it
were in the character set and code page that are associated with the CCSID for
the current job . For more information, see theGlobalization topic in the AS/400
Information Center.
v With CHRID(*CHRIDCTL) specified, the printer file checks the CHRIDCTL job
definition attribute to determine whether to use *JOBCCSID or *DEVD on the
CHRID command parameter for the job.
Not all printers can handle all CHRID parameter values. If a CHRID is specified
for a printer on which that CHRID is not supported, a message is sent to the
operator. Go to “Appendix D. Working with Fonts, Font Character Sets, Code
Pages, CHRIDs, and Coded Fonts” on page 387 for a description of which printers
support which extensions.
For program-described printer files, the value of the CHRID parameter determines
the code page and character set used to print the data. However, for externally
described printer files, the CHRID parameter is used only for fields that also have
the CHRID DDS keyword specified. Fields that do not have the CHRID DDS
keyword use the code page and character as if CHRID(*DEVD) had been specified
for the CHRID parameter on the printer file.
For printers with AFP(*YES) in the device description, the printer file CDEPAG
and FNTCHRSET parameters can be used to select a code page when the printer
file DEVTYPE parameter is *AFPDS. This applies to all IPDS printers except 4224,
4230, 4234, 4247, and 64xx.
The following shows how extended alphabetics are handled in printer output:
RS3H020-0
Assume that a record in a physical file contains a field with the value Renée. An
application program reads the record from the physical file, and writes a record
containing the data to the spooled file. The output field in the printer file that
describes how Renée is to be printed has the CHRID DDS keyword specified,
indicating that the printer is to interpret extended alphabetics. (The graphic
character set 288 and code page 297 are specified for the interpretation in either the
printer file or the QCHRID system value. Code page 297 is used for French
language.)
When printing the data, the printer interprets hex C0 as specified in character set
288 and code page 297. If character set 101 and code page 037 had been selected,
hex C0 (é) would have been printed as {.
One of the following CHRID values (graphic character set and code page) must be
specified to print fonts OCR-A and OCR-B on the IPDS printers:
580 340
590 340
697 892
697 893
Print text
You can specify on the printer file a line of text that is to be printed at the bottom
of every page. This line of text is called the print text and is set by using the
PRTTXT parameter on the CRTPRTF, CHGPRTF, or OVRPRTF commands. Up to 30
characters are allowed in the line of print text. The 30 characters are centered at the
bottom of the page, 2 lines below the overflow line. If the user already has data to
print on the line that the print text goes on, the print text is bumped down to the
next blank line on the page. If no lines are blank, the print text is printed on the
last line of the page.
Notes:
1. For externally described printer files with DEVTYPE(*AFPDS) using the DDS
POSITION keyword, the print text is positioned by ignoring the location of any
data placed on the page by records using the POSITION keyword. If all the
data on the page is positioned using the DDS POSITION keyword, the print
text is located on the overflow line.
2. If a host resident font is specified on the printer file, 10 characters per inch is
used to calculate the location of the text specified on the PRTTXT parameter.
A system value, QPRTTXT, can be used to specify the print text so that the same
text can appear on all files printed on the system. Also, the print text can be taken
from the job description, so that all files created from a particular job can have the
same print text.
Print text is useful for printing a security classification on each page. It can also be
used to print a company name or slogan on each page.
The system provides this editing support with edit codes and edit words. Edit
codes are a defined set of editing patterns. You identify these by name, and the
system edits a field according to the pattern defined by the named edit code. Edit
words are edit patterns that you define to produce the desired results. Edit codes
cover most commonly used editing requirements. You need to use the edit word
support only for those editing needs not covered by edit codes.
There are two methods of using edit codes and edit words. Which one you use
depends on how you define the printer file and how it is used in an application
program. If your application is using program-described data, your high-level
language may allow you to identify edit codes or create your own edit words. If
your application is using externally described data, the edit code (EDTCDE) DDS
keyword allows you to identify an edit code; the edit word (EDTWRD) DDS
keyword allows you to define your own editing pattern.
The editing patterns defined by these codes are described in theDDS Reference
topic in the online Information Center.
These edit codes are created by using the Create Edit Description (CRTEDTD)
command. Edit descriptions are always placed in library QSYS. They cannot be
moved or renamed; only one occurrence of each is allowed. Edit descriptions have
an object type of *EDTD.
Before using any of the user-defined edit codes, you should check its contents on
your system, since it may have been changed from the IBM-supplied version. The
Display Edit Description (DSPEDTD) command can be used to display the contents
of a user-defined edit code.
Changing a user-defined edit code description does not affect any application or
printer file that has already been created using that edit description. If you want
your application to use the changed edit description, you must either create the
high-level language program again (if the edit code is used in the program) or
create the file again (if the application is using an externally described file that
contains EDTCDE keywords).
The system assigns a unique level identifier for each record format when the file it
is associated with is created. The system uses the information in the record format
description to determine the level identifier. This information includes the name of
the record format, the names, attributes, and order of the fields in the format, the
indicators used, and the names and the order of the indicators in the record
format. If you use the INDARA keyword to remove the indicator from the output
buffer, the indicators used are not included in the level identifier information.
When the file is opened, if level checking is specified (LVLCHK parameter), the
system does a format-by-format comparison of the level-checking values specified
in the program to the level-checking values specified in the printer file. If any of
the formats specified in the program do not exist in the file, or if any of the level
checking values are different, an error occurs. Formats can be added to or removed
from a printer file without affecting existing application programs that do not use
the added or deleted formats.
You should display the file description to determine if the changes affect your
program. You can use the Display File Field Description (DSPFFD) command to
display the file description or, if you have the source entry utility (SEU), you can
display the source file. Not every change in a file necessarily affects your program.
You may not have to recompile your program. If you do not have to recompile
your program, you should specify LVLCHK(*NO) for the file (CHGPRTF or
OVRPRTF command).
You can add a field to the end of a printer file record format without having to
recompile your program as long as you do not want to use the field in your
program. If you delete a field from the end of the record format, you do not have
to recompile your program if you are not using the field. However, if you add a
field to or delete a field from a record format anywhere other than at the end, you
In general, anything that changes the length or position of any fields in the record
format used by the program will require that the program be recompiled.
Redirecting output
Spooled or nonspooled output intended for a printer can be redirected to another
printer. However, each file is checked to ensure that the file attributes (device type,
number of lines per inch, number of characters per inch, page length, and page
width) and any advanced functions used by the file (such as variable LPI, variable
font, or defined characters) are valid on the new printer.
Nonspooled output
When a nonspooled file is redirected, and the printer file attributes do not match
the new printer, one of the following occurs:
v If the printer file specifies a characters-per-inch value not supported by the
device being used, a diagnostic message (CPF4057) is sent to the program
message queue and the data is printed at 10 characters per inch. If the page
width is greater than 132 characters, the records are folded.
Folding is not supported on IPDS printers.:
1. If the printer file specifies a lines-per-inch value not supported by the device
being used, a diagnostic message (CPF4056) is sent to the program message
queue, and the data is printed at 8 lines per inch.
2. If the page length is greater than the maximum length allowed for the
printer being used, the printing ends with an escape message (CPF4138).
3. If the printer file specifies special device requirements (such as use of certain
DDS keywords) that are not supported by the device being used, then a
diagnostic message is sent to the program message queue and the special
function is ignored.
Spooled files
When a spooled file is redirected to another printer, the spooled file cannot be
printed without change if any of the spooled output file attributes are not
supported by the printer device. For example, some printer device attributes that
might not be supported are:
v Page size
v Output drawers
v Print quality
v Lines per inch
v Characters per inch
If the spooled file is printed, results may be unpredictable because the file is
printed using the printer attributes specified in the IBM-supplied printer file
QPSPLPRT, and all advanced functions used by the spooled file are removed.
Functions removed include:
DDS keywords:
CHRID
Graphic character set and code page
CHRSIZ
Character size (width and height)
CPI Characters per inch
DFNCHR
Define character
DRAWER
Paper drawer selection
FONT Font selection
LPI Lines per inch
PAGRTT
Page rotation
PRTQLTY
Print quality
TRNSPY
Transparency
Other print functions:
Drawer change in document
Font change in document
Lines-per-inch change in document
Page rotation in document
Subscript and superscript
v If the spooled file specifies a characters-per-inch value not supported by the
printer, an inquiry message is sent to the message queue of the writer with the
option to:
– End the writer
– Print the spooled file at 10 characters per inch with lines folded when the
lines are longer than the width of IBM-supplied printer file QPSPLPRT
If the spooled file is printed, the resulting output closely resembles how the file
was intended to look. This is because the attributes specified by the spooled file
were used and advanced functions were kept.
v Documents created on other systems may contain print controls that are not
supported by the 5219 or 3812 Printers. These controls may include variable
form size, output drawer, print quality, lines per inch, characters per inch,
character identifier, or justification. If this occurs, an inquiry message is sent to
the message queue of the writer with the options to:
– End the writer.
– Print the spooled file with unsupported values changed to values which are
supported by the printer.
– Attempt to print the spooled file without changing. (If this is not successful,
the file will be held on the output queue).
– Hold the spooled file and process the next file on the output queue.
If the spooled file is printed, the file attributes from the spooled file are used and
all advanced functions that are valid for the device are kept. The resulting output
should closely resemble what the file was intended to look like, though it still may
not print exactly as intended because of the unsupported values.
Printing results may be unpredictable, because the printer will use the printer
attributes that are specified in QSPLPR, the IBM-supplied printer file. All
advanced functions that are specified in the spooled file will be removed.
Functions removed include:
If the file prints, its existing attributes will be used. Advanced functions remain
intact, except graphics, defined characters, justification, and transparencies. The
transformation to IPDS format should substantially keep the integrity of the text
data. However, the file may still not print exactly as intended. Unsupported font
pitches, font spacings, and character identifiers are changed to the closest
approximation valid on the printer.
v The writer automatically transforms the file to an IPDS file and prints it if the
following is true: the spooled file uses DEVTYPE(*SCS), does not contain DBCS
data, does not use defined characters, graphics, transparency, variable fonts, or
enhanced 3812 fonts. The printer file also can not use a proportionally spaced
font for the FONT parameter of the printer file. The spooled file may not print
exactly as intended. For unsupported font pitches, font spacings, and character
identifiers, the printer writer uses the closest approximation available on the
printer.
v The message queue of the writer receives an inquiry message if the spooled file
uses the IPDS data stream (DEVTYPE(*IPDS)), but uses advanced functions not
supported by the printer. Options made available are:
– End the writer
– Print the spooled file, but dropping unsupported advanced functions from the
file
However, this happens after the open processing has been done for the first output
to print. The first output to print can be direct output or a spooled file. This
means, for the first output printed, the system treats the printer as a 5219 Printer.
For example, this means there is no page rotation for that first printed output.
In order for the system to recognize a 3812 or 3816 SCS printer, the printer writer
must complete processing. After the first output has been printed, and a new
printer writer is started, the system recognizes the printer as a 3812 or 3816 SCS
printer.
Once the system recognizes a printer as a 3812 or 3816 SCS, it remembers the true
printer type until the printer device description is deleted.
The AS/400 system adjusts the positioning of the printed text on the page to
compensate for the no-print border. For example, if your application program
prints text in the top 1/6 inch or left 1/6 inch, all the text will print. The AS/400
system adjusts the starting printing position to 1/6 inch from the top and left of
the page causing all printed data on the page to be shifted to the right and down
by 1/6 inch. If your application relies on printing data at a certain point on the
paper, you may have to change your application to compensate for this adjustment
or use the margin values of 0 on the printer file.
Note: The 3835 Model 2 does not have a no-print border. The AS/400 system does
not adjust the position of printed text for this printer. When directing output
from printing on a 3835 Model 1 to a Model 2, the difference in how the
no-print border is used must be considered.
If the 3912, 3916, or 4028 is configured AFP(*NO), you may have to adjust your
application programs. For example, if your application program prints text in the
top 1/6 inch or left 1/6 inch, that text will not appear on the page.
If the 4028 is configured AFP(*YES), the AS/400 system adjusts the positioning of
the printed text on the page to compensate for the no-print border. For example, if
your application program prints text in the top 1/6 inch or left 1/6 inch, all the
text will print. The AS/400 system adjusts the starting printing position to 1/6 inch
from the top and left of the page causing all printed data on the page to be shifted
This positions the starting origin of the page to the edge of the printable area.
To include graphics with other program output, a special control record is used.
The format for this control record is:
#$@INCLGRPH filename,x,y,w,l
Notes:
1. There must be only one space between the command word and the parameters.
2. All five parameters must be specified. A default value (the default values are
included in the list below) for parameters x, y, w, and l can be obtained by
omitting any value. For example, a valid control record with defaults for
parameters x, y, and l would look like:
#$@INCLGRPH filename,,,9.5,
3. The #$@INCLGRPH control record should be in a print record by itself, because
any other data along with it may be considered as parameters.
4. Parameters should immediately follow one another, separated by commas,
using no blanks.
5. The characters INCLGRPH must be all uppercase.
6. The #$@INCLGRPH control record must begin in the first column.
7. The #$@INCLGRPH control word is used with characters from code page 500.
For example, in code page 500, @ is hex ’7B’, $ is hex ’5B’, and @ is hex ’7C’.
Other code pages may use other characters in the#$@INCLGRPH control
record. You will need to change the characters depending on the code page
being used.
The parameters are defined below. Parameters x, y, w, and l define the area on
the page where the graphics file will be printed. Parameters x and y define the
upper left corner of the graphics area, and parameters w and l define the size of
the graphics area.
filename
The name of the graph object file to be included. If the file has more than
one member, the last member is used. The library containing the file must
be in your library list.
x The distance, in inches, from the left edge of the page to the left edge of
the graphics area on the page. The default is 0.
y The distance, in inches, from the top of the page to the top edge of the
graphics area on the page. The default is 0.
If there are any errors found in the control record or an error occurs while
processing the graphics file, the control record is printed as normal text data. The
graphics file to be used must be in a format acceptable to the printer. For IPDS
devices, this format is level DR/2 of the Graphic Object Content Architecture
(GOCA). See the manual Graphic Object Content Architecture , SC31-6804, for more
information about GOCA.
Note:
v On the AS/400 system, offset stacking of printed output is used. As the
job finishes, the paper tray moves, offsetting the stack of paper to make it
easier to distinguish between finished jobs. Because of this, the data
stream that is created on the AS/400 system contains the control to
indicate that offset stacking should be used. If the spooled file is sent to a
system that does not support offset stacking, an error message may be
issued.
v Use of the DDS DRAWER and PAGRTT keywords cause the AS/400 to
generate an AFPDS datastream that is not completely supported by the
AFP viewer and some of the PSF products available on other IBM
platforms. If the spooled file needs to be viewed by the AFP viewer or
printed on other IBM platforms, do not use the DRAWER and PAGRTT
keywords in DDS. Use the INVMMAP keyword instead to change the
drawer or page rotation within the spooled file.
Please see “Using Print Services Facility for OS/400 (PSF/400)” on page x for
information on when PSF/400 is required. If you have additional questions about
PSF/400, contact your IBM representative.
Following is a list of DDS keywords that are valid for printer files that have the
printer device type (DEVTYPE) parameter value specified as *AFPDS. Restrictions
on DDS keywords are contained in this list as well. For more detailed information
about DDS keywords, see the DDS Reference: Printer Files, part of the Database
and file systems topic in the iSeries 400 Information Center.
Performance considerations
v For externally described printer files, the fewer the number of fields in a record,
the faster the processing of that record. Also, by putting several lines of text
within a record instead of each line as a separate record, system overhead
involved with the processing of each record is reduced.
v When coding the DDS for externally described printer files, define the fields in
sequential order. The output is not changed if fields are not defined in sequential
order, but the extra travel time of the printer head may be noticeable.
v For externally described printer files, specify a specific font or FONT(*CPI) on
the CRTPRTF, CHGPRTF, or OVRPRTF command instead of FONT(*DEVD). This
helps keep the data stream as small as possible.
When a program opens a printer file, the operating system, by looking at the
printer file SPOOL parameter, determines whether the output is to be spooled.
When a printer file specifying spooling is opened, the spooled file containing the
output of the program (data to be printed) is placed on the appropriate output
queue in the system. A spooled file can be made available for printing when the
printer file is opened, when the printer file is closed, or at the end of the job. This
is done by specifying a particular value on the schedule parameter. *IMMED
makes the spooled file available to the writer as soon as the program is opened.
*FILEEND makes the spooled file available to the writer as soon as the file is
closed. *JOBEND makes the spooled file available to the writer as soon as the job
is complete.
By spooling (that is, sending the output to output queues to await printing), the
system does not have to wait until the printing for that application program is
complete before it can start processing the next application program.
Application
Remote Program Printer
Writer Writer
Program Program
Printer
AS/400 File
MVS/VM Device
Printer
PS/2 Description
Other
Output Queue
RV3H046-0
Application program
Application programs are the primary objects that produce spooled files on the
AS/400 system. All HLL (high-level languages) that can be used on the AS/400
Pressing the Print key runs a program that uses the QSYSPRT printer file to create
a spooled file that captures the image that was on the screen when the Print key
was pressed.
Printer file
Many attributes of the printer file used by the application program apply to the
spooled file and how the spooled file is processed by the system when the
application program ends. These attributes can be specified on the following
commands:
CHGPRTF
Change Printer File
CRTPRTF
Create Printer File
OVRPRTF
Override with Printer File
After a spooled file is created, its attributes can be displayed using the WRKSPLFA
command. Some attributes can be changed using the CHGSPLFA command
Note: Automatic configuration cannot be used for ASCII devices attached to the
ASCII workstation controller.
The printer file that an application program uses will require some of the
information that is contained in the printer device description. For example: the
printer file PRINTER parameter requires the same value as assigned to the printer
device description DEVD parameter.
Output queues
Batch and interactive job processing may result in spooled files that are to be sent
to a printer. These spooled files contain output records waiting to be printed. There
may be many spooled files for a single job.
When a spooled file is created, the file is placed on an output queue. Each output
queue contains an ordered list of spooled files. A job can have spooled files on one
or more output queues. All spooled files on a particular output queue should have
a common set of output attributes, such as printer device, form type, and lines per
inch. Using common attributes on an output queue reduces the amount of
intervention required and increases the printer throughput.
| For more information on spooled file and output queue security, see the Security
| topic in the AS/400 Information Center.
For more information on , see theSecurity topic in the AS/400 Information Center.
The AUT parameter for the output queue is assigned the same value as that
specified by the AUT parameter for the printer device description. All other
parameters are assigned their default values. Use the Change Command Default
(CHGCMDDFT) command to change the default values used when creating output
queues with the CRTOUTQ command.
When a spooled file is created by opening a printer file and the output queue
specified for the file cannot be found, the system attempts to place the spooled file
on output queue QPRINT in library QGPL. If for any reason the spooled file
cannot be placed on output queue QPRINT, an error message is sent and the
output is not spooled.
Each group of spooled files (RDY and non-RDY files) is further sorted by:
1. The output priority of the spooled file.
2. A date and time field (time stamp).
3. The SCHEDULE parameter value of the spooled file. Files with
SCHEDULE(*JOBEND) specified are grouped together and placed after other
spooled files of the same job that have SCHEDULE(*IMMED) or
SCHEDULE(*FILEEND) specified.
4. The spool number of the spooled file.
For output queues with SEQ(*JOBNBR) specified, the date and time field is the
date and time that the job that created the spooled file entered the system. (A
sequential job number and time of day value are also assigned to the job when it
enters the system.) That is how the spooled files are sorted on the queue.
Note: The date and time do not change when the reason the status changes
from RDY to WTR or from WTR to RDY is because the writer was
canceled. Also, the date and time don’t change when the status changes
from RDY to DFR, or from DFR to RDY.
v A spooled file is moved to another output queue that has SEQ(*FIFO) specified.
Because of the automatic sorting of spooled files, different results occur when
SEQ(*JOBNBR) is specified for an output queue than when SEQ(*FIFO) is
specified. For example, when a spooled file is held and then immediately released
on an output queue with SEQ(*JOBNBR) specified, the spooled file will end up
where it started; but if the same spooled file were held and then immediately
released on an output queue with SEQ(*FIFO) specified, the spooled file would be
placed at the end of the spooled files that have the same priority and a status of
RDY.
Note: The starting and ending times must be specified using the 24 hour method
of measuring time. For example, 2:00 PM would be entered as 1400.
Assume you want to restrict spooled files with more than 40 pages from printing
between 0800 and 1600 on output queue MYOUTQ. However, between 1200 and
1300 you want to allow spooled files with 10 pages or less to print. Running the
following command implements these restrictions:
CHGOUTQ OUTQ(MYOUTQ) MAXPAGES((40 0800 1600) (10 1200 1300))
Note: You can specify up to 5 different combinations of pages and start/stop times
on the MAXPAGES parameter.
Each time a spooled file on the output queue reaches RDY status an entry is sent
to the data queue. A spooled file can have several changes in status (for example,
ready (RDY) to held (HLD) to release (RLS) to ready (RDY) again) before it is
taken off the output queue. These status changes result in entries in the data queue
for a spooled file each time the spooled file goes to RDY status.
| Once a data queue is associated with a job or the system, any spooled file created
| by the job or system will automatically have an entry placed in the data queue. For
| this action to occur, the user or user profile QSPL must have authorization to the
| data queue. For more information about data queues, see“Creating data queues”.
| Note: An environment variable that is specified at the job level takes precedence
| over the same environment variable specified at the system level.
| The data queue for the spool data queue entry record type of 02, must be created
| with a record length of at least 144 bytes. It must also have a public authority of
| *USE, or grant QSPL user profile *USE private authorities to the data queue. You
| must ensure that the containing library has a public authority of *EXECUTE, or
| grant QSPL user profile *EXECUTE private authorities to the library. The format of
| the CRTDTAQ command is:
| CRTDTAQ DTAQ (<library name>/<data queue name>) MAXLEN(144) AUT(*USE)
After a data queue is associated with an output queue, any spooled file that is
placed on the output queue in ready status causes an entry to be placed on the
data queue. The data queue entry is added regardless of the authority the user
generating the spooled file has to the data queue.
The intent is not to log the same recurring message all day, but to inform the user
of each change of error messages associated with the data queue of a particular
output queue.
When clearing all output queues during IPL, any associated data queues are not
cleared. If a damaged system output queue is found, it is re-created without any
associated data queue name. Damaged data queues are not re-created.
72 48 CHAR(56) Reserved
The Work with Spooled Files (WRKSPLF) command can be used to display all the
spooled files that you have created. This is an easy way to find your output if you
do not know the name of the output queue where it has been placed. The spooled
files are listed in the same order as they would be on a SEQ(*FIFO) output queue.
(See “Order of spooled files on an output queue” on page 129 for more
information.)
If you know the name of the output queue that contains the spooled file, the Work
with Output Queue (WRKOUTQ) command can be used to display the queue to
determine the position of the spooled files on that output queue.
If a writer is not started to the output queue that contains the spooled file you
wish to print, you have several options in order to print the file:
v Use the Work with All Spooled Files (WRKSPLF) command and type 9 (Work
with printing status) next to your spooled file to find out Why it is not printing.
v Use the Change Spooled File Attributes (CHGSPLFA) command to move the
spooled file to an output queue that has a writer started to it.
v Select a printer that is not being used and use the Start Printer Writer
(STRPRTWTR) command to start a printer that will print the spooled files from
your output queue.
v Select a printer that is started to a different output queue and use the Change
Writer (CHGWTR) command to change the printer to print the spooled files
from your output queue.
If a writer is started to the output queue that contains the spooled file you want to
print, but the status of the spooled file is deferred (DFR status), you can do the
following:
v Use the Change Spooled File Attributes (CHGSPLFA) command to move the
spooled file to an output queue that has a value of *NONE specified for the
maximum spooled file size (MAXPAGES) parameter.
v Use the Change Writer (CHGWTR) command to change the printer to print the
spooled files from the output queue that has the MAXPAGES parameter value
specified as *NONE.
The Work with Writers (WRKWTR) command can be used to find a list of printers
attached to your system and to determine if the printer is active (started).
You can use the SPLFILE parameter on the End Job (ENDJOB) command to specify
if all spooled files (except QPJOBLOG) created by the job are to be kept for normal
processing by the printer writer, or if these files are to be deleted.
If an abnormal end occurs, the spooled file QPJOBLOG will be written at the next
IPL of the system.
If a printer writer fails while a spooled file is being printed, the spooled file
remains on the output queue intact.
A damaged output queue can be deleted using the Delete Output Queue
(DLTOUTQ) command, or it will be deleted by the system during the next IPL.
After the damaged output queue is deleted, it can be created again by entering the
Create Output Queue (CRTOUTQ) command. Then, spooled files on output queue
QSPRCLOUTQ can be moved to the newly created output queue using the Change
Spooled File Attributes (CHGSPLFA) command.
This system-created output queue has the same public authority as specified for
the device and default values for the other parameters. After the system re-creates
the output queue, you should verify its attributes are correct or change them, if
necessary, using the Change Output Queue (CHGOUTQ) command.
When a damaged output queue associated with a printer is deleted and created
again, all spooled files on the damaged queue are moved to the re-created output
queue. This is done by the QSPLMAINT system job, which issues a completion
message to the QSYSOPR message queue when all spooled files have been moved.
Spooled files on destroyed user-created output queues are moved to output queue
QSPRCLOUTQ in library QRCL. Spooled files on destroyed system-created output
queues are moved to the re-created output queues.
Cleanup also deletes spooled files that have data in a damaged database file in
library QSPL.
More than one printer writer can be started to the same output queue (10 is the
limit). However, each writer name must be unique and of the same type (printer,
remote, or diskette).
The printer writer program takes spooled files, one at a time, from the output
queue, based on their priority. The printer writer program prints a spooled file
only if its entry on the output queue indicates that it has a ready (RDY) status. You
can display the status of a particular spooled file using the Work with Output
Queue (WRKOUTQ) command.
If the spooled output file has a ready status, the printer writer program takes the
entry from the output queue and prints the specified job and/or file separators,
followed by the output data in the spooled file. If the spooled file does not have a
ready status, the printer writer program leaves the entry on the output queue and
goes on to the next entry. In most cases the printer writer program continues to
The INIT parameter on the STRPRTWTR command allows you to specify when to
initialize (send printer open time commands) to the printer..
These values are also supported on the Change Writer (CHGWTR) command.
After the spooled output file is successfully sent to a remote system, it is deleted or
saved as determined by the SAVE spooled file attribute value.
More than one remote writer can be started to the same remote output queue (10 is
the limit). The actual number is specified in the remote output queue description.
The multiple printer writer function supports work load balancing between
printers. It also provides backup for printed jobs running unattended. For example,
if one printer jams or runs out of paper the others continue to print spooled output
files from the associated output queue.
When working with the Start Printer Writer (STRPRTWTR) command, message
CPI34B8 indicates that the spooled file printed successfully and on which printer it
printed. Message CPD34B9 indicates that the spooled file is being held. CPD34B9
also indicates which printer it would have printed on.
When working with the Start Remote Writer (STRRMTWTR) command, message
CPI34B7 indicates that the spooled file was sent successfully. Message CPD34B7
indicates the spooled file was not successfully sent.
Using a printer for both spooled files and direct print jobs
The allow direct print function provides the capability of sharing a printer between
the printer writer and direct print jobs.
A printer writer sends spooled files to the printer from the output queue assigned
to that printer. When the SPOOL parameter value on the printer file is *YES,
output data is written to a spooled file and placed on an output queue.
When the SPOOL parameter value on the printer file is *NO, output data is written
directly to the printer. This is a direct print job.
When *YES is specified, the printer writer releases the printer for direct print jobs
when either of the following conditions is true:
v The printer writer is held (STATUS(*HLD)).
v The output queue associated with the printer contains no spooled files waiting
to print.
The allow direct print function uses the maximum file-wait time specified in the
WAITFILE parameter in the printer file.
The default value for the WAITFILE parameter is *IMMED. However, the allow
direct print function requires some time to obtain access to the printer. Therefore, it
is recommended that 2 or 3 minutes be allowed for access to the printer.
Note: The WAITFILE parameter value must be calculated in seconds. For example,
a parameter value of 120 would allow a wait time of 2 minutes.
When choosing the value for the maximum file-wait time (WAITFILE) parameter
in the printer file, consider how busy is the printer that you want to use for your
direct print jobs?
If the value for the WAITFILE parameter is too small, a message is returned
indicating the specified printer could not be obtained. If you still need the job
printed, the job must be run again.
If the value for the WAITFILE parameter is too large, your sign-on session is
utilized waiting for the job to obtain the printer. You cannot use System Request to
The allow direct print function is not supported on printers configured for
advanced function printing. This means the advanced function printing (AFP)
parameter on the printer device description must be *NO.
The spool support on the AS/400 system allows you to change the destination of
spooled files and to alter the appearance of a spooled file before actual printing
occurs. The Work with Spooled Files (WRKSPLF) command is the primary
command used for managing your spooled files.
The Work with All Spooled Files display shows you, in the Device or Queue
column, the name of the queue that the spooled file is currently in.
At the top of the display is a list of actions that can be performed on any spooled
file.
All of these actions (with the exception of Messages and Work with printing status)
can be performed using CL commands. The Work with All Spooled Files display
provides a convenient way for you to run these commands. When you use this
display, you do not have to remember the exact CL command name and the
spooled file attributes such as: name, number, and position in a particular output
queue.
| If you are using the WRKSPLF command, you can manage your spooled files by
| selecting one of the available options from the following list. This list provides the
| option, the associated CL commands, and an explanation of each option..
v Send — Send Network Spooled File (SNDNETSPLF) command
This option allows you to send the spooled file to another user on your system
or to a user in your network. Go to “Using the send option” on page 143 for
more information on using this option.
v Change — Change Spooled File Attributes (CHGSPLFA) command
This option allows you to change attributes of a spooled file.
v Hold — Hold Spooled File (HLDSPLF) command
By choosing option 1 from the WRKSPLF display, the only information you have
to type to send the spooled file is the user ID and address.
Note: If your system is in a TCP/IP network, you can send and print spooled files
using the Send TCP/IP Spooled File (SNDTCPSPLF) command. For more
information, see “Sending and printing files with TCP/IP” on page 336.
| If a spooled file does not start to print or finish printing, the reason could be that a
| message did not receive a response. Often, it is a check to make sure that the forms
| have the correct alignment or position in the printer. Answering these messages
| allows the job to start or continue printing.
The attributes included in the subset vary depending on the device type (*IPDS,
*SCS, *AFPDSLINE, *LINE, and *AFPDS).
| Printer
| Print sequence
| Form type
| Copies
| Restart printing
| Output queue
| Library
| File separators
| Page range to print:
| Starting page
| Ending page
| File becomes available
| Save file
| Output priority
| User data
| Align page
| Print quality
| Form feed
| Source drawer
| Print fidelity
| Print on both sides
| Form definition
| Library
| AFP characters
| Pages per side
| Page definition
| Library
| Front side overlay:
| Overlay
| Library
| Offset down
| Offset across
| Back side overlay:
| Overlay
| Library
| Offset down
| Offset across
| Constant back
| User defined object:
| Object
| Library
| Object type
| IPDS pass-through
| Font resolution
Example: To change the specified printer: Use option 2 from the Work with All
Spooled Files display by typing 2 next to the spooled file you want to work with.
Press the Enter key and you are returned to the Work with All Spooled Files
display.
You have now changed the specified printer for that spooled file.
The pages per side (MULTIUP), front overlay (FRONTOVL), and back overlay
(BACKOVL) attributes can only be changed if the DEVTYPE is *SCS or *IPDS.
The above attributes plus form feed (FORMFEED), print quality (PRTQLTY), and
print on both sides (DUPLEX) cannot be changed on spooled files created on the
AS/400 system with printer device type *AFPDS.
You can also use the Work with Spooled File Attributes (WRKSPLFA) command to
change the attributes of a spooled file.
Initially, the attributes assigned to a spooled file are obtained from the printer file
that the application program used.
| You cannot change all of the attributes that are shown. To view the changeable
| attributes, press F13.
| You can also change the attributes in the Using the change option section by
| pressing F13.
| Note: The attributes included in the subset vary depending on the device type
| (*IPDS, *SCS, *USERASCII, *AFPDSLINE, *LINE, and *AFPDS).
| Device requirements
When you work with spooled file attributes, the device requirements shown in the
following table are displayed. The table shows the device requirements supported
on each printer.
| ment 6262 5252 4214 5225 4234-2 5219 SCS 55531 IPDS 6412 5583 Print 4000
Final Form X X X X X X X
Text
Variable X X X X X X
Font
Variable X X X X X X X X X
LPI
Variable X X X X X X X X
Drawer
Super/ X X X X X X
Subscript
Variable X X X X X X X X X
Character
ID
Highlight X X X X X
Extended X X X X X
3812 Fonts
Graphics X X X X
522X
Graphics X X X
4214
Graphics X X X
4234
Graphics X X X X
Barcodes X X X X
Variable X X X X
Page
Rotation
PC Printer X X X X X X X X X
Emulation
Defined X X X X X X
Characters
Variable X X X X X X X X
CPI
| ment 6262 5252 4214 5225 4234-2 5219 SCS 55531 IPDS 6412 5583 Print 4000
Transparency X X X X X X
IPDS X X X X
Transparent
Data
Field X X X
Outlining
AFP X X X
Resources
Rotated X X X
DBCS
Characters
Double- X X X
wide
Characters
1
System does not check device attributes for these printers, so all attributes are permitted. This does not guarantee
the spooled file will print correctly.
Type a 9 (Work with printing status) next to the spooled file that is not printing.
The conditions that may be preventing the spooled file from printing are
displayed.
Type a 2 (Change status) next to the condition you want to eliminate. With the
information shown in the Change Status window, you can take corrective action to
make the spooled file print. All of the conditions listed must be eliminated before
the spooled file will print.
If you need more information to eliminate the conditions, select option 5 (Display
detailed description) for an explanation of each of the conditions preventing the
spooled file from printing.
Note: The specific authorities required for *DTAAUT are *READ, *ADD, and
*DLT data authorities.
v A user is always allowed to control the spooled files created by that user.
For the Copy Spooled File (CPYSPLF), Display Spooled File (DSPSPLF), and Send
Network Spooled File (SNDNETSPLF) commands, in addition to the four ways
already listed, there is an additional way a user can be authorized.
If DSPDTA(*YES) was specified when the output queue was created, any user with
*USE authority to the output queue is allowed to copy, display, send, or move
spooled files. The specific authority required is *READ data authority.
If the user is authorized to control the file by one of the four ways already listed
above, using DSPDTA(*NO) when creating the output queue will not restrict the
user from displaying, copying, or sending the file. DSPDTA authority is only
checked if the user is not otherwise authorized to the file.
See the See the Security topic in the AS/400 Information Center for details about
the authority requirements for individual commands.
The number of jobs known to the system can be displayed using the Work with
System Status (WRKSYSSTS) command.
You can use the Work with Spooled Files (WRKSPLF) command to identify
spooled files that are no longer needed. By periodically entering the command:
WRKSPLF SELECT(*ALL)
you can determine which spooled files are older than 6 or 7 days, and then delete
the spooled files or contact the users who created them.
For detailed information on minimizing the number of job logs (for example, by
using LOG(4 0 *NOLIST)), see the Control Language topic in the AS/400
Information Center. For information regarding the use of system values to control
the amount of storage associated with jobs and spooled files, see the Work
Management topic in the AS/400 Information Center.
Having some empty spooled file members available for creating new spooled files
increases system performance. However, a large number of empty spooled files can
use large amounts of storage and decrease system performance. For example, each
spooled file member may take 16k of storage.
You can determine the balance you want to maintain between spool performance
and auxiliary storage use by setting the system value Reclaim Spool Storage
(QRCLSPLSTG) to a certain number of days. The default value for QRCLSPLSTG
is 8 days.
As an alternative, you can run the Reclaim Spool Storage (RCLSPLSTG) command
with the DAYS parameter set to *NONE to immediately reclaim all empty spooled
file members.
Notes:
1. System performance is degraded if QRCLSPLSTG is run and the DAYS
parameter value is 0.
2. The database member is immediately deleted after the deletion of a spooled
file. That means that there is no pool of unused members that can be used
when creating spooled files.
Delete all the unwanted spooled files that the application program created. Note
the time of day you deleted all the unwanted spooled files.
After 24 hours, provided the empty spooled file members are not reused, the
system reclaims the auxiliary storage that was being used by the empty spooled
files.
Delete all the unwanted spooled files that the application program created.
Run the RCLSPLSTG command with the DAYS parameter set to *NONE.
The system immediately reclaims all auxiliary spool storage that was being used
by the unwanted spooled files.
All spooled files you place in this output queue will have the spooled file data
stored in the user ASP in a library QSPLxxxx where xxxx is the user ASP number.
| Note: The links to the job still reside on the system ASP. If the system ASP is lost,
| all spooled files, including those in the user ASPs, are lost. If a user ASP is
| lost, only spooled files in that user ASP are lost.
There are several ways in which the spooled file could have a different name:
v The Override with Printer File (OVRPRTF) command was used and a name was
specified in the SPLFNAME parameter. For example, typing the following
command:
OVRPRTF QSYSPRT SPLFNAME(REPORT1)
causes the spooled file to be called PRTF2 (the name of the printer file specified
in the TOFILE parameter of the OVRPRTF command).
v Some IBM applications may create spooled files that have names different from
the printer files used to create them. Users have no control over spooled file
names in this situation.
File redirection occurs when a spooled file is sent to an output device other than
the one for which it was originally intended. File redirection may involve devices
that process different media (such as printer output sent to a diskette device) or
devices that process the same type of media but are of different device types (such
as 5219 Printer output sent to a 4224 Printer).
Depending on the new output device for the spooled file, the file may be printed
just as it would have been on the originally specified device. However, differences
in devices often cause the output to be formatted differently. In these cases, the
system sends an inquiry message to the message queue of the printer writer
program to inform you of the situation and allow you to specify whether you want
printing to continue.
For more information about spooled file redirection, see “Redirecting output” on
page 112.
The original spooled file is not affected by the copy operation and can still be
printed by the printer writer program. You may want to copy a spooled file to a
database file for the following reasons:
v You may want to copy the spooled file to a physical file because there are no
commands to save spooled files on tape or diskette. However, if the system fails,
physical files are backed up and you can recover the data. You can use the spool
APIs to create your own save and restore operations for spooled files.
v You can save paper by having reports produced on microfiche instead of
printed.
v You can copy a report to a database file to be sent over communications lines for
printing at another location.
Note: If you use this method of gathering information, remember that the
system displays that you are spooling may change when new functions
are added to the system.
v You can copy the file to a spooled file so you can direct the same output to a
different output queue.
When copying spooled files to a database file, many device requirement
attributes of the spooled file cannot be copied. Most OfficeVision/400 documents
have device requirements such as variable lines per inch (LPI) and characters per
inch (CPI) that are not copied to a database file. If the database file is copied
back to the spooled file, the spooled file will not print the same as the original
file.
You can use this control code when printing with an RPG/400 program if the
page size is not more than 99 lines long. To do this, move the control characters
into the RPG/400 program’s PRTCTL data structure space before and skip before
fields and then print line.
Note: Any skip to line values of 3 or less will actually be generated as space 1
line(s) to get to the correct line. For example; skip to line 2 would
generate a space 1 line to get to line 2.
v *S36FMT: Specifies that the format of the records copied to a database file is the
same as created by $UASF on System/36 for COPYPRT. Only spooled print files
can be copied when *S36FMT is specified. You can use this option when you
plan to send the spooled file to a System/36. You should copy to a database file
that has a record length of 150, 215, or 248. These are the valid record lengths for
a System/36 file.
The first record placed in the database file for each spooled file to be copied is a
heading record. Columns that are not defined are blank.
Table 9 and 10 describe the formats of the header and data records.
Table 9. Header record format
Beginning
Column Field Length Description
1 1 The letter H (to indicate the heading record).
| 4 6 The spool ID of the entry. Valid spool IDs range from SP0000 to SP9999, and from
| A00000 to Z99999.
12 8 The procedure name. This is blank if the file was not created by a procedure.
22 8 The job name. (The last 2 characters of the name are truncated.)
32 8 The user ID of the spooled file creator. (The last 2 characters of the ID are
truncated.)
42 8 The printer device file name. (The last 2 characters of the name are truncated.)
52 2 The System/36 printer ID that corresponds to the device the file is printed on.
The printer ID shown is the ID for the System/36 operating environment that
copies the file, not the environment that created the spooled file.
56 4 The forms identification. (This is the first 4 characters of the form type of the
spooled file.)
61 2 The number of copies (in binary).
The data records placed in the disk file for each copied spooled file have the
following format:
Table 10. Data record format
Beginning
Column Field Length Description
1 2 The page number (in binary).
3 2 The line number (in binary).
5 4 The record number (in binary).
9 1 The letter I if this print record contains double-byte character set data.
10 1 A double-byte character set shift-out character (hex 0E) if this print record starts
with double-byte character set data.
11 nnn The data to be printed. (The field length is the file record length minus 10. If the
print data is longer than the field length, it is truncated; and if it is shorter than
the field length, it is padded with blanks at the end.) The format of data may not
exactly match the format that would be produced on System/36 when multiple
prints are used to construct a single print line.
The 2-byte binary numbers are unsigned, which means that a page number of 65
535 is the largest page number in a heading record or data record. When the actual
number is larger, it will wrap beyond 65 535 to 0, then 1, 2, 3, and so on.
A sample exit program (in C and RPG) is in the QUSRTOOL library. See member
TBSINFO in file QATTINFO in library QUSRTOOL for information about this
sample exit program.
Note: Using SPLFOWN parameter allows you to specify who owns the spooled
file.
| QPRTJOB jobs are created automatically by the system. There may be more than
| one QPRTJOB per user on a system. A QPRTJOB has a default value of 9999
| spooled files. That number can be expanded to the maximum of 999,999 by
| changing the number in the QMAXSPLF system value. For more information about
| the QMAXSPLF system value, see the Work Management topic in the AS/400
| Information Center. When a user’s QPRTJOB gets full, the system automatically
| creates a new one for the user. A separate QPRTJOB is created for each user that
| receives spooled files sent by the SNDNETSPLF command. If you use the
| SNDNETSPLF command to send users TINA and KEVIN spooled files, there
| would be jobs named 999999/KEVIN/QPRTJOB and 999999/TINA/QPRTJOB on
| the receiving system.
QPRTJOB jobs are created and used by a variety of system functions. For example:
v Using the SNDTCPSPLF or SNDNETSPLF commands to send a spooled file to
another user on a different AS/400 system.
v Sending a spooled file from VM or MVS through a VM/MVS bridge to an
AS/400 system.
v Receiving a spooled file using TCP/IP or the line printer daemon (LPD) process.
v Using the QSPCRTSP Spool API to create a spooled file for another user.
v Using the QWTSETP Security API to set the user profile to a different user and
then create a new spooled file.
Other applications that are running can use the QSPCRTSP and QWTSETP APIs
resulting in additional QPRTJOB jobs on the system.
| v Using the SETGID API, you can create a spooled file for a different, current, or
| group user profile when SPLFOWN is set to *CURGRPPRF.
The spooled output files are sent, from an output queue, using the Start Remote
Writer (STRRMTWTR) command. The STRRMTWTR command allows spooled
output files to be automatically sent to other systems using SNA distribution
services (SNADS) or Transmission Control Protocol/Internet Protocol (TCP/IP).
After spooled output files are successfully sent to a remote system (as best as
can be determined), they are deleted or saved, as specified by the save spooled
file attribute.
See “Send and Defer Status of Spooled Output Files” on page 174 for more detail
on the send and defer attributes of a spooled file.
An output queue is created to hold spooled output files. A remote output queue is
an output queue created for use in sending spooled output files to a remote
system. Several parameters on the CRTOUTQ command are required to do this.
When these parameters are given values, we then have a remote output queue. The
spooled output files on a remote output queue are sent by the remote writer(s)
started to the output queue. Remote writers are automatically started based on the
value specified on number of writers to autostart (AUTOSTRWTR) parameter. Or
they can be started using the STRRMTWTR command.
The STRRMTWTR command starts the writer that sends the spooled output files
on the remote output queue, to the remote system. The writer, which is a system
job, takes spooled output files from a remote output queue and sends them to a
remote system using SNADS or TCP/IP. The spooled output file can be sent to the
same user who owns the spooled output file being sent, a specific output queue, or
the output queue for the system printer on the target system. If the sending user
profile doesn’t exist on the target system, QNETSPLF user profile is used when
using SNADS.
Note: When spooled output files are sent to an AS/400 system at Version 2
Release 3 or less (or a system with the destination type of *OTHER and
using SNADS), the user profile to whom the spooled output files are being
The following parameters are important when working with remote system
printing. However, not all the parameters of the CRTOUTQ command are listed
here.
OUTQ
The qualified name of the output queue.
The name of the output queue can be qualified by one of the following library
values:
v *CURLIB
v Specific library name
The possible values are:
output queue name
The name of the output queue being created.
MAXPAGES
The maximum spooled file size in pages that is allowed to print between a
starting and ending time. If a spooled file exceeds the page limit it is deferred
(DFR status) until the ending time expires. For spooled files where the exact
number of pages is not known, the estimated number of pages (DSPSPLFA) is
used.
Notes:
1. You can specify up to 5 combinations of pages and starting and ending
times on the CRTOUTQ command.
The following table identifies the remote output queue on the target system
that receives the spooled output files depending on the value of the RMTPRTQ
parameter.
Table 11. Remote Printer Queue (RMTPRTQ) Values and Destination Type (DESTTYPE) Values
Remote Printer Queue (RMTPRTQ)
Destination Type
(DESTTYPE)1 *USER *SYSTEM Printer queue name
*OS400 File sent to user ID File sent to user ID File sent to user ID
QNETSPLF. File then QNETSPLF. File then QNETSPLF. File then
spooled to the default spooled to the output queue spooled to the output queue
output queue of the original of designated system specified by the printer
owner of the file. If the user printer (QPRTDEV). File is queue name. File is owned
profile of the original owner owned by a user profile by a user profile with the
doesn’t exist on the target with the same name as the same name as the original
system, the file is spooled original user profile owner user profile owner of the
to the default output queue of the spooled file. If this spooled file. If this user
for user profile QNETSPLF. user profile is not found, profile is not found, the
the QNETSPLF user profile QNETSPLF user profile is
is used. used.
*OS400V2 File sent to the file owners Not Allowed The printer queue name is
user ID on the target assumed to map to a user
system. File spooled to that ID on the target system.
user ID’s default output The file is sent to this user
queue. If the sending user ID and spooled to the user
ID doesn’t exist on the ID’s default output queue.
target system, an error is
returned to the source
system.
AUTOSTRWTR
The number of remote writers that are started automatically by the source
system. For user-created output queues with the remote system (RMTSYS)
parameter specified as *NONE, this parameter is ignored.
1 For system-created default printer output queues, this value is
specified as 1 when the output queue is created.
*NONE
No writers are auto-started by the system to this output queue.
number of writers
The number of writers, between 1 and 10, to be auto-started to this
output queue.
MSGQ
The qualified name of the message queue to which messages created by the
remote writer started to this output queue are sent.
The name of the message queue can be qualified by one of the following
library values:
v *LIBL
v *CURLIB
v Specific library name
Possible values are:
QSYSOPR
Messages are sent to the QSYSOPR message queue.
message queue name
The name of the message queue to which messages created by the
remote writer are sent.
CNNTYPE
The type of connection with the remote system. This parameter determines the
protocol used by the remote writer when sending spooled files. Possible values
are:
*SNA Spooled files are sent using SNADS. This is similar to the Send
Network Spooled File (SNDNETSPLF) command and requires that
SNADS be configured.
DESTTYPE
The type of the remote system (RMTSYS) parameter. This parameter, along
with the type of data contained in the spooled file (DEVTYPE parameter on
the CRTPRTF command), is used by a remote writer to determine the format
used to send the spooled file.
The spooled file is held by the remote writer if the type of data in the spooled
file is not supported by the system. Possible values are:
*OS400
When the connection type (CNNTYPE) has been specified as *SNA,
spooled files are to be sent to an AS/400 system running OS/400
version 3 or later. *OS400 can be specified for all releases which
support the SNDTCPSPLF command (version 2 release 3 and later)
when CNNTYPE is *IP or *USRDFN.
Note: This parameter is valid only when the CNNTYPE parameter is *IP, *IPX,
or *USRDFN.
Note: The user data transform program is only valid when the remote system
value is not *NONE. This parameter is not valid when
TRANSFORM(*YES) is specified.
MFRTYPMDL
The manufacturer, type, and model for a printer using the host print transform
function.
This parameter is only valid when TRANSFORM(*YES) or a user data
transform program is specified. The possible values are:
*IBM42011
The IBM 4201-1 Proprinter* is used.
*WSCST
The value of the WSCST parameter is used.
manufacturer-type-model
The manufacturer, type, and model for a printer using the host print
transform function.
Note: Prompting (F4) for this parameter shows many printers that can
be used as a value for this parameter.
WSCST
An object that consists of a table of attributes used to customize a given ASCII
device, such as a workstation or printer. Character presentation, font
specifications, and control key sequences are examples of characteristics that
can be customized.
This parameter is only valid when TRANSFORM(*YES) or a user data
transform program is specified. Possible values are:
*NONE
Do not specify a workstation customizing object.
The name of the workstation customizing object can be qualified by
one of the following library values:
v *LIBL
v *CURLIB
v Specific library name
workstation-customizing-object
A valid workstation customizing object which has been created with
the Create Work Station Customizing Object (CRTWSCST) command.
Note: The user driver program is only valid when the remote
system value is not *NONE.
More than one writer can be active at the same time (as determined by the
spooling subsystem description). Up to 10 writers can be active to the same output
queue. Each writer must have a unique writer name, and only one type (printer,
remote, or diskette) of writer can be active to a single output queue. A writer that
is started can be actively sending spooled files or waiting for a spooled file to be
put on the output queue. Optionally, the writer can end automatically when it has
processed all the spooled files on the output queue. You can also change, hold, or
cancel the writer.
The following table shows the data format of the spooled file that is sent to the
destination system when the connection type is *SNA.
Table 13. Connection Type (CNNTYPE) *SNA
Data Format
Destination Type (CNNTYPE) *ALLDATA *RCDDTA
*OS/400 All device type
*OS/400 V2 All device type
*OTHER (OS/400 V1, S/36, S/38) All device type
*S390 *LINE, *AFPDSLINE, *AFPDS *USRASCII, *IPDS, *SCS
Note: All device type includes *LINE, *AFPDSLINE, *AFPDS, *USRASCII, *IPDS,
and *SCS.
You can continue with other work after starting a writer because each job runs
independently. The writer is owned by the user who issues the STRRMTWTR
command. The following are the parameters and values for the STRRMTWTR
command:
OUTQ
The qualified name of the output queue. Possible values are:
*ALL Remote writers are started for every output queue on the system
which has a remote system (RMTSYS parameter value) specified.
The number of writers started to a particular output queue is
determined by the value specified on the AUTOSTRWTR parameter of
the CRTOUTQ command.
No writer is started if an output queue already has the number of
writers to autostart started or a different type of writer (diskette or
printer) is started to the output queue.
The name of the output queue can be qualified by one of the following
library values:
v *LIBL
v *CURLIB
v Specific library name
Note: A spooled file’s form type is specified in the device file that produced
the spooled file.
This is important because the output queue can contain spooled files with
many different form types. Only the spooled files with the specified form type
are sent; others wait on the output queue.
Note: The message sending options are most effective when the source system
is able to send the spooled files directly to a printer queue on the target
system.
*NOMSG
Neither an inquiry message nor an informational message is sent to the
message queue.
*INQMSG
An inquiry message is sent to the message queue when a spooled file
has a form type that is different than the form type last sent.
User print information is not used when sending spooled output files to another
AS/400 or S/3X system. It is used only as information to pass to the VM/MVS
bridge customer user exit to aid in setting the Network Job Entry (NJE) header
fields.
It’s possible for a system administrator to limit users access by revoking public
authority to the particular commands.
User print information can be used any way you want. For example, it could
consist of printout distribution information or be used for accounting information
(department to charge for printing).
User print information is worked with using the Change User Print Information
(CHGUSRPRTI), Display User Print Information (DSPUSRPRTI), and Retrieve User
Print Information (RTVUSRPRTI) commands.
For example, running the following command modifies (or creates if it doesn’t
exist) the user print information for user LAWSON.
CHGUSRPRTI USER(LAWSON) TEXT('DEPT. 269 P.O. BOX 123')
The command acts on the user print information for the user LAWSON. The user
information is changed (or created) to DEPT. 269 P.O.Box 123.
Note: DSPUSRPRTI uses the QPDSPUSRPI printer file when OUTPUT is specified
as *PRINT.
The coded character set identifier (CCSID) is used when the text description prints
on the output.
Of particular interest to remote system printing are the status’ of SND and DFR.
Note: DFR status is not unique to spooled output files on a remote output queue.
Spooled output files on non-remote output queues can also have a status of
DFR.
v SND
When a spooled output file is being sent to a remote system, it has a status of
SND. If the connection type is *SNA, the spooled output file may remain in SND
status until a confirmation message from the remote system is received by the
remote writer. At this time the spooled output file is deleted or saved,
depending on the save spooled file attribute. If the writer is ended while
spooled output files are in SND status, the spooled files are changed back to
RDY status.
v DFR
When a writer (printer or remote) is started to an output queue, it determines
the maximum spooled file size for the current time. Any RDY spooled files
which exceed the limit are changed to DFR status. If the spooled file exceeds the
current limit and is added to the output queue (created or moved) after a writer
is started to the output queue, the spooled output file status will be DFR.
When the system time-of-day changes such that a new maximum spooled
output file size is to take affect, the writer goes through the output queue again
and updates RDY spooled files to DFR, or DFR to RDY, depending on the new
limit and the size of the particular spooled output file. When the writer is
ended, all DFR spooled output files return to RDY.
When time ranges for the maximum spooled output file size overlap, the smaller
of the number of pages values is used. For example, assume that there were two
time ranges of 8:00:00 to 16:00:00 and 12:00:00 to 12:30:00, with number of pages
40 and 10 respectively. The largest spooled output file that would print from 8:00
am to 12:00 pm would be 40 pages. The largest spooled output file that would
print from 12:00 pm to 12:30 pm would be 10 pages. The largest spooled output
file that would print from 12:30 pm to 4:00 pm would be 40 pages.
Opt File User User Data Sts Pages Copies Form Type Pty
_ DMB18R1 LAWSON SND 1 1 *STD 5
8 STUMPF LAWSON RDY
_ DMB18R2 LAWSON TEST DFR 1 1 *STD 5
Bottom
Parameters for options 1, 2, 3 or command
===> _________________________________________________________________________
F3=Exit F11=View 2 F12=Cancel F20=Writers F22=Printers
F24=More keys
You can also display a spooled output file’s attributes by using the Work with
Spooled Files (WRKSPLF) command and selecting option 8.
Preparation work must be done on both the source system and target system for
the remote system printing to work. Table 14 provides a list of things that must be
present or created before remote system printing can be used.
Table 14. Source System and Target System Preparation for Remote System Printing
AS/400 Source System at V3R1 or later AS/400 Target System at V3R1 or later
| Line, controller, and device descriptions created Line, controller, and device descriptions created
| Additional information for these configuration Additional information for these configuration
| descriptions can be obtained in the Communications descriptions can be obtained in the Communications
| Configuration PDF manual. Configuration PDF manual.
Type CRTOUTQ and prompt (F4). The following screen appears. Type in the
values shown and press the Enter key. The remote output queue RMTOUTQ is
created. The other parameter values are needed to ensure connection and delivery
to the designated system.
Create Output Queue (CRTOUTQ)
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
To begin sending spooled output files from the RMTOUTQ remote output queue,
run the Start Remote Writer (STRRMTWTR) command. Type STRRMTWTR and
prompt (F4).
The following screen appears. Type in the values for the parameters displayed and
press the Enter key. Spooled output files are then sent to the OUTQRMT on the
target system (SYSNMDLC).
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
Type in the name of the printer (CHEROKEE2) you want to use and the name of
the output queue with the received spooled output files (OUTQRMT). Press the
Enter key and spooled output files will begin to print on the printer named
CHEROKEE2.
Start Printer Writer (STRPRTWTR)
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
Multiple printer writers can be started to same output queue. This allows the
spooled output files from a particular output queue to be printed on more than
To see the number of writers started to the OUTQRMT output queue, run the
WRKOUTQ *ALL command. The Work with All output queues screen appears.
Type option 9 next to the OUTQRMT output queue and press the Enter key. The
Work with All Writers display appears. If the output queue has more than one
writer started to it, the writers are listed and they both are associated with the
same output queue (OUTQRMT).
Work with All output queues
Bottom
Parameters for options 2, 3, 4, 6 or command
===>
F3=Exit F4=Prompt F12=Cancel F22=Start printer writer F24=More keys
You can list the names of writers started to the OUTQRMT output queue by typing
WRKOUTQ OUTQRMT and prompting (F4). The Work with Output Queue
display appears. Press F20=Writers key and the Work with All Writers display
appears with a list of all writers that are started to the OUTQRMT output queue.
This sequence is shown in the following two displays:
Opt File User User Data Sts Pages Copies Form Type Pty
DMB18R2 XZZ0136 *BEFORE HLD 4 1 ENTN 5
QPRINT STUMPF SAV 2 1 *STD 5
Bottom
Parameters for options 1, 2, 3 or command
===>
F3=Exit F11=View 2 F12=Cancel F20=Writers F22=Printers
F24=More keys
Bottom
Parameters for options 2, 3, 4, 6 or command
===>
F3=Exit F4=Prompt F12=Cancel F22=Start printer writer F24=More keys
Note: The user ID of the target system is OUTQRMT. This user ID is associated
with a user profile, also named OUTQRMT. The default output queue for
user profile OUTQRMT is named OUTQRMT. This output queue
(OUTQRMT) is the destination of the spooled files sent from the source
Preparation work must be done on both the source system and target system for
remote system printing to work. Table 15 provides a list of things that must be
present or created before remote system printing can be used.
Table 15. Source System and Target System Preparation for Remote System Printing
AS/400 Source System at V3R1 or later AS/400 Target System at V2R3
| Line, controller, and device descriptions created Line, controller, and device descriptions created
| Additional information for these configuration Additional information for these configuration
| descriptions can be obtained in the Communications descriptions can be obtained in the Communications
| Configuration PDF manual. Configuration PDF manual.
Create a remote output queue for remote system Create an output queue named OUTQRMT to receive the
printing. Use the Create Output Queue (CRTOUTQ) spooled files. This matches the name on the RMTPRTQ
command. parameter (OUTQRMT).
Note: When a remote output queue is created, writers are automatically started to
it if the AUTOSTRWTR parameter value is not *NONE.
Type CRTOUTQ and prompt (F4). The following screen appears. Type in the
values shown and press the Enter key. The remote output queue RMTOUTQ is
created. The other parameter values are needed to ensure connection and delivery
to the designated system.
Create Output Queue (CRTOUTQ)
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
To begin sending spooled output files from the RMTOUTQ remote output queue,
run the Start Remote Writer (STRRMTWTR) command by typing STRRMTWTR
and prompting (F4).
The following screen appears. Type in RMTOUTQ and press the the Enter key.
Spooled output files are then sent to the OUTQRMT output queue on the target
system (SYSNMDLC).
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
Type in the name of the printer (PRT01) you want to use and the name of the
output queue with the received spooled output files (OUTQRMT). Press the Enter
key and spooled output files will begin to print on the printer device named
CHEROKEE2.
Start Printer Writer (STRPRTWTR)
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
Preparation work must be done on both the source system and target system for
remote system printing to work. Table 16 provides a list of things that must be
present or created before remote system printing can be used.
Table 16. Source System and Target System Preparation for Remote System Printing
AS/400 Source System at V3R1 or later VM/MVS Target System
| Ensure Licensed Program 5769-CM1 is installed. This is NJE configuration for VM/RSCS and JES2 or JES3 for
| needed for communications. For more details about MVS.
| configuring SNADS connections between these systems
| see the SNA Distribution Services PDF. Contact with the host system will be critical to
establishing the correct connection with VM/MVS.
System node name, printer ID, and user ID are some of
the information the AS/400 will require.
Line, controller, and device descriptions created Communication descriptions must exist or be created to
connect the VM/MVS system to the AS/400 system.
| Additional information for these configuration Typically this would be a line, physical unit (similar to
| descriptions can be obtained in the Communications controller), and a logical unit (similar to device). The VM
| Configuration PDF manual. or MVS system configuration will require information
from the AS/400 system.
Identify the user profile to be used for remote system This user must also exist on the target system if *USER is
printing. specified on the RMTPRTQ parameter on the AS/400
system.
Note: When a remote output queue is created, writers are automatically started to
it if the AUTOSTRWTR parameter value is other than *NONE.
Type CRTOUTQ and prompt (F4). The following screen appears. Type in the
values shown and press the Enter key. The remote output queue TEST1 is created.
The other parameter values are needed to ensure connection and delivery to the
designated system.
Create Output Queue (CRTOUTQ)
To begin sending spooled output files from the RMTOUTQ remote output queue,
run the Start Remote Writer (STRRMTWTR) command by typing STRRMTWTR
and prompting (F4).
The following screen appears. Type in RMTOUTQ and press the Enter key. Spooled
output files are then sent to the printer designated as the system printer on the
target system (VM3).
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
Preparing AS/400 V3R1 or later to PS/2 with PSF for OS/2 for Remote
System Printing
The diagram below illustrates AS/400-to-PS/2 remote system printing with
TCP/IP. The AS/400 source system is at Version 3 Release 1 or later. The PS/2
must have OS/2 2.0 or later installed.
Preparation work must be done on both the source system and target system for
remote system printing to work. Table 17 provides a list of things that must be
present or created before remote system printing can be used.
Table 17. Source System and Target System Preparation for Remote System Printing
AS/400 Source System at V3R1 or later PS/2 Target System
| Ensure Licensed Program 5769-TC1 for TCP/IP is Ensure IBM TCP/IP 2.0 for OS/2 is installed and
| installed. This is needed for communications. For more configured on the PS/2. See IBM Transmission Control
| details about configuring connections between systems Protocol/Internet Protocol Version 2.0 for OS/2 G544-3767 for
| see the Configuration and Reference PDF. installation and configuration help.
Line, controller, and device descriptions created. Configure the PS/2 for TCP/IP. See the manual IBM
Transmission Control Protocol/Internet Protocol Version 2.0
Additional information for these configuration for OS/2: Installation and Administration SC31-6075 for
descriptions can be obtained in the Communications configuration help.
Configuration PDF manual.
Some of the configuration values use remote output
queue description. They are: system name and Internet
address.
Create a remote output queue for remote system Ensure Line Printer Daemon (LPD) is running on the
printing. Use the Create Output Queue (CRTOUTQ) PS/2. Use the Start LPD command. See the manual IBM
command. Transmission Control Protocol/Internet Protocol Version 2.0
Identify the printer queue name for the target PS/2 for OS/2 SX75-0070 for help.
(ANNSPRIN).
Identify the internet address for the target PS/2
(9.5.50.48), or identify the system name for the target
PS/2 (ERIC). Either of these values can be used.
Note: When a remote output queue is created, writers are automatically started to
it if the AUTOSTRWTR parameter value is other than *NONE.
Type CRTOUTQ and prompt (F4). The following screen appears. Type in the
values shown and press the Enter key. The remote output queue RMTOUTQ is
created. The other parameter values are needed to ensure connection and delivery
to the designated system.
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
To begin sending spooled output files from the RMTOUTQ remote output queue,
run the Start Remote Writer (STRRMTWTR) command. Type STRRMTWTR and
prompt (F4).
The following screen appears. Type in the values for the parameters displayed and
press the Enter key. Spooled output files are then sent to the remote printer queue
named ANNSPRIN on the PS/2 system named ERIC.
Start Remote Writer (STRRMTWTR)
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
Note: The remote system (RMTSYS) parameter value can be the NetWare server
name for *NETWARE3 or the tree name for *NDS. Partial *NDS names are
allowed for the RMTPRTQ value when the *NDS value is used. If the fully
qualified *NDS name is not given, you can look for the NetWare context that
specifies the queue by using the command CHGNWSA OPTION(*NETWARE).
Preparation work must be done on both the source system and target system for
remote system printing to work. Table 18 provides a list of things that must be
present or created before remote system printing can be used.
Table 18. Source System and Target System Preparation for Remote System Printing
AS/400 Source System at V3R7 or later NetWare Target Server
Ensure the Licensed Program NetWare Integration Ensure the NetWare Loadable Module (NLM) from the
(5769-SA3) is installed. NetWare Enhanced Integration has been installed on the
NetWare Server that owns the volume used by the
NetWare printer queue.
| Configure and start Internetwork packet exchange (IPX) Load the NetWare Enhanced Integration NLM. The file
| support on the AS/400. For IPX configuration to be loaded is AS4NW410.NLM for NetWare 4.10 or
| information see the Internet Packet Exchange PDF. AS4NW312.NLM for NetWare 3.12 servers.
Note: When a remote output queue is created, writers are automatically started to
it if the AUTOSTRWTR parameter value is other than *NONE.
Type CRTOUTQ and prompt (F4). The following screen appears. Type in the
values shown and press the Enter key. The remote output queue RMTOUTQ is
created. The other parameter values are needed to ensure connection and delivery
to the designated system.
Create Output Queue (CRTOUTQ)
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
To begin sending spooled output files from the RMTOUTQ remote output queue,
run the Start Remote Writer (STRRMTWTR) command. Type STRRMTWTR and
prompt (F4).
The following screen appears. Type in the values for the parameters displayed and
press the Enter key. Spooled output files are then sent to the remote printer queue
named NWQUEUE or NDSQUEUE on the NetWare network. .
Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel
F13=How to use this display F24=More keys
The network print server provides client access to AS/400 system print objects and
resources. Following are the network print server objects and the actions that can
be requested to be performed on these objects:
Objects
Actions
Spooled file
Create, seek, open, read, write, close, hold, release, delete, move, send, call
exit program, change attributes, retrieve message, answer message, retrieve
attributes, and list.
Writer job
Start, end, and list
Printer device
Retrieve attributes and list
Output queue
Hold, release, purge, list, and retrieve attributes
Library
List
Printer file
Retrieve attributes, change attributes, and list
Network print server
Change attributes and retrieve attributes.
After a communications session has been established, the client can start the
network print server by sending a special record, called a Program Start Request
(PSR), to the AS/400 system. The communications session you use can utilize
different protocols. Refer to the appropriate manual for that communications type
for information on using program start requests (PSRs).
After the network print server program has been started using a PSR, a
communications transaction has been started. A communications transaction is a
logical connection between two programs on a communications session. After this
communications transaction starts, data can be exchanged between the client and
the network print server.
The program name contained in the PSR from the client must be defined in the
prestart job entry. This is how the PSR attaches itself to a prestart job and therefore
achieves better performance.
The network print server has prestart jobs defined in the QBASE and QCMN
subsystems. The number of prestart jobs that automatically start to support the
network print server is small and thus saves system resources.
Note: The network print server never rejects a PSR. All PSRs are handled, or
they are queued and use the next available prestart job.
Following is an example of a prestart job entry in the QBASE subsystem for the
network print server.
If the PSRs were not being acted upon fast enough you could:
v Increase the Initial number of jobs (INLJOBS) parameter value.
v Increase the Additional number of jobs (ADLJOBS) parameter value.
Then, when the Threshold (THRESHOLD) parameter value is reached, the
additional number of jobs are prestarted.
The key is to match the number of prestart jobs to the number of PSRs that are
being sent. Keeping this association as close to 1-to-1 ensures peak system
performance.
Additional prestart jobs can be started if the number of program start requests to
the network print server exceed the number of available prestart jobs.
Table 19 contains the IBM-registered exit points that can be used with the network
print server.
Table 19. Network Print Server Registered Exit Points
Type of Support Exit Point Name Exit Point Format
Entry QIBM_QNPS_ENTRY ENTR0100
Spooled file QIBM_QNPS_SPLF SPLF0100
Exit programs must be registered with the AS/400 system Registration Facility.
Registration allows all users to associate exit programs with the exit points.
The network print server exit points are already registered with the AS/400
Registration Facility. To use these exit points, you have to register your exit
programs with the AS/400 Registration Facility.
Exit programs are registered and de-registered using the following APIs:
v Add Exit Program (QUSADDEP) API
Adds an exit program entry for a specific exit point.
Note: The network print server exit points do not define exit program data.
When you register your exit program you can provide exit program data.
However, the data is not used by the network print server.
v Remove Exit Program (QUSRMVEP) API
Removes an exit program entry for a specific exit point.
For information and examples on how to register exit programs and exit points,
see the API Reference topic in the online Information Center.
Required Parameters:
Offset
Dec Hex Type Field
0 0 CHAR(1) Return code
Server information
INPUT; CHAR(32) The server information structure contains the user profile
name, server identifier, format name, and server function identifier.
Offset
Dec Hex Type Field
0 0 CHAR(10) User profile name
10 A CHAR(10) Server identifier
20 14 CHAR(8) Format name
28 1C BINARY(4) Function identifier
Required Parameters:
Offset
Dec Hex Type Field
0 0 CHAR(1) Return code
Offset
Dec Hex Type Field
0 0 CHAR(10) User profile name
10 A CHAR(10) Server identifier
20 14 CHAR(8) Format name
28 1C BINARY(4) Function identifier
Spooled file ID
INPUT; CHAR(40) The spooled file ID structure contains the job name, user
name, job number, spooled file name, and spooled file number. This
information uniquely identifies a spooled file on the AS/400 system.
Offset
Dec Hex Type Field
0 0 CHAR(10) Job name
10 A CHAR(10) User name
20 14 CHAR(6) Job number
26 1A CHAR(10) Spooled file name
36 24 BINARY(4) Spooled file number
Offset
Dec Hex Type Field
0 0 BINARY(4) Length of the
spooled file exit
program data
4 4 CHAR(*) Spooled file exit
program data
Function identifier. Identifies, within a server, the function of the exit point. For the network print server, two
function identifiers are supported:
v For spooled file support, the value is hexadecimal 010D.
v For entry support, the value is hexadecimal 0802.
Job name. The name of the job that created the spooled file.
Job number. The number of the job that created the spooled file.
Server identifier. Identifies the OS/400 server being called. The value for the network print server is QNPSERVR.
Spooled file exit program data. Spooled file exit program data consists of additional information used by the exit
program that has registered for exit point QIBM_QNPS_SPLF. The client application provides the spooled file exit
program data.
Spooled file name. The name of the spooled file being requested.
Spooled file number. The number of the spooled file being requested.
User profile name. The user, from Client Access Express, that is making the call to the network print server.
To use advanced function printing (AFP) support on the AS/400 system, the
PSF/400 must be installed. However, if the ASCII data stream is converted
through Host Print Transform function, you can use the AFP support
without having to install the PSF/400.
See “Using Print Services Facility for OS/400 (PSF/400)” on page x for
information on when PSF/400 is required. If you have additional questions
about PSF/400, contact your IBM representative.