Conversion between zoned decimal and character or hexadecimal in a DDS file

You can convert zoned decimal fields to character or hexadecimal fields and the converse, provided that the field lengths are the same.

The data type of the field in your program is the data type specified in the logical file. No error occurs in an I/O operation if the data passed contains only numeric characters (0 through 9). However, your program cannot send an I/O operation that attempts to pass characters other than 0 through 9 from a character or hexadecimal field to a zoned decimal field. The operating system sends a message and the I/O operation cannot be completed.

For example, suppose that a field is zoned decimal in the physical file. If you specify character type (A) for presentation to your programs, you must ensure that the field contains only numeric characters (0 through 9) when it is returned through the logical file to the physical file.

In another example, suppose a field is a character field in the physical file. If you specify the field as a zoned decimal field and as a key field in the logical file, you cannot create the logical file unless all records in the physical file contain only numeric characters (0 through 9).