VMS to Windows2000

VMS to Windows2000

I have a Fortran program which had been running on VMS that I have ported to a Windows 2000 computer. The program processes image data from an ARC NEMA ver 2.0 file. The read statement which opens the file specifies sequential, variable record length. The file is read to a buffer where the header info is separated from the binary image data. The error message "input statement requires too much data" is displayed. What must I specify so that this ACR NEMA file can be successfully read?

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I suggest you look at this Knowledge Base article on reading sequential unformatted files

Depending on how the file was transferred to Windows, you may have corrupted the file by losing the record length information. If you still have the file on VMS, you can use this program to convert the file to one that Visual Fortran can read.

Steve

Steve - Intel Developer Support

Just a note here, the file probably doesn't need to be converted... You probably don't need the recordtype='variable' specifier at all with formatted i/o. This would fix your problem if you are FTPing in ascii mode, and keep the code the same on both operating systems.

James

The file that I need to process is an ACR-NEMA
image file which is generated on a Mac. I tried converting the Mac file to binary before sending it to the PC (using TCP/IP (PC-Mac-Net software)). The Fortran now accesses the file but hangs up in the read statement and eventually displays the message "Incrementally linked image - PC correlation disabled".

Chances are that if you are transferring binary mode from a Mac you are eliminating record length information and/or record delimiters (or they are of a form not expected by the RTL). Thus the READ may be interpreting the first part of the data as a length which may send it to who knows where.

I'm not familiar with the format you are using, but the question is how did you transfer it to VMS where this presumably worked? Also you might try something like ZIPping the file before transferring, or see what you can do with a text mode transfer. The latter may at least give you something you can use with a formatted read, where the PC end would then have each line delimited.

James

The image files are transferred to the VAX using Appletalk. We run the FILES utility on the VAX and convert the image file to fixed, 512-byte record length.

Ah - very helpful information.

Ok, so what you have is in essence a byte stream. How did you read this on VMS?

If I understand what you have correctly (not sure I do), the most appropriate way of reading the file with CVF is to open it FORM='BINARY' and do unformatted READs. Each READ will read only as many bytes as the size of the variables in the I/O list, and no record structure or implied record length is assumed.

Steve

Steve - Intel Developer Support

Setting form=binary works, at least on files transferred from the VAX (which have been converted to 512 fixed-length records). Files which have not been converted (that is, sent as binary files from the Mac) produce run-time math errors which I think has to do with the way the program is written in terms of dealing with the slightly varying length image headers. Some of the header info may be getting into what should be the image data. Since the image data is always a fixed length and is always at the end of the file, how can I read only these records?

Leave a Comment

Please sign in to add a comment. Not a member? Join today