Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- identification division.
- program-id. lab01c.
- environment division.
- input-output section.
- file-control.
- select infile assign to "lab1c-in.dat"
- organization is line sequential.
- data division.
- file section.
- fd infile.
- working-storage section.
- 01 eof pic x value "n".
- 01 num pic 9(4).
- procedure division.
- 000-main.
- perform 100-initialize
- perform until eof = "y"
- read infile
- at end
- move "y" to eof
- not at end
- perform 500-process
- end-read
- end-perform
- display "the file contained " num " lines of data"
- perform 999-finalize
- stop run.
- 100-initialize.
- open input infile.
- 500-process.
- Add 1 to num.
- 999-finalize.
- close infile.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement