- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using the same subroutine to open and read unformatted files in two different programs, built on a Win2000 machine using CVF 6.6a. The files have been created on a VMS machine, with a fixed record length.
The following code, which is part of a subroutine, is used to examine the properties of the files and open them:
The two programs report different properties for the same file:
Program A: exists=.True., recl=0, Recordtype=UNKNOWN and the Open command is successful.
Program B: exists=.True., recl=132, Recordtype=STREAM_LF and the Open command fails with IoStat=30
I looked carefully the compiler and linker options, but they look the same.
Any clue, where to look for a solution.
The following code, which is part of a subroutine, is used to examine the properties of the files and open them:
Open( Unit = FileLun, & ! try to open exisiting file File = FileName, & Form = 'UNFORMATTED', & IoStat = IoStat, & !dvf Recl = 512, ! VMS Recl = 128, & ! CVF RecordType = 'FIXED', & Shared, & Status = 'OLD')
The two programs report different properties for the same file:
Program A: exists=.True., recl=0, Recordtype=UNKNOWN and the Open command is successful.
Program B: exists=.True., recl=132, Recordtype=STREAM_LF and the Open command fails with IoStat=30
I looked carefully the compiler and linker options, but they look the same.
Any clue, where to look for a solution.
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just noticed, that the inquire command has been left out from the code posted. Please add the following line in front of the Open statement:
INQUIRE (FILE = FileName, EXIST = exists, recl=recl, recordtype=recordtype)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Take off the IOSTAT and see what error you get.
Note that RECL= in INQUIRE isn't useful for non-opened files on Windows.
Steve
Note that RECL= in INQUIRE isn't useful for non-opened files on Windows.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following error was observed after removing the IoStat from the open statement:
There is no other process running, which wants to open this file. Restarting the computer and running the application gives the same error.
forrtl: The process cannot access the file because it is being used by another process. forrtl: severe (30): open failure, unit 11, file C:RE179TG.SPC
There is no other process running, which wants to open this file. Restarting the computer and running the application gives the same error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, something has the file open - perhaps it is opened in the same program on another unit?
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
You are right. The file has been opened by the program using a different unit number. Interestingly it did not cause any problem on the VMS system, where the program has been developed.
You are right. The file has been opened by the program using a different unit number. Interestingly it did not cause any problem on the VMS system, where the program has been developed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If all your OPENs use same options, I would still suspect an external agent. If all units are open shared that should work on either OS.
James
James
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page