This record- or field-level keyword specifies the horizontal printing density for the record format or field that you are defining.
CPI (10 | 15)
10 or 15 specifies the number of characters per inch.
This keyword is valid only for the 5224 and 5225 SCS printers. If you do not specify CPI, the density is set by the CPI parameter on the Create Printer File (CRTPRTF), Change Printer File (CHGPRTF), or Override with Printer File (OVRPRTF) command.
If you specify CPI at the record level, all fields in the record format are at the same density except those for which you specify CPI at the field level.
If you specify CPI at the field level, you can specify different densities for fields printed on the same line. The position you specify for each field (in positions 42 through 44) is based on the value of the CPI parameter on the CRTPRTF, CHGPRTF, or OVRPRTF command (see the following examples).
When you specify CPI at the field level, overlapping fields are not diagnosed.
A warning message results at creation time if you specify CPI in a file created with DEVTYPE(*IPDS) or DEVTYPE(*AFPDS). To change the CPI, you must specify the FONT keyword.
You cannot specify CPI on the same record format as the DRAWER keyword.
Option indicators are valid for this keyword.
The following examples show how to specify the CPI keyword for a record format.
Example 1:
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A R RECORD1 00020A 02 CPI(15) 00030A FLD1 20 3 1 00040A FLD2 5 0 +2 00050A R RECORD2 SPACEB(1) 00060A FLD3 1 A
In this example, if option indicator 02 is set to on, both FLD1 and FLD2 in RECORD1 are printed at 15 characters per inch. If option indicator 02 is set to off, FLD1 and FLD2 are printed at the density specified for the CPI parameter on the CRTPRTF, CHGPRTF, or OVRPRTF command.
The printer spaces one line before printing RECORD2. FLD3 in RECORD2 is printed at the density specified for the CPI parameter on the CRTPRTF, CHGPRTF, or OVRPRTF command.
Example 2:
The following example shows what happens when a field at 15 CPI is printed between fields printed at 10 CPI.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A R RCDA SPACEA(1) 00020A FLD1 10 1 00030A FLD2 10 11CPI(15)1 00040A FLD3 10 21 A
11111111112222222222 3333333333
length specified X file density = printed length density for the field
10 X 10 = 10 X 2 = 6.67 (rounded up to 7) 15 3
7 + 11 = 18
R RCDA SPACEA(1) FLD1 10 1 FLD2 10 11CPI(15) FLD3 10 18
11111111112222222222 3333333333
Example 3:
The following example shows what happens when a field at 10 CPI is printed between fields printed at 15 CPI.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A R RCDB SPACEA(1) 00020A FLD4 10 1 00030A FLD5 10 11CPI(10) 1 00040A FLD6 10 21 A
2(specified position - 1) + 1 = printed position (truncated if fractional) 3
2(11-1) + 1 = 7.67 (truncated to 7) 3
44444444445555556666666666666
To avoid the overprinting, specify FLD5 one more position to the right (position 12).
length specified X density for the file = printed length density for the field
10 X 15 = 15 (rounded up if necessary) 10
15 + 12 = 27
R RCDB SPACEA(1) FLD4 10 1 FLD5 10 12CPI(10) FLD6 10 27
4444444444 5555555555 6666666666
Example 4:
The following example shows the effect of the CPI keyword on how the system truncates or folds fields at the right side of the printer form. This depends on the values of the FOLD and PAGESIZE parameters on the CRTPRTF, CHGPRTF, or OVRPRTF commands.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A R RCDC SPACEA(1) 00020A FLD7 10 140 00030A FLD8 10 150CPI(10) A
length specified X density for the file = printed length density for the field
10 X 15 = 15 (truncated to next lower integer if necessary) 10
2(specified length of the field - 1) + 1 = adjustment 3 (truncated if fractional)