IBM Support

List of FCFC Controls and Their Meanings

Troubleshooting


Problem

This document answers a question about the First Character Forms Control (FCFC) codes used by the CPYSPLF command when the CTLCHAR parameter is set to *FCFC.

Resolving The Problem

The Copy Spooled File (CPYSPLF) command can used with the Control character (CTLCHAR) parameter set to *FCFC to copy a spooled file to a data base file and preserve the line and page breaks using First Character Forms Control (FCFC). The Copy File (CPYF) command can be used to create a spooled file from the records in the data base file. However, what do the FCFC codes mean?

This document was last updated on 14 November 2012.

First Character Forms Control (FCFC)

The First Character Forms Control (FCFC) codes are required so a program can be written to interpret and/or modify the FCFC data. When the Copy Spooled File (CPYSPLF) command is used with the Control character (CTLCHAR) parameter set to *FCFC, the contents of the spooled file is copied to a data base file with the American National Standard first-character forms-control code in position 1 of each data record.

Rochester Support Center knowledgebase document N1010238 discusses how to copy a spooled file with CTLCHAR(*FCFC) and how to copy the data base file back to a printer file; however, it does not discuss what the FCFC codes mean. However, the FCFC codes and their meanings are discussed in section 2.1.9 Special Printer File Considerations in the OS/400 Printer Device Programming manual, SC41-5713-03. The FCFC codes listed are:

' 'Space one (1) line (blank code)
0Space two (2) lines
-Space three (3) lines
+Suppress space (print on top of the previous line)
1Skip to channel 1 (Form Feed or New Page)
2Skip to channel 2
3Skip to channel 3
4Skip to channel 4
5Skip to channel 5
6Skip to channel 6
7Skip to channel 7
8Skip to channel 8
9Skip to channel 9
ASkip to channel 10
BSkip to channel 11
CSkip to channel 12
Note: FCFC controls 2 through C (Skip to channel 2 through 12) are rarely used in OS/400 spooled files.

Specifying the Channel Values (CHLVAL) Parameter in a Printer File

The Channel values (CHLVAL) parameter in a printer file can be used to specify a "skip to" line number for channels 2 through 12, which correspond to FCFC codes 2 through 9, A, B, and C.

When the Channel values (CHLVAL) parameter is set to the default value of *NORMAL, FCFC codes 2 through 9, A, and B will all result in space a single line down the page and FCFC code C will result in a skip to the line number specified in the Overflow line number (OVRFLW) parameter.

However, the Channel values (CHLVAL) parameter can be used to associate the channel number with a page line number. Valid line numbers range from 1 through 255. If no line number is assigned to a channel number and that channel number is encountered in the data, a default of 'space one line' before printing is used.

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.

Multiple channels values can be specified, allowing a spooled file to use different channel values to position to different lines in a report, Purchase Order (PO), invoice and so on. This can be done when creating a printer file using the Create Printer File (CRTPRTF) command, for example:

CRTPRTF FILE(QGPL/INVOICE) DEV(PRT01) DEVTYPE(*SCS) PAGESIZE(66 132)
        LPI(6) CPI(10) OVRFLW(60) CTLCHAR(*FCFC)
        CHLVAL((2 (7)) (3 (10)) (4 (15)) (5 (54))) FONT(*CPI)
        PAGRTT(*AUTO) HOLD(*YES) SAVE(*YES)

by changing an existing printer file using the Change Printer File (CHGPRTF) command, for example:

CHGPRTF FILE(QGPL/INVOICE) CTLCHAR(*FCFC)
        CHLVAL((2 (7)) (3 (10)) (4 (15)) (5 (54)))

or by overriding an existing printer file in a CL program using the Override with Printer File (OVRPRTF) command, for example:

OVRPRTF FILE(INVOICE) CTLCHAR(*FCFC)
        CHLVAL((2 (7)) (3 (10)) (4 (15)) (5 (54))) FONT(*CPI)
        HOLD(*YES) SAVE(*YES) OVRSCOPE(*JOB)


For More Information

Refer to the following Rochester Support Center knowledgebase document:

N1010238: Using CPYSPLF to Re-Create a Spooled File or Create a PC File

OS/400 Printer Device Programming manual, SC41-5713-03, HTML format:

http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/QB3AUJ03/CCONTENTS?SHELF=QB3AYC08&DN=SC41-5713-03&DT=19990301100126

PDF format:

http://publib.boulder.ibm.com/pubs/pdfs/as400/V4R4PDF/QB3AUJ03.PDF

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

Historical Number

26632040

Document Information

Modified date:
18 December 2019

UID

nas8N1019389