       IDENTIFICATION                   DIVISION.
       PROGRAM-ID.                      PRACTIVE-B.
       ENVIRONMENT                      DIVISION.
       DATA                             DIVISION.
       WORKING-STORAGE                  SECTION.
       01 NAGASA                        PIC 9(3).
       01 I-DATA                        PIC X(100).
       01 TUIKA-DATA                    PIC X(3) VALUE '...'.
       01 O-DATA                        PIC X(103).
       01 IDX                           PIC 9(3).
       01 END-FLAG                      PIC 9(1).
       01 CHK-NAGASA                    PIC 9(3).
       PROCEDURE DIVISION.

           ACCEPT    NAGASA.
           ACCEPT    I-DATA.

           MOVE      1  TO IDX.
           MOVE      0  TO END-FLAG.
           COMPUTE CHK-NAGASA = NAGASA + 1.
           
           EVALUATE TRUE
           WHEN  I-DATA(NAGASA:1) = SPACE
               DISPLAY  I-DATA(1:NAGASA)
           WHEN  I-DATA(NAGASA:1) NOT = SPACE
               COMPUTE CHK-NAGASA  = NAGASA + 1
               IF NAGASA = 100
               THEN
                   DISPLAY  I-DATA(1:NAGASA)
               ELSE
                   IF  I-DATA(CHK-NAGASA:1) NOT = SPACE
                   THEN
                       DISPLAY I-DATA(1:NAGASA)'...'
                   END-IF
               END-IF
           END-EVALUATE.
           STOP RUN.
 