PROGRAM Personnel
    IMPLICIT NONE
    INTEGER, DIMENSION(20) :: index
    INTEGER :: iostat, count, n
    CHARACTER(LEN=10), DIMENSION(20) :: name
    REAL, DIMENSION(6,20) :: values
    CHARACTER(LEN=*), PARAMETER :: format = &
        "('Personnel data' / (I4,': ',A12,6F6.3))"

    OPEN (UNIT=69, FILE='Programs/people.data', ACTION='read', &
        IOSTAT=iostat)
    IF (iostat /= 0) THEN
        PRINT *, "Unable to open the file"
        STOP 1
    END IF
    count = 0
    DO n = 1,20
        READ(UNIT=69,FMT=*,IOSTAT=iostat) index(n), name(n), values(:,n)
        IF (iostat < 0) THEN
            EXIT
        ELSE IF (iostat > 0) THEN
            PRINT *, "There was some sort of I/O error"
            STOP 1
        END IF
        count = n
    END DO
    WRITE(UNIT=*,FMT=format) (index(n),name(n),values(:,n), n=1,count)
END PROGRAM Personnel
