001000 @OPTIONS NOALPHA
001010 @OPTIONS MAIN
001020
001030 *>
001040 *>
001050 *>  Source Module: SEEVER.CBL
001060 *>
001070 *>  Last Modified: September 1, 1999
001080 *>
001090 *>  Author:  MDM
001100 *>
001110 *>  Must be linked with SEE32.LIB
001120 *>
001130
001140 IDENTIFICATION DIVISION.
001150 PROGRAM-ID.    SEEVER.
001160 AUTHOR.        Mike Marshall.
001170 INSTALLATION.  Fujitsu COBOL.
001180 
001190 ENVIRONMENT DIVISION.
001200 CONFIGURATION SECTION.
001210 SOURCE-COMPUTER. Fujitsu.
001220 OBJECT-COMPUTER. Fujitsu.
001230
001240 SPECIAL-NAMES.
001250
001260 COPY "SEE32.CBI".
001270
001280 DATA DIVISION.
001290 
001300 WORKING-STORAGE SECTION.
001310
001320 COPY "KEYCODE.CBI".
001330  01  VERSION      PIC 9(9) COMP-5 VALUE 0.
001340  01  DIGIT1       PIC 9(1) COMP-5 VALUE 0.
001350  01  DIGIT2       PIC 9(1) COMP-5 VALUE 0.
001360  01  DIGIT3       PIC 9(1) COMP-5 VALUE 0.
001370  01  SEE_CODE     PIC S9(9) COMP-5 VALUE 0.
001380  01  NBR_CHANS    PIC S9(9) COMP-5 VALUE 1.
001390  01  CHANNEL      PIC S9(9) COMP-5 VALUE 0.
001400  01  KEY_CODE     PIC S9(9) COMP-5 VALUE 0.
001410  01  RESULT.
001420      05  FILLER PIC X(80).
001430      05  FILLER PIC X VALUE X'00'.
001440  01  RESULT_LEN PIC S9(9) COMP-5 VALUE 80.
001450
001460 PROCEDURE DIVISION.
001470 
001480      DISPLAY "SEEVER.CBL Program"
001490      DISPLAY " "
001500 
001510      *> attach SEE
001520      CALL "seeAttach" WITH STDCALL USING
001530           BY VALUE     NBR_CHANS     *> number of channels
001540           BY VALUE     SEE_KEY_CODE  *> See KEYCODE.CBI
001550      END-CALL.
001560      
001570      *> check result
001580      IF PROGRAM-STATUS < 0 THEN
001590        DISPLAY "Cannot attach SEE"
001600        STOP RUN
001610      END-IF.
001620 
001630      CALL "seeStatistics" WITH STDCALL USING
001640        BY VALUE     CHANNEL          *> channel 
001650        BY VALUE     SEE_GET_VERSION  *> get SEE version 
001660      END-CALL
001670
001680      MOVE PROGRAM-STATUS TO VERSION 
001690      MOVE VERSION TO DIGIT1
001700      COMPUTE DIGIT1 = DIGIT1 / 256
001710      MOVE VERSION TO DIGIT2
001720      COMPUTE DIGIT2 = (DIGIT2 - 256 * DIGIT1) / 16      
001730      MOVE VERSION TO DIGIT3
001740      COMPUTE DIGIT3 = DIGIT3 - 256 * DIGIT1 - 16 * DIGIT2
001750      DISPLAY "SEE Version " DIGIT1 "." DIGIT2 "." DIGIT3
001760
001770      MOVE SPACES TO RESULT
001780      CALL "seeDebug" WITH STDCALL USING 
001790         BY VALUE     CHANNEL       *> channel
001800         BY VALUE     SEE_GET_REGISTRATION        
001810         BY REFERENCE RESULT        *> resultant buffer
001820         BY VALUE     RESULT_LEN    *> buffer length
001830      END-CALL
001840      DISPLAY RESULT
001850
001860      *> close SEE
001870      CALL "seeClose" WITH STDCALL USING
001880         BY VALUE     CHANNEL       *> channel
001890      END-CALL
001900
001910      *> release SEE
001920      CALL "seeRelease" WITH STDCALL 
001930      END-CALL
001940    
001950      DISPLAY "All done."
001960      STOP RUN.        
001970
001980 END PROGRAM SEEVER.
001990 
002000
