DFNCHR (Define Character) keyword in printer files

You use this file-level or record-level keyword to define characters of your own design for the 5224 Printer and 5225 Printer.

With this keyword you can specify DFNCHR more than once at the file or record level, or as many as 50 characters each time you specify DFNCHR.

The format of the keyword is:

DFNCHR(X'code-point-1' X'dot-matrix-pattern-1'
[X'code-point-2' X'dot-matrix-pattern-2'...
[X'code-point-50' X'dot-matrix-pattern-50']])
Note: You cannot specify more than 5000 characters in a single DDS statement. If you need to specify more than 5000 characters in specifying DFNCHR several times together, start a new DDS statement by specifying an option indicator for the new DFNCHR keywords. To avoid having to set the indicators on, specify an N (for example, N50). This causes the conditioning to be on for the keyword with no program action.

User-defined characters can take up one print position (as in example 1) or more than one print position (as in examples 2 and 3). For each print position, specify a code point and a dot matrix pattern. In the EBCDIC character set, hexadecimal C1 is assigned the character A; hexadecimal 51 is an unassigned code point.

You define a dot matrix pattern in DDS by specifying nine 2-digit pairs of hexadecimal digits. You can specify only the characters 0 through 9 and A through F.

When your program sends an output operation to a record format for which DFNCHR defines code points different from those defined for the previous output operation, the IBM® i operating system loads the new definitions, thereby changing the defined characters. This process can slow printing.

If, however, the same DFNCHR keywords are in effect for two output operations in a row, the IBM i operating system does not reload code points for the second output operation.

You can use DFNCHR only with SCS printers. It cannot be specified on the same record format with IPDS printer keywords, such as COLOR, LPI, and BARCODE. If any format in the file contains a combination of SCS and IPDS printer keywords, the file is not created.

If you specify DFNCHR in a file created with DEVTYPE(*IPDS) or DEVTYPE(*AFPDS), a warning message appears at creation time.

You cannot specify DFNCHR on the same record format as the DRAWER keyword. If any format in the file contains DFNCHR at the record-level and a DRAWER keyword, the file is not created.

Option indicators are valid for this keyword.

Examples

The following examples show how to specify DFNCHR.

Example 1

The following example uses a single dot matrix to show how to specify DFNCHR at the record level so that hexadecimal 7C prints © instead of @.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
12
00010A          R RECORD                    DFNCHR(X'7C' X'007E813CC324817E00')
00020A                                 58  4DFT(X'7C')   TRNSPY
00030A                                    +2DFT('1982')
     A
This example redefines code point hexadecimal 7C1, normally @ in the EBCDIC character set, as a copyright mark. The copyright mark is printed as follows (on line 58 of a printer form):
© 1982

The hexadecimal digits 2 define the following dot matrix pattern:

Figure 1. Dot matrix pattern for example 1
Dot matrix pattern for example 1

Example 2

The following example uses a dot matrix for a large character. This example shows how to specify DFNCHR at the file level for a character two positions wide by two lines high.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
12
00010A                                      DFNCHR(X'51' X'000000FF00FF00E700' +
00020A                                             X'52' X'E700E700E700E10000' +
00030A                                             X'53' X'0000009C001F000700' +
00040A                                             X'54' X'07000700FF00FC0000' +
00050A                                             X'55' X'00000000FF00E700E7' +
00060A                                             X'56' X'00E700E700E3000000' +
00070A                                             X'57' X'000000001E00070007' +
00080A                                             X'58' X'0007000700FE000000')
00090A          R RECORD1
00100A                   3  58  4DFT(X'5152')   TRNSPY
00110A                                 58  4DFT(X'5556')   TRNSPY
00120A                                 59  4DFT(X'5354')   TRNSPY
00130A                                 59  4DFT(X'5758')   TRNSPY
     A

Example 2 redefines eight code points (hexadecimal 51 through hexadecimal 58) 1. Each position of the two-by-two character is printed twice so that adjacent horizontal dots can print. The hexadecimal codes 2 define the dot matrix pattern.

The information marked 3 shows how the large character 5 looks when printed (using four print positions, two on line 58 and two on line 59 of a printer form):

Note: The file should be at 9 lpi to avoid a horizontal gap in the large character (LPI parameter on the CRTPRTF, CHGPRTF, or OVRPRTF command).

In the grid pattern, mark the dot patterns for as many as nine print columns (three across and three down), as shown in example 2.

Figure 2. Specifying the grid pattern for example 2 (points 51 through 54)
Specifying the grid pattern for example 2

Use Table: Hexadecimal digits for the bit patterns in Specifying dots to be printed in the dot matrix to determine which hexadecimal digit to specify for each half-column in the grid pattern.

For each print position, complete one row of the grid pattern (one pair of hexadecimal digits to each box) as shown in Figure 3 for code points 51 through 54.

Figure 3. Completing code points for example 2 (points 51 through 54)
Completing code points for example 2

In the grid pattern, mark the dot patterns for as many as nine print columns (three across and three down), as shown in Figure 4.

Figure 4. Specifying the grid pattern for example 2 (points 55 through 58)
Specifying the grid pattern for example 2 (points 55 through 58)

Use Table: Hexadecimal digits for the bit patterns in Specifying dots to be printed in the dot matrix to determine which hexadecimal digit to specify for each half-column in the grid pattern.

For each print position, complete one row of the grid pattern (one pair of hexadecimal digits to each box) as shown in Figure 5 for code points 55 through 58.

Figure 5. Completing the code points for example 2 (points 55 through 58)
Completing the code points for example 2

Example 3

The following example uses a dot matrix for a large graphic to show how to specify DFNCHR at the file level for a large graphic three columns wide by two lines high.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A                                         12
00020A                                      DFNCHR(X'B1' X'FF00E000D000C800C4' +
00030A                                             X'B2' X'00C200C100C100C200' +
00040A                                             X'B3' X'C400C800D000E000FF' +
00050A                                             X'B4' X'FF0007000800130023' +
00060A                                             X'B5' X'004300830083004300' +
00070A                                             X'B6' X'230013000B000700FF' +
00080A                                             X'B7' X'00FF00F000D800CC00' +
00090A                                             X'B8' X'C600C100C100C100C6' +
00100A                                             X'B9' X'00CC00D800F000FF00' +
00110A                                             X'BA' X'00FF000F001B003300' +
00120A                                             X'BB' X'630083008300830063' +
00130A                                             X'BC' X'0033001B000F00FF00')
00140A          R RECORD1                   CPI(15)
00150A                                 58  4DFT(X'B1B2B3')   TRNSPY
00160A                                 58  4DFT(X'B7B8B9')   TRNSPY
00170A                                 59  4DFT(X'B4B5B6')   TRNSPY
00180A                                 59  4DFT(X'BABBBC')   TRNSPY
     A

The example redefines 12 code points (hexadecimal B1 through hexadecimal BC) 1. Each column of the three-by-two character prints twice so that adjacent horizontal dots can print. The hexadecimal codes 2 define the dot matrix pattern.

This example prints an X inside a grid using three print columns (on lines 58 and 59 on a printer form).

Note: The file should be at 9 lpi to avoid a horizontal gap in the large character (LPI parameter on the CRTPRTF, CHGPRTF, or OVRPRTF command).

Mark the dot patterns for as many as nine print columns (three across and three down) in the grid, as shown in the example.

Figure 6. Specifying the grid pattern for example 3 (points B1 through B6)
Specifying the grid pattern for example 3

Use Table: Hexadecimal digits for the bit patterns in Specifying dots to be printed in the dot matrix to determine which hexadecimal digit to specify for each half-column in the grid. For each print position, complete one row of the grid pattern (one pair of hexadecimal digits to each box) as shown in Figure 7.

Figure 7. Completing the code points for example 3 (points B1 through B6)
Completing the code points for example 3 (points B1 through B6)

As shown in Figure 8, mark the dot patterns in the grid for as many as nine print columns (three across and three down).

Figure 8. Specifying the grid pattern for example 3 (points B7 through BC)
Specifying the grid pattern for example 3 (points B7 through BC)

Use Table: Hexadecimal digits for the bit patterns in Specifying dots to be printed in the dot matrix to determine which hexadecimal digit to specify for each half-column in the grid. For each print position, complete one row of the grid pattern (one pair of hexadecimal digits to each box) as shown in Figure 9.

Figure 9. Completing the code points for example 3 (points B7 through BC)
Completing the code points for example 3 (points B7 through BC)