home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / cobol / compiler / cobol650 / cobsrc / prog901.cob < prev   
Text File  |  1990-09-03  |  7KB  |  140 lines

  1.        IDENTIFICATION DIVISION.
  2.       *
  3.        PROGRAM-ID. PROG901.
  4.       *                                                             *
  5.       ***************************************************************
  6.       *                                                             *
  7.       * 1. DATE-WRITTEN. 08/03/90.                                  *
  8.       *                                                             *
  9.       * 2. THIS PROGRAM ACCEPTS ENTRIES FROM THE CONSOLE DISPLAY    *
  10.       *    AND DISPLAYS THEM ON THE PRINTER. THE FIELDS ARE:        *
  11.       *    A) FIELD 1 - NAME                                        *
  12.       *    B) FIELD 2 - ADDRESS                                     *
  13.       *    C) FIELD 3 - CITY/STATE                                  *
  14.       *                                                             *
  15.       ***************************************************************
  16.       *
  17.       *
  18.        ENVIRONMENT DIVISION.
  19.       *
  20.        CONFIGURATION SECTION.
  21.       *
  22.        SPECIAL-NAMES.
  23.       *
  24.            PRINTER IS PRINTER-DISPLAY.
  25.       *
  26.       *
  27.        DATA DIVISION.
  28.       *
  29.       ***************************************************************
  30.       *                                                             *
  31.        WORKING-STORAGE SECTION.
  32.       *                                                             *
  33.       ***************************************************************
  34.       *
  35.       * USES OF W005-KEYBOARD-KEY-SWITCH
  36.       *    ] . F9 KEY -- END OF JOB.
  37.       *
  38.        01  W005-KEYBOARD-KEY-SWITCH        PIC 99.
  39.            88  W005-F9-KEY-ACTIVATED           VALUE 10.
  40.       *
  41.        01  W005-RECORD-ACCEPTED-COUNT      PIC 9(4) VALUE +0.
  42.       *        
  43.        01  W010-EMPLOYEE-WK-RECORD.
  44.            05  W010-EMPLOYEE-WK-NAME       PIC X(30).
  45.            05  W010-EMPLOYEE-WK-STREET     PIC X(25).
  46.            05  W010-EMPLOYEE-WK-CITY       PIC X(25).
  47.       /
  48.       ***************************************************************
  49.       *                                                             *
  50.        SCREEN SECTION.         
  51.       *                                                             *
  52.       ***************************************************************
  53.       *
  54.       *
  55.        01  SCREEN1-ADDRESS-ENTRY.
  56.            05  BLANK SCREEN.
  57.            05  LINE 1  COLUMN 16       VALUE "E M P L O Y E E"           
  58.                                        HIGHLIGHT.                        
  59.            05  LINE 1  COLUMN 35       VALUE "A D D R E S S"             
  60.                                        HIGHLIGHT.                        
  61.            05  LINE 1  COLUMN 52       VALUE "E N T R Y"                 
  62.                                        HIGHLIGHT.                        
  63.            05  LINE 3  COLUMN 24       HIGHLIGHT                         
  64.                                        VALUE "NAME:".                    
  65.            05  SCREEN1-NAME            LINE 3  COLUMN 30                 
  66.                                        PIC X(30)                         
  67.                                        REVERSE-VIDEO                     
  68.                                        USING W010-EMPLOYEE-WK-NAME.      
  69.            05  LINE 5  COLUMN 22       HIGHLIGHT                         
  70.                                        VALUE "STREET:".                  
  71.            05  SCREEN1-STREET          LINE 5  COLUMN 30                 
  72.                                        PIC X(25)                         
  73.                                        REVERSE-VIDEO                     
  74.                                        USING W010-EMPLOYEE-WK-STREET.    
  75.            05  LINE 7 COLUMN 18        HIGHLIGHT                         
  76.                                        VALUE "CITY/STATE:".              
  77.            05  SCREEN1-CITY            LINE 7  COLUMN 30                 
  78.                                        PIC X(25)                         
  79.                                        REVERSE-VIDEO                     
  80.                                        USING W010-EMPLOYEE-WK-CITY.      
  81.       /
  82.        PROCEDURE DIVISION.
  83.       *
  84.       ***************************************************************
  85.       *                                                             *
  86.        C000-MAIN-LINE SECTION. 
  87.       *                                                             *
  88.       ***************************************************************
  89.       *
  90.        C020-MAIN-LINE-LOGIC.
  91.            MOVE 98 TO W005-KEYBOARD-KEY-SWITCH.
  92.            PERFORM C120-DISPLAY-NEW-SCREEN.
  93.            PERFORM C040-PROCESS-NAME-ENTRY
  94.                    THRU C100-PROCESS-SCREEN-EXIT
  95.                    UNTIL W005-F9-KEY-ACTIVATED.
  96.            PERFORM C980-EOJ-ROUTINE.
  97.            STOP RUN.
  98.       *
  99.        C040-PROCESS-NAME-ENTRY.
  100.            ACCEPT ( 3, 30 )
  101.                   W010-EMPLOYEE-WK-NAME.
  102.            ACCEPT W005-KEYBOARD-KEY-SWITCH FROM ESCAPE KEY.
  103.            IF W005-F9-KEY-ACTIVATED
  104.                   GO TO C100-PROCESS-SCREEN-EXIT.
  105.       *
  106.        C060-PROCESS-STREET-ENTRY.
  107.            ACCEPT ( 5, 30 )
  108.                   W010-EMPLOYEE-WK-STREET.
  109.            ACCEPT W005-KEYBOARD-KEY-SWITCH FROM ESCAPE KEY.
  110.            IF W005-F9-KEY-ACTIVATED
  111.                   GO TO C100-PROCESS-SCREEN-EXIT.
  112.       *
  113.        C080-PROCESS-CITY-ENTRY.
  114.            ACCEPT ( 7, 30 )
  115.                   W010-EMPLOYEE-WK-CITY.
  116.            ACCEPT W005-KEYBOARD-KEY-SWITCH FROM ESCAPE KEY.
  117.            IF W005-F9-KEY-ACTIVATED
  118.                   GO TO C100-PROCESS-SCREEN-EXIT.
  119.            EXHIBIT NAMED W010-EMPLOYEE-WK-NAME   UPON PRINTER-DISPLAY.
  120.            EXHIBIT NAMED W010-EMPLOYEE-WK-STREET UPON PRINTER-DISPLAY.
  121.            EXHIBIT NAMED W010-EMPLOYEE-WK-CITY   UPON PRINTER-DISPLAY.
  122.            ADD 1 TO W005-RECORD-ACCEPTED-COUNT.
  123.            PERFORM C120-DISPLAY-NEW-SCREEN.
  124.        C100-PROCESS-SCREEN-EXIT.   EXIT.
  125.       *
  126.        C120-DISPLAY-NEW-SCREEN.
  127.            MOVE  SPACES  TO  W010-EMPLOYEE-WK-NAME
  128.                             W010-EMPLOYEE-WK-STREET
  129.                             W010-EMPLOYEE-WK-CITY.
  130.            DISPLAY SCREEN1-ADDRESS-ENTRY.
  131.       /
  132.        C980-EOJ-ROUTINE.
  133.            IF W005-RECORD-ACCEPTED-COUNT  GREATER THAN ZEROS
  134.                 DISPLAY "JOB PROG901: SUCCESSFUL ENTRY COMPLETED"
  135.                                      UPON PRINTER-DISPLAY
  136.            ELSE DISPLAY "JOB PROG901: UNSUCCESSFUL ENTRY"
  137.                                      UPON PRINTER-DISPLAY.
  138.            EXHIBIT NAMED W005-RECORD-ACCEPTED-COUNT
  139.                                      UPON PRINTER-DISPLAY.
  140.