program main implicit none open(11, file='file.dat', status='replace') write(11,*) 'aaa' close(11) open(11, file='file.dat', position='append', status='old') write(11,*) 'bbb' close(11) end program main