CVTDTA (Convert Data) keyword in printer files

This field-level keyword converts character data to hexadecimal data when the field is passed to the printer.

You can use the CVTDTA keyword to define:
  • Logos or emblems for a letterhead on your forms
  • Alternative character sets or symbols (such as a copyright symbol)
  • The appearance of a physical form (by adding vertical and horizontal lines that act as boundaries on the form or between positions on an invoice)
  • IPDS bar-code commands

This keyword has no parameters.

In an SCS printer file (DEVTYPE(*SCS) on the CRTPRTF command), specify CVTDTA only when you use the DFNCHR keyword. Furthermore, use CVTDTA when you define characters for unassigned code points. A code point is one of the 256 values that you can assign a character in a character set. An unassigned code point is a code point to which no character is assigned. On the IBM® i operating system, a code point is identified by a 2-digit hexadecimal number. For example, in the EBCDIC character set, code point hexadecimal C1 is assigned the character A; hexadecimal 51 is an unassigned code point.

CVTDTA is valid for the 5224, 5225, and IPDS printers. For IPDS printers, CVTDTA allows you to specify code points to be included in the data stream. These code points print as preassigned on the printer. Do not use the CVTDTA keyword with the TRNSPY and DFNCHR keywords for IPDS printers.

If you define characters for unassigned code points, perform one of the following tasks:
  • Specify CVTDTA
  • Work with hexadecimal data in your program

Specify CVTDTA only for named fields. For user-defined characters in constant fields, use the DFT and DFNCHR keywords.

In an SCS printer file (DEVTYPE(*SCS) on the CRTPRTF command), if you specify CVTDTA, you must also specify the TRNSPY keyword. In printer files created with DEVTYPE(*IPDS) or DEVTYPE(*AFPDS) on the CRTPRTF command, if you specify CVTDTA, you do not need to specify the TRNSPY keyword. However, a warning message appears stating that the DEVTYPE should not be changed to *SCS.

If you specify CVTDTA on a field, the length of the field must be an even number. The printed length of the field is the length you specify, divided by two.

If you specify CVTDTA for a field, the character data that your program passes in the field must contain only valid hexadecimal characters (0 through 9 and A through F). Blanks, whether embedded or trailing, are not valid hexadecimal characters. If characters that are not valid are specified in the field at program run time, the IBM i operating system sends escape message CPF5234 to your program.

Option indicators are not valid for this keyword.

The following rules apply to using DDS CVTDTA for bar-code commands:
  • The support is only for printers with device type *IPDS.
  • The support allows the following commands:
    • WBCC (Write Bar-Code Control)
    • WBC (Write Bar Code)
    • END

    All three commands must be in the same field. No other commands can be in that field.

  • The length of the field must be exact.
  • The length within each command must be exact.
  • Optional - the file can contain a DDS BARCODE keyword on another record in the file. This record does not have to be used. It indicates to the IBM i operating system that bar codes can be expected when the file is used.
  • Correlation IDs are not required on the IPDS commands.
  • No validity checking is done on the user's bar-code data. Data that is not valid will cause the printer to report that the command is not valid.
  • Examples of the commands are shown in Figure 1. Add the lengths of these commands in the example totals 69 (45 + 17 + 7 = 69). This will be multiplied by two to indicate the number of characters included in the CVTDTA field. This means the field with CVTDTA for this example requires a length of 138 (69 x 2 = 138).
  • See the Intelligent printer data stream reference manual for more information about bar-code commands.
Figure 1. Command format for bar-code commands using CVTDTA (Part 1 of 2)
Command format for bar-code commands using CVTDTA
Figure 2. Command format for bar-code commands using CVTDTA (Part 2 of 2)
Command format for bar-code commands using CVTDTA