Multiple choice technology mainframe

DIVIDE 130 BY 40 GIVING WS-TOTAL WS-TOTAL has a picture of 999. After the operation is performed, value placed in WS-TOTAL?

  1. 004

  2. 030

  3. 3

  4. 003

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

DIVIDE 130 BY 40 GIVING WS-TOTAL computes 130/40 = 3.25, which truncates to 3. WS-TOTAL has PIC 999, so the value is formatted as '003' with leading zeros to fill the 3-digit field. The GIVING phrase stores only the integer quotient, not the remainder.

AI explanation

To solve this question, we need to divide 130 by 40 and store the result in the WS-TOTAL variable.

The correct answer is D) 003.

Explanation: When we divide 130 by 40, the quotient is 3. The value placed in WS-TOTAL is 003.