! Program Example from "Essential Fortran 90 & 95" by Loren P. Meissner
! Copyright 1996. Copying for sale requires permission from the author.
! Otherwise, distribution is permitted if these three lines are included.

! Example 6.9. Substring notation for a single character (initials).
  program G09
    implicit none
    integer, parameter :: SL = 12
    integer :: EoF
    character (len = SL) :: Name
! start program G09
    open (unit = 11, file = "roster.txt", status = "old", action = "read", position = "rewind")
    do
      read (unit = 11, fmt = *, iostat = EoF) Name
      if (EoF < 0) then
        exit
      end if
      write (unit = *, fmt = *) Name(1: 1), " ", Name
    end do
    stop
  end program G09
