Multiple choice technology mainframe

MAIN-PARA. MOVE 10 TO WS-CTR PERFORM PARA-1 WS-CTR TIMES END-PERFORM. PARA-1. MOVE 20 TO WS-CTR. How many times the PARA-1 will be performed when the above code is executed?

  1. 10

  2. 20

  3. 1

  4. None

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

The PERFORM statement uses WS-CTR's initial value (10) to determine iteration count. Once PERFORM begins, it executes 10 times regardless of any changes to WS-CTR inside PARA-1. Even though PARA-1 changes WS-CTR to 20, this only affects the variable's value - it doesn't alter the already-determined iteration count. PARA-1 executes exactly 10 times as specified in the PERFORM statement.