TRNSPY (Transparency) Keyword in Printer Files--Examples

The following examples show how to specify the TRNSPY keyword.

Figure 377 shows how to specify the TRNSPY keyword with the CVTDTA keyword. When your program passes character data in a field, the OS/400 program converts it to hexadecimal data.

Figure 377. Specifying the TRNSPY Keyword (Example 1)

|...+....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 OS/400 program 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

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

Figure 378. Specifying the TRNSPY Keyword (Example 2)

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