You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
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
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:
Lazy decode: keep the field's bytes, and decode (and throw) on first numeric access.
Decode to null with an "invalid numeric" marker, and throw where the port does arithmetic.
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.
Activity