* corpus charka — nivel 6: STRING y UNSTRING
IDENTIFICATION DIVISION.
PROGRAM-ID. CADENAS.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-NOMBRE   PIC X(3)  VALUE 'ANA'.
01 WS-APELLIDO PIC X(5)  VALUE 'PEREZ'.
01 WS-COMPLETO PIC X(20).
01 WS-CSV      PIC X(15) VALUE 'ROJO,VERDE,AZUL'.
01 WS-C1       PIC X(8).
01 WS-C2       PIC X(8).
01 WS-C3       PIC X(8).
PROCEDURE DIVISION.
MAIN.
    STRING WS-NOMBRE DELIMITED BY SIZE
           WS-APELLIDO DELIMITED BY SIZE
           INTO WS-COMPLETO
    END-STRING.
    DISPLAY 'COMPLETO=' WS-COMPLETO.
    UNSTRING WS-CSV DELIMITED BY ',' INTO WS-C1 WS-C2 WS-C3
    END-UNSTRING.
    DISPLAY 'C1=' WS-C1.
    DISPLAY 'C2=' WS-C2.
    DISPLAY 'C3=' WS-C3.
    STOP RUN.
