home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / cobol / compiler / cobol650 / cobsrc / prog501.cob < prev    next >
Text File  |  1990-09-02  |  3KB  |  88 lines

  1.        IDENTIFICATION DIVISION.
  2.       *
  3.        PROGRAM-ID. PROG501.
  4.       *
  5.        DATE-WRITTEN. 08/13/90.
  6.       *
  7.        AUTHOR. BOB NOWECK.
  8.       *
  9.        SECURITY. NONE.
  10.       *
  11.       *
  12.        ENVIRONMENT DIVISION.
  13.       *
  14.        INPUT-OUTPUT SECTION.
  15.       *
  16.        FILE-CONTROL.
  17.       *
  18.            SELECT EMPLOYEE-ADDRESS-MASTER
  19.                   ASSIGN TO DISK
  20.                   ORGANIZATION IS LINE SEQUENTIAL.
  21.       *
  22.            SELECT EMPLOYEE-ADDRESS-PRINT
  23.                   ASSIGN TO PRINTER.
  24.       *
  25.       *
  26.        DATA DIVISION.
  27.       *
  28.        FILE SECTION.
  29.       *
  30.        FD  EMPLOYEE-ADDRESS-MASTER
  31.            LABEL RECORDS STANDARD
  32.            VALUE OF FILE-ID IS "FIOPRT.DAT".
  33.        01  EMPLOYEE-ADDRESS-MASTER-RECORD.
  34.            05  EMPLOYEE-ADDRESS-MASTER-NAME            PIC  X(30).
  35.            05  EMPLOYEE-ADDRESS-MASTER-STREET          PIC  X(30).
  36.            05  EMPLOYEE-ADDRESS-MASTER-CITY            PIC  X(30).
  37.       *
  38.        FD  EMPLOYEE-ADDRESS-PRINT
  39.            LABEL RECORDS OMITTED.
  40.        01  EMPLOYEE-ADDRESS-PRINT-LINE                PIC  X(30).
  41.       *
  42.       *
  43.        WORKING-STORAGE SECTION.
  44.       *
  45.        01  W005-END-OF-FILE-SWITCH                    PIC X.
  46.            88  W005-END-OF-FILE                       VALUE "1".
  47.        01  W005-LINE-SKIP                             PIC 99.
  48.       *
  49.        PROCEDURE DIVISION.
  50.       *
  51.        C000-MAIN-LINE-LOGIC.
  52.       *
  53.            OPEN INPUT EMPLOYEE-ADDRESS-MASTER
  54.                 OUTPUT EMPLOYEE-ADDRESS-PRINT.
  55.            MOVE "0" TO W005-END-OF-FILE-SWITCH.
  56.            PERFORM C060-READ-EMPLOYEE-MASTER.
  57.            PERFORM C020-PROCESS-EMPLOYEE-MASTER
  58.                 UNTIL W005-END-OF-FILE.
  59.            CLOSE EMPLOYEE-ADDRESS-MASTER
  60.                  EMPLOYEE-ADDRESS-PRINT.
  61.            STOP RUN.
  62.       *
  63.        C020-PROCESS-EMPLOYEE-MASTER.
  64.       *
  65.            MOVE EMPLOYEE-ADDRESS-MASTER-NAME
  66.                          TO EMPLOYEE-ADDRESS-PRINT-LINE.
  67.            MOVE 3        TO W005-LINE-SKIP.
  68.            PERFORM C040-WRITE-DETAIL-LINE.
  69.            MOVE EMPLOYEE-ADDRESS-MASTER-STREET
  70.                          TO EMPLOYEE-ADDRESS-PRINT-LINE.
  71.            MOVE 3        TO W005-LINE-SKIP.
  72.            PERFORM C040-WRITE-DETAIL-LINE.
  73.            MOVE EMPLOYEE-ADDRESS-MASTER-CITY
  74.                          TO EMPLOYEE-ADDRESS-PRINT-LINE.
  75.            MOVE 3        TO W005-LINE-SKIP.
  76.            PERFORM C040-WRITE-DETAIL-LINE.
  77.            PERFORM C060-READ-EMPLOYEE-MASTER.
  78.       *
  79.        C040-WRITE-DETAIL-LINE.
  80.       *
  81.            WRITE EMPLOYEE-ADDRESS-PRINT-LINE
  82.                          AFTER ADVANCING W005-LINE-SKIP LINES.
  83.       *
  84.        C060-READ-EMPLOYEE-MASTER.
  85.       *
  86.            READ EMPLOYEE-ADDRESS-MASTER
  87.                 AT END, MOVE "1" TO W005-END-OF-FILE-SWITCH.
  88.