COBOL ⭐ Featured
👁 0

Q: What is MOVE CORRESPONDING?

Answer:
MOVE CORRESPONDING moves all fields with matching names between groups. MOVE CORR INPUT-REC TO OUTPUT-REC. Only moves if names match exactly. Moves all matches, not just first. Useful for record transformations. Debug carefully-silent partial moves.
COBOL
👁 0

Q: What is CORRESPONDING in COBOL?

Answer:
CORRESPONDING (CORR) operates on fields with matching names. MOVE CORRESPONDING record-1 TO record-2 moves all matching fields. ADD CORRESPONDING does arithmetic. Reduces code but requires careful naming. Not recommended for performance-critical code.
COBOL
👁 0

Q: How to use SUBTRACT CORRESPONDING?

Answer:
SUBTRACT CORRESPONDING subtracts matching fields. SUBTRACT CORR group-1 FROM group-2. Each matching numeric field in group-2 decreased by corresponding group-1 value. Use ROUNDED and SIZE ERROR options. Limited to numeric fields.