| 1 |
*> { dg-do run } |
| 2 |
*> { dg-output {we saw 09 records; there should have been 09} } |
| 3 |
identification division. |
| 4 |
program-id. line-seq. |
| 5 |
environment division. |
| 6 |
input-output section. |
| 7 |
file-control. |
| 8 |
select data-file |
| 9 |
assign to |
| 10 |
"data.tab" organization line sequential. |
| 11 |
data division. |
| 12 |
file section. |
| 13 |
fd data-file. |
| 14 |
01 data-record pic x(80). |
| 15 |
working-storage section. |
| 16 |
01 record-count pic 99 value zero. |
| 17 |
procedure division. |
| 18 |
move "I am a line" to data-record |
| 19 |
open output data-file. |
| 20 |
perform 9 times |
| 21 |
write data-record |
| 22 |
end-perform |
| 23 |
close data-file |
| 24 |
open input data-file. |
| 25 |
read-loop. |
| 26 |
read data-file |
| 27 |
at end |
| 28 |
display "we saw " record-count " records; there should" |
| 29 |
" have been 09" |
| 30 |
close data-file |
| 31 |
stop run. |
| 32 |
add 1 to record-count |
| 33 |
go to read-loop. |
| 34 |
end program line-seq. |