Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- identification division.
- program-id. assignment-4-if.
- environment division.
- input-output section.
- file-control. select vehicle-data assign to
- "C:\temp\vehicle-data.txt"
- organization is line
- sequential.
- select output-data assign to
- "C:\temp\output-data.txt".
- configuration section.
- data division.
- fd vehicle-data.
- 01 vehicle-record.
- 05 vin pic x(17).
- 05 make pic x(13).
- 05 v-type pic x(5).
- 05 year pic 9(4).
- fd output-data.
- 01 output-record.
- 05 vin-out pic x(17).
- 05 filler pic x(1).
- 05 make-out pic x(13).
- 05 filler pic x(1)
- 05 type-out pic x(5).
- 05 filler pic x(1).
- 05 year-out pic 9(4).
- working-storage section.
- 01 end-flag pic x(3) value "YES".
- procedure division.
- 100-main.
- open input vehicle-data
- output output-data
- perform until end-flag = "NO"
- read vehicle-data
- at end move "NO" to end-flag
- not at end perform 150-check-year
- end-read
- end-perform
- close vehicle-data
- output-data
- goback.
- 150-check-year.
- move spaces to output-record
- if year < 2010
- move vin to vin-out
- move make to make-out
- move v-type to type-out
- move year to year-out
- write output-record after advancing 1 line
- end-if.
- end program assignment-4-if.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement