# Formatted output problem in Fortran

• Fortran
chaimluria
Hello,

I have correctly defined my OPEN and CLOSE statements. When all of my WRITE statements with their associated FORMAT statements are at the end of the program I get the formatted output that I need.

If I move one of the WRITE statements to the body of the program (within a particular DO LOOP) I get a binary output file.

What am I doing wrong. How can I have a WRITE statement in the body of a program and still get formatted output.

Regards,

C. Luria

It would help to see some code, I've never seen something like that. However, rather than having format specifiers, you could try putting the format in the write statement, e.g.
Code:
DO i=1,n
WRITE(10,(2G15.3,A4)) data
END DO

chaimluria
The problem seems to have resolved itself. I must have made some sort of syntax error. Thank you minger for your reply and suggestion.