home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / LANGUAGS / COBOL / COBOL21.ARK / CBL2.CBL < prev    next >
Text File  |  1986-10-12  |  4KB  |  111 lines

  1. IDENTIFICATION DIVISION.
  2.  
  3. PROGRAM-ID.      CBL2.
  4. AUTHOR.          EILEEN STRAUS.
  5. DATE-WRITTEN.    09/18/80.
  6.  
  7. ***************************************************     
  8. *                                                 *
  9. *  THIS PROGRAM PRODUCES A LIST OF NEW EMPLOYEES. *
  10. *                                                 *
  11. ***************************************************
  12.  
  13. ENVIRONMENT DIVISION.
  14. CONFIGURATION SECTION.
  15. SOURCE-COMPUTER.
  16.     8080.
  17. OBJECT-COMPUTER.
  18.     8080.
  19. INPUT-OUTPUT SECTION.
  20.  
  21. FILE-CONTROL.
  22.     SELECT EMP-INPUT-FILE ASSIGN
  23.     CDL2.FIL.
  24.     SELECT EMP-REPORT-FILE ASSIGN
  25.     PRL2.FIL.
  26.  
  27. DATA DIVISION.
  28.  
  29. FILE SECTION.
  30.  
  31. FD  EMP-INPUT-FILE
  32.       RECORD 1 TO 80
  33.       LABEL RECORDS
  34.       OMITTED.
  35. 01  EMP-INPUT-RECORD.
  36.     05  FILLER                            PIC X(8).
  37.     05  DEPT-NUM-INPUT                    PIC XX.
  38.     05  FILLER                            PIC X(3).
  39.     05  NAME-INPUT.
  40.         10  FIRST-LETTER-INPUT            PIC X.
  41.         10  REST-OF-NAME-INPUT            PIC X(19).
  42.     05  FILLER                            PIC X(15).
  43.     05  SSN-INPUT.
  44.         10  FST-3-SSN-INPUT               PIC X(3).
  45.         10  MID-2-SSN-INPUT               PIC X(2).
  46.         10  LST-4-SSN-INPUT               PIC X(4).
  47.     05  FILLER                            PIC X(23).
  48. FD  EMP-REPORT-FILE
  49.       LABEL RECORDS
  50.       OMITTED.
  51. 01  EMP-REPORT-LINE.
  52.     05  FILLER                            PIC X(4).
  53.     05  EMP-ID-NUM-REPORT.
  54.         10  ID-FIRST-LETTER-REPORT        PIC X.
  55.         10  ID-2-5-DIGITS-REPORT          PIC X(4).
  56.         10  ID-DEPT-NUM-REPORT            PIC XX.
  57.     05  FILLER                            PIC X(10).
  58.     05  NAME-REPORT                       PIC X(20).
  59.     05  FILLER                            PIC X(10).
  60.     05  SSN-REPORT.
  61.         10  FST-3-SSN-REPORT              PIC X(3).
  62.         10  FILLER                        PIC X.
  63.         10  MID-2-SSN-REPORT              PIC XX.
  64.         10  FILLER                        PIC X.
  65.         10  LST-4-SSN-REPORT              PIC X(4).
  66.     05  FILLER                            PIC X(10).
  67.     05  DEPT-NUM-REPORT                   PIC XX.
  68.     05  FILLER                            PIC X(6).
  69.  
  70. WORKING-STORAGE SECTION.
  71.  
  72. 01  PROGRAM-INDICATORS.
  73.     05  MORE-RECORDS  PIC X(3) VALUE 'YES'.
  74.  
  75. PROCEDURE DIVISION.
  76.  
  77. **************************************************************
  78. *                                                            *
  79. * THIS PROGRAM READS THE EMPLOYEE INPUT RECORDS AND PRODUCES *
  80. * A LIST OF NEW EMPLOYEES. IT IS ENTERED FROM THE OPERATING  *
  81. * SYSTEM AND EXITS TO THE OPERATING SYSTEM.                  *
  82. *                                                            *
  83. **************************************************************
  84. A10-CR-EMP-LIST.
  85.     OPEN INPUT EMP-INPUT-FILE.
  86.     OPEN OUTPUT EMP-REPORT-FILE.
  87.     READ EMP-INPUT-FILE
  88.          END
  89.              MOVE 'NO ' TO MORE-RECORDS.
  90.     PERFORM A20-FMT-PRT-RPT
  91.           UNTIL MORE-RECORDS EQUAL 'NO '.
  92.     CLOSE EMP-INPUT-FILE.
  93.     CLOSE EMP-REPORT-FILE.
  94.     STOP RUN.
  95. A20-FMT-PRT-RPT.
  96.     MOVE SPACE TO EMP-REPORT-LINE.
  97.     MOVE FIRST-LETTER-INPUT TO ID-FIRST-LETTER-REPORT.
  98.     MOVE LST-4-SSN-INPUT TO ID-2-5-DIGITS-REPORT.
  99.     MOVE DEPT-NUM-INPUT TO ID-DEPT-NUM-REPORT.
  100.     MOVE NAME-INPUT TO NAME-REPORT.
  101.     MOVE FST-3-SSN-INPUT TO FST-3-SSN-REPORT.
  102.     MOVE MID-2-SSN-INPUT TO MID-2-SSN-REPORT.
  103.     MOVE LST-4-SSN-INPUT TO LST-4-SSN-REPORT.
  104.     MOVE DEPT-NUM-INPUT TO DEPT-NUM-REPORT.
  105.     WRITE EMP-REPORT-LINE
  106.          AFTER ADVANCING 1.
  107.     READ EMP-INPUT-FILE
  108.           END
  109.             MOVE 'NO ' TO MORE-RECORDS.
  110. EOF
  111.