program test

implicit none

!character(len=20) :: str
integer :: str
integer :: iostat

open(unit=2, file='data') 
do 
  read(2,*,iostat=iostat) str
  print*, iostat, str
  if (iostat < 0) exit
end do

end program test
