Multiple choice technology mainframe

Which of the following addition statements is invalid?

  1. Add 1, 2, 3 To Field-1.

  2. Add 1 To Field-1, Field-2.

  3. Add Field-1, 3 Giving Field-2.

  4. Add Field-1 To Field-2 Giving 3.

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

In COBOL ADD syntax, the GIVING phrase must be followed by receiving field(s), not a literal. Option D 'Giving 3' is invalid because 3 is a literal constant, not a field that can receive a value. The GIVING clause requires named data items to store the result.