Multiple choice technology mainframe

Suppose if the Variables A and B are declared as S9(7) and 9(7). Which of the below statement(s) violate COBOL rules.

  1. (A) Compute A = A / 10

  2. (B) Multiply B by 100

  3. (C) Move 80 to B C

  4. (D) Move 10 to A B.

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

In COBOL, the MULTIPLY statement without a GIVING clause stores the result back in the first operand. B is defined as 9(7) - a 7-digit field. Multiplying a 7-digit number by 100 can produce up to 9 digits, causing overflow (SIZE error). The other statements are valid: COMPUTE with division is allowed, and MOVE can have multiple receiving fields.