CPA4002: Verify alignment on printer
CPA4002 (Verify alignment on printer) is an inquiry IBM i sends before printing on continuous forms, asking the operator to check that the paper is lined up. The printer writer waits until someone replies.
Other names for this code
Also written as CPA4002 error, CPA4002 verify alignment, verify alignment on printer, CPA4002 reply list, CPA4002 QSYSOPR, MSGID CPA4002.
What it means
Printers that feed continuous forms, such as label stock or pre-printed invoices, need the paper lined up with the print position. IBM i can stop and ask the operator to check that. The question is CPA4002, sent by the printer writer to its message queue, and the writer waits for an answer before it prints.
IBM's support document says the message appears only for writers whose printer device description has FORMFEED set to *CONT or *CONT2. It is sent the first time the writer starts. It is sent again when the next spooled file has a different page length from the one before it. IBM works out page length from the printer file's page size and lines per inch, so 66 lines at 6 lines per inch is 11 inches.
Nothing is broken when CPA4002 appears. It is a planned stop. It becomes a problem when nobody answers it, because every spooled file behind it waits too.
Common causes
- The printer writer was started on a continuous-forms printer, so it asks for alignment before its first spooled file.
- The next spooled file has a different page length from the last one, for example a 6-inch label after an 11-inch report.
- The printer device was re-created, renamed or moved to a new controller, so reply list entries that match on the old device name no longer answer the message.
- Printer files or the writer ask for alignment through their own settings, so the operator is asked even when the forms haven't changed.
How to find the problem
- Run
WRKWTR. A writer in MSGW status is waiting for a reply. Option 7 shows the message. - Look in the writer's message queue, usually QSYSOPR or the queue named on the writer, with
DSPMSG. - Check the device with
DSPDEVDand look at the form feed setting. CPA4002 only appears for*CONTand*CONT2. - List reply list entries with
WRKRPYLEand check whether one exists for CPA4002 and whether its compare data still matches the device name.
How to fix it
- Line up the paper and reply I to print with the current alignment. IBM also describes G, to go on with the new page length, and C, to cancel the writer.
- Answer it automatically with the system reply list. IBM's example is
ADDRPYLE SEQNBR(200) MSGID(CPA4002) CMPDTA(PRT01 21) RPY(I), which matches the device name starting at position 21 of the message data.CMPDTA(PRT 21)covers every printer whose name starts with PRT. - Make sure the writer jobs use the reply list. IBM names job descriptions QSPLPRTW, QSPLAFPW and QSPLRMTW, which need
INQMSGRPY(*SYSRPYL). Check them withWRKJOBD. - Update reply list entries when you rename or re-create a printer device, and check the compare data position after a release upgrade, since IBM warns the offset can change.
- Look at the
ALIGNsettings on the printer files and onSTRPRTWTRif the message appears more often than the forms really change.
What it looks like
Verify alignment on printer PRT01.
IBM documentation
IBM Display Message Descriptions (DSPMSGD). Use the documentation for your installed release.
This link opens the relevant IBM reference library or lookup instructions. Match the complete code and your installed product release; it is not a code-specific review.
Read the installed message description:
DSPMSGD MSGID(CPA4002) MSGF(QSYS/QCPFMSG)
Also inspect the full job log and second-level message text, including substitution values.
Related codes
Questions
Why does CPA4002 appear before every label?
Usually the page length changes between spooled files, or a reply list entry no longer matches the device name. On midrange.com, one shop saw this after moving a label printer to a new controller.
Can I answer CPA4002 automatically?
Yes. Add a system reply list entry for CPA4002 with reply I, matched on the printer name, and make sure the writer's job description uses the system reply list.
Why don't laser printers ask for alignment?
IBM says the message only appears for printer devices set to continuous forms, FORMFEED *CONT or *CONT2. Cut-sheet printers don't get it.