Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 000001 IDENTIFICATION DIVISION.
- 000002 PROGRAM-ID. AUTO2.
- 000003 ENVIRONMENT DIVISION.
- 000004 INPUT-OUTPUT SECTION.
- 000005 FILE-CONTROL.
- 000006 SELECT AUTOFILE ASSIGN TO AUTOF2.
- 000007 SELECT OUTPUTFILE ASSIGN TO AUTORES2.
- 000008 DATA DIVISION.
- 000009 FILE SECTION.
- 000010 FD AUTOFILE.
- 000011 01 AUTORECORD.
- 000012 02 KLANTNAAM PIC X(20).
- 000013 02 KLANTINIT PIC X(1).
- 000014 02 WAGENTYPE PIC X(1).
- 000015 02 AFSTAND PIC 9(5).
- 000016 02 DAGEN PIC 9(3).
- 000017 FD OUTPUTFILE.
- 000018 01 FILERECORD PIC X(46).
- 000019 WORKING-STORAGE SECTION.
- 000020 01 OUTPUTRECORD.
- 000021 02 FILLER PIC X(23).
- 000022 02 OWAGENTYPE PIC X(1).
- 000023 02 PIC X.
- 000024 02 OAFSTAND PIC Z(5).
- 000025 02 PIC X(2).
- 000026 02 ODAGEN PIC ZZZ.
- 000027 02 PIC X(2).
- 000028 02 BETALEN PIC $ZZZZZ.99.
- 000029 01 TITEL.
- 000030 02 FILLER PIC X(5).
- 000031 02 TITKLANT PIC X(20).
- 000032 02 TITINIT PIC X(1).
- 000033 02 FILLER PIC X(20).
- 000034 01 TOTAALLIJN.
- 000035 02 FILLER PIC X(10).
- 000036 02 TOTAL PIC X(7).
- 000037 02 TBETALEN PIC $ZZZZZ.99.
- 000038 02 FILLER PIC X(10).
- 000039
- 000040 01 READCTRL PIC 9 VALUE ZERO.
- 000041 88 EOF VALUE 1.
- 000042 01 DAGPRIJS PIC 99V99.
- 000043 01 KMPRIJS PIC 9V99.
- 000044 01 TOTAAL PIC 9(9)V99.
- 000045 01 SUBTOTAAL PIC 9(9)V99.
- 000046 01 CURCLIENT PIC X(20).
- 000047
- 000048 PROCEDURE DIVISION.
- 000049 MAIN.
- 000050 OPEN INPUT AUTOFILE
- 000051 OPEN OUTPUT OUTPUTFILE
- 000052 READ AUTOFILE
- 000053 AT END SET EOF TO TRUE
- 000054 END-READ
- 000055 PERFORM UNTIL EOF
- 000056 MOVE ZERO TO TOTAAL
- 000057 MOVE KLANTNAAM TO CURCLIENT
- 000058 MOVE KLANTNAAM TO TITKLANT
- 000059 MOVE KLANTINIT TO TITINIT
- 000060 MOVE TITEL TO FILERECORD
- 000061 WRITE FILERECORD END-WRITE
- 000062
- 000063 PERFORM UNTIL KLANTNAAM IS NOT EQUAL TO CURCLIENT OR
- 000064 EOF
- 000065 PERFORM GETWAGENTYPE
- 000066 PERFORM GETPRIJS
- 000067 MOVE AFSTAND TO OAFSTAND
- 000068 MOVE DAGEN TO ODAGEN
- 000069 MOVE SUBTOTAAL TO BETALEN
- 000070 MOVE OUTPUTRECORD TO FILERECORD
- 000071 WRITE FILERECORD END-WRITE
- 000072
- 000073 READ AUTOFILE
- 000074 AT END SET EOF TO TRUE
- 000075 END-READ
- 000076 END-PERFORM
- 000077 MOVE "TOTAL: " TO TOTAL
- 000078 MOVE TOTAAL TO TBETALEN
- 000079 MOVE TOTAALLIJN TO FILERECORD
- 000080 WRITE FILERECORD END-WRITE
- 000081 END-PERFORM
- 000082 CLOSE AUTOFILE
- 000083 CLOSE OUTPUTFILE
- 000084 STOP RUN
- 000085 .
- 000086 GETWAGENTYPE.
- 000087 EVALUATE WAGENTYPE
- 000088 WHEN 1
- 000089 MOVE 26.00 TO DAGPRIJS
- 000090 MOVE 0.18 TO KMPRIJS
- 000091 MOVE "K" TO OWAGENTYPE
- 000092 WHEN 2
- 000093 MOVE 32.00 TO DAGPRIJS
- 000094 MOVE 0.22 TO KMPRIJS
- 000095 MOVE "M" TO OWAGENTYPE
- 000096 WHEN 3
- 000097 MOVE 43.00 TO DAGPRIJS
- 000098 MOVE 0.28 TO KMPRIJS
- 000099 MOVE "G" TO OWAGENTYPE
- 000100 END-EVALUATE
- 000101 .
- 000102 GETPRIJS.
- 000103 IF AFSTAND > 100 THEN
- 000104 COMPUTE TOTAAL = TOTAAL + DAGPRIJS * DAGEN +
- 000105 (KMPRIJS * (AFSTAND - 100))
- 000106 COMPUTE SUBTOTAAL = DAGPRIJS * DAGEN
- 000107 + (KMPRIJS * (AFSTAND - 100))
- 000108 ELSE
- 000109 COMPUTE TOTAAL = TOTAAL + DAGPRIJS * DAGEN
- 000110 COMPUTE SUBTOTAAL = DAGPRIJS * DAGEN
- 000111 END-IF
- 000112 .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement