home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / LUNX / COBOL650.ZIP / COBSRC.ZIP / PROG422.COB < prev    next >
Text File  |  1990-09-02  |  1KB  |  40 lines

  1.        IDENTIFICATION DIVISION.
  2.       *
  3.        PROGRAM-ID. CHAP422.
  4.       *
  5.        ENVIRONMENT DIVISION.
  6.       *
  7.        CONFIGURATION SECTION.
  8.       * 
  9.        SPECIAL-NAMES.
  10.       *
  11.            PRINTER IS PRINTER-DISPLAY.
  12.       *
  13.        DATA DIVISION.
  14.       *
  15.        WORKING-STORAGE SECTION.
  16.       *
  17.            01  W005-DIVISOR                     PIC 9  VALUE 0.
  18.       *
  19.            01  W005-DIVIDEND                    PIC 99 VALUE 5.
  20.       *
  21.            01  W005-QUOTIENT                    PIC 9.
  22.       *
  23.       * 
  24.        PROCEDURE DIVISION.
  25.       *
  26.        MAIN-LINE-LOGIC.
  27.            PERFORM PRINT-COMPUTED-VALUE.
  28.            STOP RUN.
  29.       *
  30.       *
  31.        PRINT-COMPUTED-VALUE.
  32.            DIVIDE W005-DIVISOR INTO W005-DIVIDEND GIVING W005-QUOTIENT
  33.                        ON SIZE ERROR
  34.                           DISPLAY "ON SIZE ERROR ENCOUNTERED"
  35.                           DISPLAY "PROGRAM ABORTING"
  36.                           STOP RUN.
  37.            DISPLAY "No On Size error".
  38.            DISPLAY "PROGRAM EXITING NORMALLY".
  39.            STOP RUN.
  40.