TAOCP 2.4 Exercise 7
“MOVE CORRESPONDING SALES TO PURCHASES” means that each elementary data item occurring in both group structures SALES and PURCHASES, identified by the same name within the COBOL record hierarchy, is t...
Section 2.4: Multilinked Structures
Exercise 7. [**] [15] Given the data structures in (1), what does the COBOL statement
"MOVE CORRESPONDING SALES TO PURCHASES" mean?
Verified: yes
Solve time: 47s
“MOVE CORRESPONDING SALES TO PURCHASES” means that each elementary data item occurring in both group structures SALES and PURCHASES, identified by the same name within the COBOL record hierarchy, is transferred from SALES into the corresponding location in PURCHASES.
Formally, for every elementary item $x$ that is a member of both SALES and PURCHASES under identical qualification structure, the assignment $x_{\text{PURCHASES}} \leftarrow x_{\text{SALES}}$ is performed, and no other fields of PURCHASES are modified. Fields present in PURCHASES but not in SALES remain unchanged, and fields present in SALES but not in PURCHASES are ignored. This completes the interpretation of the statement. ∎