Making Fields for Journal Entry Formats

Character and Zoned fields are simply the length of the field. For example,

Char(16) = DataType(A=Character), Length(16 bytes)

Char(*) means the length is arbitrary (and probably stated in the value of another field).

Zoned(20,0) = DataType(D=Zoned), Length(20 bytes)

Packed fields are stored such that the length (in bytes) of the field is calculated as follows:

  • Round even numbers of digits up to next odd number (if 8 digits, then 9).
  • Add 1 digit. Divide by two. Gives bytes.
  • Packed(15,0) = DataType(P=Packed), Length(8 bytes) because ( (15 + 1) / 2 ) = 8.

Date, Time, Timestamp:

Timestamps come in two flavors (three, if you count message queue dates).

  • "Unformatted Timestamp" is an unsigned integer of 20 digits.
  • 26 bytes ISO timestamp (yyyy-mm-dd-hh.mm.ss.micros)
  • There is one in message descriptions that is date, time and micros all separate (CYYMMDD, HHMMSS then NNNNNN).

Dates

  • CYYMMDD - DataType(L=Date), Length(7 bytes)
  • YYMMDD - DataType(L=Date), Length(6 bytes)
  • YYYY-MM-DD - DataType(L=Date), Length(10 bytes)

Times

  • HHMMSS is DataType(T=Time), Length(6)
  • HH.MM.SS is DataType(T=Time), Length(8)

Integer data

Sometimes IBM represents integer data measured in bytes, sometimes in bits.

  • Bytes:
    • Binary(2) = DataType(I=Integer), Length(2 bytes)
    • Binary(4) = DataType(I=Integer), Length(4 bytes)
    • Binary(8) = DataType(I=Integer), Length(8 bytes)
  • Bits:
    • Bin(15) = DataType(I=Integer), Length(2 bytes)
    • Bin(31) = DataType(I=Integer), Length(4 bytes)
    • Bin(63) = DataType(I=Integer), Length(8 bytes)
    • Bin(16) = DataType(U=Unsigned), Length(2 bytes)
    • Bin(32) = DataType(U=Unsigned), Length(4 bytes)
    • Bin(64) = DataType(U=Unsigned), Length(8 bytes)