Advertisement
jelledebock

CVADDR programma

Oct 31st, 2014
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
COBOL 0.78 KB | None | 0 0
  1. IDENTIFICATION DIVISION.
  2. PROGRAM-ID.CVADDR.
  3. AUTHOR.JELLE.
  4. ENVIRONMENT DIVISION.
  5. INPUT-OUTPUT SECTION.
  6. FILE-CONTROL.
  7. FD INVOER.
  8. 01 INPUT-REC PIC x(101).
  9.     88 EOF VALUE HIGH-VALUES.
  10. FD UITVOER.
  11. 01 OUTPUT-REC.
  12.     05 CLIENT-NAME      PIC x(35).
  13.     05 CLIENT-ADDRESS   PIC x(60).
  14.     05 CLIENT-NUMBER    PIC x(4).
  15.     05 UNUSED           PIC x(2).
  16. WORKING-STORAGE SECTION.
  17. PROCEDURE DIVISION.
  18. MAIN.
  19.     OPEN INPUT INVOER
  20.     PERFORM 1000-READ
  21.     PERFORM UNTIL EOF
  22.         PEFORM 2000-PROCESS-RECORD
  23.         PERFORM 1000-READ
  24.     END-PERFORM
  25.     CLOSE INVOER
  26.         UITVOER
  27.     STOP RUN
  28.     .
  29. 1000-READ.
  30.     READ INVOER
  31.         AT END
  32.             SET EOF TO TRUE
  33.     END READ
  34.     .
  35. 2000-PROCESS-RECORD.
  36.     UNSTRING INPUT-REC
  37.         DELIMITED BY ","
  38.         INTO
  39.         CLIENT-NAME
  40.         CLIENT-ADDRESS
  41.         CLIENT-NUMBER
  42.     MOVE SPACES  TO UNUSED
  43.     WRITE OUTPUT-REC
  44.     .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement