      PROGRAM single_column
*     save data in a single column
*     file$ example of string variable
      IMPLICIT NONE
      REAL*8 i, x, y
      INTEGER IO1_, IO2_
      CHARACTER*80 file
      DATA IO1_/11/
      DATA IO2_/12/
      WRITE(*,'(A,$)') 'name of file for data? '
      READ(*,'(A)') file
*     channel number #1 associated with file and can be passed to
*     subroutines
*     various options may be specified in OPEN statement
*     access output: write to file only
*     create newold: open file if exists, else create new file
      OPEN(IO1_, file = file)
*     True BASIC does not overwrite data in a text file
*     ERASE #1                          ! erase contents of file
*     RESET #1: end   ! allows data to be added to end of file
      DO i = 1, 4
         x = i*i
         WRITE(IO1_,*) x                    ! print column of data
      END DO
      CLOSE(IO1_)
*     channel # irrelevant if only one open at a time
*    
      OPEN(IO2_, file = file)
      DO i = 1, 4
         READ(IO2_,*) y                     ! input column of data
         WRITE(*,*) y
      END DO
*     files automatically closed when program terminates
      CLOSE(IO2_)
      END
