       IDENTIFICATION DIVISION.
       PROGRAM-ID. SearchIndexedBy.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 TBL.
           05 ITEM PIC 9(3) OCCURS 5 TIMES INDEXED BY IX.
       PROCEDURE DIVISION.
           MOVE 10 TO ITEM(1)
           MOVE 20 TO ITEM(2)
           MOVE 30 TO ITEM(3)
           MOVE 40 TO ITEM(4)
           MOVE 50 TO ITEM(5)
           SEARCH TBL
               AT END DISPLAY "NO"
               WHEN ITEM(IX) = 30 DISPLAY "YES"
           END-SEARCH
           STOP RUN.
