Repository navigation
Description
Problem
copy_members on a data entry lists every COPY between the entry and the next level number (mainframe_boundary.py, copy_window, ~l.1075-1084). A COPY of a member that holds its own 01 records therefore gets attached to the 01 above it whenever it directly follows that 01's own COPY. GalaxyIR.record_layout then expands those records as children of the 01. If the member is outside the estate (a CICS- or Db2-supplied copybook such as DFHAID), the layout's bytes becomes None. If the member resolves, the record gets fields that belong to another record.
IBM: a level-01 entry in copied text begins a new record, so the copied member's 01 ends the record above it.
Evidence
- estate-crucible v0.1.0 (Epic: estate-crucible -- a synthetic mainframe estate whose answer key is generated with it #4317), keyed:
estate/apps/CUST/cobol/CUSTINQ.cbl:11-14:01 WS-COMMAREA. COPY CUSTCOMM. COPY CUSTMS. COPY DFHAID.
copy_membersisCUSTCOMM,CUSTMS,DFHAID; the key hasCUSTCOMM. CUSTMS (a BMS symbolic map) and DFHAID each start with an 01. The layout of WS-COMMAREA isbytes: None(key: 50). - Minimal reproducer, main 25f9233.
copy_membersofWS-AREA=CPYAREA,CPYREC; expectedCPYAREA:IDENTIFICATION DIVISION. PROGRAM-ID. CPYFOLD. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-AREA. COPY CPYAREA. COPY CPYREC. PROCEDURE DIVISION. MAIN-PARA. MOVE SPACES TO AREA-NAME REC-KEY GOBACK.
CPYAREA.cpy:05 AREA-NAME PIC X(20). 05 AREA-CODE PIC 9(4).
CPYREC.cpy:01 REC-RECORD. 05 REC-KEY PIC X(8). 05 REC-DATA PIC X(40).
Impact
COPY DFHAID. / COPY DFHBMSCA. / a symbolic map right after a COMMAREA or work-area COPY is a very common CICS shape. Each case loses that record's layout (COMMAREA contracts, vsam_files key positions, generated DTOs) or merges two records into one.
Acceptance criteria
- A COPY whose resolved member's first data entry is an 01 (or 77) is not a member of the entry above it. When the member is outside the estate, the reader does not guess: the first COPY stays with the entry, and the later ones are recorded as section-level copies (not on the 01).
- Reproducer:
WS-AREA.copy_members = CPYAREA, and the layout of WS-AREA is 24 bytes. - estate-crucible: CUSTINQ
WS-COMMAREAdata_itemsandlayoutschecks pass.
Related: #3355 (copy_members), #4303 (same-line COPY), #4265 (copybook resolution in the wild), #4317 (planted as H-0010 from v0.2.0).
Found by: estate-crucible v0.1.0 scorecard (#4324).
Activity
GalaxyIR #4330: moved COPY members still close the record above them …
fix: train -- #4306, #4330, #4365 (#4389)
fix: train -- #4457, #4458 (#4471)
[experiment A] fix(crosscheck): read replaced records of section COPY…