For program-described printer files, you can also specify the print control information in the data itself. You can do this by including an American National Standard first-character forms-control code in position 1 of each data record in the printer file. (You cannot use first-character forms control and DDS on the same file.)
For information about the machine data, see Machine Code Carriage Control Characters in the Advanced Function Presentation topic collection.
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:
Control code | Action before printing a line |
---|---|
' ' | Space one line (blank code) |
0 | Space two lines |
- | Space three lines |
+ | Suppress space |
1 | Skip to channel 12 |
2 | Skip to channel 12 |
3 | Skip to channel 12 |
4 | Skip to channel 12 |
5 | Skip to channel 12 |
6 | Skip to channel 12 |
7 | Skip to channel 12 |
8 | Skip to channel 12 |
9 | Skip to channel 12 |
A | Skip to channel 12 |
B | Skip to channel 12 |
C | Skip to channel 12 |
Any other character in position 1 of a record defaults to a blank (the American National Standard code for spacing one line). If this occurs, the notify message CPF4916 is sent to the high-level language program once per file.
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.
To create a program-described printer file that uses first-character forms-control data, specify the CTLCHAR parameter and, optionally, the CHLVAL parameter on the Create Printer File (CRTPRTF) command. CTLCHAR(*FCFC) specifies that the first character in every record is an American National Standard forms-control code.
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.
There is one exception to this method of printer advancement.
If the printer is positioned at the top of the page (line 1) and the channel value forms-control value is line 1, the printer does not advance to a new 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.
In the following example, a file, PRTFCFC, that uses first-character forms-control data is created:
CRTPRTF FILE(QGPL/PRTFCFC) OUTQ(PRINT) CTLCHAR(*FCFC) + CHLVAL((1 1) (2 10) (12 60))
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.