Fortran :: Syntax error in OPEN statement at (1)
<p>I was trying to test my cryptography algorithm by [diehard tests] (<a href="http://stat.fsu.edu/pub/diehard/" rel="nofollow noreferrer">http://stat.fsu.edu/pub/diehard/</a>), that I realized my input file must be an unformatted and direct access file.
So I tried to write a simple program in Fortran to read from a file and write it to another.</p>

<p>First of all, is it the only way to make an unformatted or direct access file ?</p>

<p>If it is so, I've got this Error</p>

<pre><code>     open(unit=2, file='unf.BIN',RECL=rl , form='UNFORMATTED', access='direct')
                                                                 1
</code></pre>

<p>Error: Syntax error in OPEN statement at (1)</p>

<p>I use RECL because of some missing RECL parameter in <code>Open</code> statement errors.(<a href="https://stackoverflow.com/questions/720319/fortran-90-compiling-program-error-messages">Fortran 90, Compiling program: Error messages</a>)</p>

<p>Here is my Fortran code:</p>

<pre><code>    program BinaryWriter
    implicit none

    integer :: i
    integer :: p

    open(unit=1,file='encout')
    open(unit=2, file='unf.BIN',RECL=rl , form='UNFORMATTED', access='direct')

    do i=1 ,256
        read (8,'(i1)') p
        write(*,*) p
    end do

    close(1)
    close(2)

    end program BinaryWriter
</code></pre>