Skip to content

Generated entities decode zoned/packed fields eagerly: a record with LOW-VALUES in an unused numeric field fails to load (z/OS abends only on use) #3952

Closed

Description

@squid-protocol

Follow-up from #3951 (#3949). Generated CobolRecords.zoned / packed and EbcdicDecoderUtil.unpackComp3 now throw on invalid data, which is far better than the old silent ZERO. But the entities' fromRecord decodes every field when a record loads.

The mismatch: real VSAM data often carries LOW-VALUES (X'00…') or spaces in numeric fields that are unused, or not yet set, for a given record type. This is common with REDEFINES, record types sharing one layout, and fillers turned into fields. On z/OS that is harmless unless the program does arithmetic on, or a numeric edit of, that field; then it abends S0C7 / S0C4. The generated port instead fails to load the whole record, so a READ that works on the mainframe fails in Java.

Options:

  1. Lazy decode: keep the field's bytes, and decode (and throw) on first numeric access.
  2. Decode to null with an "invalid numeric" marker, and throw where the port does arithmetic.
  3. A declared policy data.invalid_numeric: fail-on-load | fail-on-use, defaulting to fail-on-use as z/OS does.

Test: a record whose unused packed field is LOW-VALUES loads. Arithmetic on that field fails with the S0C7-style exception. A valid record is unchanged.

Decide together with the REDEFINES handling, where an alternate layout's numeric fields are routinely "invalid" for the active record type.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TmgE1CwLgaqxqKEgQn5Dw5

Activity

  1. added
    enhancement
    data-integrity
    legacy-modernization
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    data-integrityenhancementlegacy-modernizationpriority: medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions