Multiple choice technology mainframe

SET A TO B. Which one of the following is correct, after execution of above statement?

  1. Contents of A will be moved to B

  2. Contents of B will be moved to A

  3. Statement will give an error

  4. None

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The SET statement in COBOL sets index names or data items to specific values. 'SET A TO B' sets A to the value contained in B, moving B's contents to A. This is the standard direction of assignment in SET statements. The statement is syntactically correct and doesn't produce an error when A and B are properly defined data items.