TRNSPY (Transparency) keyword in printer files

This field-level keyword prevents code points that you have redefined (using the DFNCHR keyword) from being interpreted as SCS printer control commands when your program sends an output operation that prints the field that you are defining.

This keyword has no parameters.

If you do not specify the TRNSPY keyword for a field in which your program passes hexadecimal data to an SCS printer, code points can be interpreted as SCS commands that affect printer operation. A code point is one of the 256 values that you can assign to a character in a character set. On the IBM® i operating system, a code point is identified by a 2-digit hexadecimal number.

You must specify the TRNSPY keyword when you specify:
  • The CVTDTA keyword in a printer file created with DEVTYPE(*SCS)
  • A hexadecimal value (with or without the DFT keyword explicitly specified)

In a file created with DEVTYPE(*IPDS), you need not specify the TRNSPY keyword with the CVTDTA keyword. However, a warning message appears stating that the DEVTYPE should not be changed to *SCS.

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

The TRNSPY keyword is valid only when the data type is character.

When you specify the TRNSPY keyword with the CVTDTA keyword, your program can place character data in the field and the IBM i operating system converts it to hexadecimal data when the field is passed to the printer. Each pair of hexadecimal digits corresponds to a code point in the character set of your system. Using the DFNCHR keyword, you can define characters of your own design for the 5224 Printer or 5225 Printer. Also, the printed length of the field is one half the length you specify. Therefore, the length of the field must be an even number.

If you specify the TRNSPY keyword without the CVTDTA keyword, the field length you specify is the printed length.

This keyword is supported only for the 5224 Printer and 5225 Printer.

Option indicators are not valid for this keyword.

Examples

The following examples show how to specify the TRNSPY keyword.

Example 1

The following example shows how to specify the TRNSPY keyword with the CVTDTA keyword. When your program passes character data in a field, the IBM i operation system converts it to hexadecimal data.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RECORD                    SPACEB(1)
00020A            FLD1          10         1TRNSPY CVTDTA
00030A            FLD2          20         6TRNSPY CVTDTA
     A

The program can pass character data in FLD1 and FLD2. The IBM i operating system converts it to hexadecimal data for the printer. Only the characters 0 through 9 and A through F are valid. Blanks are not valid.

The printed length of FLD1 and FLD2 is one half the specified length (FLD1 is 5 positions long; FLD2 is 10 positions long).

You must also specify the DFNCHR keyword with this DDS in order to print user-defined characters.

The following is how RECORD prints when the contents of FLD1 are 'C1C1C1C1C1' and the contents of FLD2 are 'C2C2C2C2C2C2C2C2C2C2':

AAAAABBBBBBBBBB

Example 2

The following example shows how to specify the TRNSPY keyword without the CVTDTA keyword. In this example, your program must pass hexadecimal data in the field.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RECORD2                   SPACEB(1)
00020A            FLD3           5         1TRNSPY
00030A            FLD4          10         6TRNSPY
     A

The program must pass hexadecimal data in FLD3 and FLD4. Only hexadecimal characters 0 through 9 and A through F are valid. Blanks are not valid. Without the CVTDTA keyword, the printed length of both fields is the specified length.