Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 000001 IDENTIFICATION DIVISION.
- 000002 PROGRAM-ID. AUTO.
- 000003 ENVIRONMENT DIVISION.
- 000004 INPUT-OUTPUT SECTION.
- 000005 FILE-CONTROL.
- 000006 SELECT AUTOFILE ASSIGN TO AUTOF.
- 000007 SELECT OUTPUTFILE ASSIGN TO AUTORES.
- 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 OUTPUTRECORD.
- 000019 02 OKLANTNAAM PIC X(20).
- 000020 02 PIC X.
- 000021 02 OKLANTINIT PIC X(1).
- 000022 02 PIC X.
- 000023 02 OWAGENTYPE PIC X(1).
- 000024 02 PIC X.
- 000025 02 OAFSTAND PIC Z(5).
- 000026 02 PIC X(2).
- 000027 02 ODAGEN PIC ZZZ.
- 000028 02 PIC X(2).
- 000029 02 BETALEN PIC $ZZZZZ.99.
- 000030 WORKING-STORAGE SECTION.
- 000031 01 READCTRL PIC 9 VALUE ZERO.
- 000032 88 EOF VALUE 1.
- 000033 01 DAGPRIJS PIC 99V99.
- 000034 01 KMPRIJS PIC 9V99.
- 000035 01 TOTAAL PIC 9(9)V99.
- 000036 PROCEDURE DIVISION.
- 000037 MAIN.
- 000038 OPEN INPUT AUTOFILE
- 000039 OPEN OUTPUT OUTPUTFILE
- 000040 READ AUTOFILE
- 000041 AT END SET EOF TO TRUE
- 000042 END-READ
- 000043 PERFORM UNTIL EOF
- 000044 MOVE KLANTNAAM TO OKLANTNAAM
- 000045 MOVE KLANTINIT TO OKLANTINIT
- 000046 MOVE AFSTAND TO OAFSTAND
- 000047 MOVE DAGEN TO ODAGEN
- 000048 PERFORM GETWAGENTYPE
- 000049 PERFORM GETPRIJS
- 000050 MOVE TOTAAL TO BETALEN
- 000051 WRITE OUTPUTRECORD END-WRITE
- 000052 READ AUTOFILE
- 000053 AT END SET EOF TO TRUE
- 000054 END-READ
- 000055 END-PERFORM
- 000056 CLOSE AUTOFILE
- 000057 CLOSE OUTPUTFILE
- 000058 STOP RUN
- 000059 .
- 000060 GETWAGENTYPE.
- 000061 EVALUATE WAGENTYPE
- 000062 WHEN 1
- 000063 MOVE 26.00 TO DAGPRIJS
- 000064 MOVE 0.18 TO KMPRIJS
- 000065 MOVE "K" TO OWAGENTYPE
- 000066 WHEN 2
- 000067 MOVE 32.00 TO DAGPRIJS
- 000068 MOVE 0.22 TO KMPRIJS
- 000069 MOVE "M" TO OWAGENTYPE
- 000070 WHEN 3
- 000071 MOVE 43.00 TO DAGPRIJS
- 000072 MOVE 0.28 TO KMPRIJS
- 000073 MOVE "G" TO OWAGENTYPE
- 000074 END-EVALUATE
- 000075 .
- 000076 GETPRIJS.
- 000077 IF AFSTAND > 100 THEN
- 000078 COMPUTE TOTAAL = DAGPRIJS * DAGEN +
- 000079 (KMPRIJS * (AFSTAND - 100))
- 000080 ELSE
- 000081 COMPUTE TOTAAL = DAGPRIJS * DAGEN
- 000082 END-IF
- 000083 .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement