 IDENTIFICATION DIVISION.
 PROGRAM-ID. HELLO.

 DATA DIVISION.
 WORKING-STORAGE SECTION.
   EXEC SQL
     INCLUDE SQLSCRIPT
   END-EXEC.

   EXEC SQL
     INCLUDE TEACHER
   END-EXEC.

   EXEC SQL BEGIN DECLARE SECTION
   END-EXEC.
     01 WS-TEACHER-REC.
     05 WS-TEACHER-ID PIC 9(10).
   EXEC SQL END DECLARE SECTION
   END-EXEC.

 PROCEDURE DIVISION.
   EXEC SQL
     SELECT TEACHER-ID
       INTO :WS-TEACHER-ID FROM TEACHER
       WHERE TEACHER-ID=1
   END-EXEC.

   IF SQLCODE=0
   DISPLAY WS-TEACHER-RECORD
   ELSE DISPLAY 'Error'
   END-IF.
   STOP RUN.