CPI (Characters Per Inch) Keyword in Printer Files--Examples

Figure 309 shows how to specify the CPI keyword for a record format.

Figure 309. Specifying the CPI Keyword (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 Figure 309, 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.

Figure 310 shows what happens when a field at 15 CPI is printed between fields printed at 10 CPI.

Figure 310. Specifying the CPI Keyword (Example 2)

|...+....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

In Figure 310, all positions entries (1) refer to columns measured at 10 CPI (as specified on the CRTPRTF, OVRPRTF, or CHGPRTF command). Therefore, RCDA is printed as follows:

11111111112222222222     3333333333

FLD2, being compressed at 15 CPI, uses less room than FLD1 or FLD3. To avoid the gap, specify FLD3 more to the left. To calculate the position of FLD3, add the length of FLD2 to the specified position of FLD2. To calculate the length of FLD2, use the following formula:

length specified X file density = printed length
density for the field

or, for FLD2:

10 X 10 = 10 X 2 = 6.67 (rounded up to 7)
15        3

Add 7 to 11, the specified position of FLD2, as follows:

7 + 11 = 18

The resulting corrected DDS for Example 2 becomes:

R RCDA                     SPACEA(1)
FLD1            10      1
FLD2            10     11CPI(15)
FLD3            10     18

The record format then prints as follows:

11111111112222222222 3333333333

Figure 311 shows what happens when a field at 10 CPI is printed between fields printed at 15 CPI.

Figure 311. Specifying the CPI Keyword (Example 3)

|...+....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

In Figure 311, the positions entries (1) refer to positions measured at 15 CPI (as specified on the CRTPRTF, OVRPRTF, or CHGPRTF command). The system uses the following formula to calculate the beginning position of fields printed at 10 CPI within files printed at 15 CPI:

2(specified position - 1)  + 1 = printed position (truncated if fractional)
3

or, for FLD5:

2(11-1)  + 1 = 7.67 (truncated to 7)
3

The truncation can cause overprinting of FLD4 by FLD5, as shown by the following:

44444444445555556666666666666

To avoid the overprinting, specify FLD5 one more position to the right (position 12).

To calculate the position of FLD6, add the length of FLD5 to the position of FLD5. To calculate the length of FLD5, use the following formula:

length specified X density for the file = printed length
density for the field

or, for FLD5:

10 X 15 = 15 (rounded up if necessary)
10

Add 15 to the (adjusted) position of FLD5:

15 + 12 = 27

The resulting corrected DDS for Example 3 becomes:

R RCDB                SPACEA(1)
FLD4       10      1
FLD5       10     12CPI(10)
FLD6       10     27

The record format then prints as follows:

4444444444 5555555555 6666666666

Figure 312 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.

Figure 312. Specifying the CPI Keyword (Example 4)

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RCDC                      SPACEA(1)
00020A            FLD7          10       140
00030A            FLD8          10       150CPI(10)
     A

In Figure 312, if the file is being printed at 15 CPI with a forms width of 160, FLD7 and FLD8 are printed as follows:

Printing FLD8 at position 150 calculated at 15 CPI causes FLD8 to extend beyond the right margin. Therefore, FLD8 is either truncated or folded onto the next line (depending on the FOLD parameter on the CRTPRTF, CHGPRTF, or OVRPRTF command). To calculate the length of FLD8, use the following formula:

length specified X density for the file = printed length
density for the field

or, for FLD8:

10 X 15 = 15 (truncated to next lower integer if necessary)
10
Note:
When a file printed at 15 CPI contains fields printed at 10 CPI, the right margin of the form is adjusted for all fields according to the following formula:
2(specified length of the field - 1) + 1 = adjustment
3                                 (truncated if fractional)