 IDENTIFICATION DIVISION.
 PROGRAM-ID. TEST01.

 ENVIRONMENT DIVISION.

 DATA DIVISION.
 WORKING-STORAGE SECTION.

  01 INP.
   03 N PIC 9(1).

  01 C  PIC 9(1).
  01 S  PIC 9(3).

  01 TBL-N.
    03 FILLER PIC 9(1) VALUE '1'.
    03 FILLER PIC 9(1) VALUE '2'.
    03 FILLER PIC 9(1) VALUE '3'.
    03 FILLER PIC 9(1) VALUE '4'.
    03 FILLER PIC 9(1) VALUE '5'.
    03 FILLER PIC 9(1) VALUE '6'.
    03 FILLER PIC 9(1) VALUE '7'.
    03 FILLER PIC 9(1) VALUE '8'.
    03 FILLER PIC 9(1) VALUE '9'.

  01 TBL REDEFINES TBL-N.
    03 TB OCCURS 9.
      05 TBN PIC 9(1).

 PROCEDURE DIVISION.
 
  ACCEPT INP.
 
  PERFORM VARYING C FROM 1 BY 1 UNTIL C > 9
     IF N = TBN(C)
       COMPUTE S = TBN(C) * TBN(C) * TBN(C)
     END-IF
     ADD 10 TO C
  END-PERFORM.

  DISPLAY S.
  STOP RUN. 