Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28655 Discussions

Difficulty with I/O statement on Fortran Visual Composer XE 2011

kentdeeg
Beginner
211 Views

I'm having difficulty getting the followins I/O work:

The OPEN statement is in the main program:

The OPEN statement OPEN( 5, FILE = "H:\\REPMSS\\TX001.TXT", RECL =72, FORM = "FORMATED"
the "X" is in col 6:X , STATUS = "UNKNOWN" )

THe I/O statement is in a subroutine:
THe I.O statement is: READ( 5,5) (CARD( K ), K = 1, 72 )

iN USING THE debug FACILITY,during execution, it HALTSon the READ statement

I am totally stumped,

kentdeeg

0 Kudos
2 Replies
DavidWhite
Valued Contributor II
211 Views
Can you also post the Format statement which has the label 5, and also the declaration for CARD

Thanks,

David
0 Kudos
TimP
Honored Contributor III
211 Views
Are you testing quality of error recovery? If you just want a program to work, correct the spelling of "FORMATTED".
Why set such a short RECL? As the other response said, you would need to show more. Apparently, your array CARD must be an array of single characters.
Depending on other factors, using OPEN on unit 5 could kill the ability of a program to take input from console. It's generally desirable to use OPEN only with units 10 and above, or to use newunit.
0 Kudos
Reply