Previous Topic: Field Types V, VP, and VZ — Calculate Variable Symbol Value

Next Topic: RDL Repetition Groups


Field Types ZL and ZR — Zoned Decimal Data

Field types ZL and ZR can be used to define fields which contain zoned decimal data. Type ZL defines a field containing left-justified zoned numeric data, possibly followed by 1 or more filler characters. Type ZR defines a field containing right-justified zoned numeric data, possibly preceded by 1 or more filler characters.

Valid fields must meet these conditions:

Data contained in fields defined as ZL or ZR is converted to binary, bit-aligned, variable-length floating point. Blank or zero fields compress to 5 bits, while fields with a value between -16n-1 and 16n-1 compress to 5+4n bits, regardless of field length.

If invalid data is encountered in a field defined as ZL or ZR, the field is not compressed. Instead, it grows by one bit in the compressed record. No data is lost in this event; the expanded field contains exactly the same data as it did before compression. A message is printed with the statistics produced by the Compression Utility indicating the number of times invalid data was encountered in a ZL or ZR field during compression.

ZL and ZR specifications are most useful in cases where a separate type C specification cannot be dedicated to zoned numeric fields and/or multiple zoned numeric fields are not contiguous in the record. Consider an 80-byte record containing all numeric digits. The most efficient specification is C1F80. However, if 80 contiguous bytes containing zoned numerics occurred within a record for which all type C definitions were already in use, the best definition for the numeric data is 8'ZRF9',ZRF8. For zoned decimal fields of 9 bytes or less, a definition using type ZR or ZL is better than using a type C specification.