* corpus charka — nivel 6: tablas (OCCURS) y subíndices
IDENTIFICATION DIVISION.
PROGRAM-ID. TABLAS.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-TABLA.
   05 WS-ELEM PIC 9(4) OCCURS 5 TIMES.
01 WS-I     PIC 9(2) VALUE 0.
01 WS-TOTAL PIC 9(6) VALUE 0.
PROCEDURE DIVISION.
MAIN.
    PERFORM VARYING WS-I FROM 1 BY 1 UNTIL WS-I > 5
        COMPUTE WS-ELEM(WS-I) = WS-I * WS-I
    END-PERFORM.
    PERFORM VARYING WS-I FROM 1 BY 1 UNTIL WS-I > 5
        ADD WS-ELEM(WS-I) TO WS-TOTAL
        DISPLAY 'ELEM ' WS-I ' = ' WS-ELEM(WS-I)
    END-PERFORM.
    DISPLAY 'SUMA DE CUADRADOS = ' WS-TOTAL.
    STOP RUN.
