Created On:  18 July 2012


Customer has RM/COBOL application and data files that they are converting to Visual COBOL.

They used the Sample conversion program RMMFDataMigration to convert an indexed file from RM format to Visual COBOL format.  When attempting to open the file in a Visual COBOL program it returned a file status value of "39" which means that a fixed file attribute conflict had occurred.

This means that the description of the file in the program did not match the physical attributes specified in the file itself.  What could be the problem?


You should run the Visual COBOL Rebuild.exe command against the file to see what the physical attributes are for the file.  You can then modify the COBOL source to match the physical attributes.

From a Visual COBOL command prompt run:

rebuild filename.dat /n

Where filename.dat should be replaced by the actual name of your file.

Check that the key position and lengths match up.

Record length is also important.

Run the program in debug mode and hover over the record description for the file to check the length of the record.

In this particular instance the recording mode reported by rebuild was Variable and the program did not contain a recording mode is variable clause in the file's FD.

Adding the record mode is variable clause to the FD fixed the issue and the file could then be opened.

An alternative to actually adding the recording mode variable clause to the source code is to set the compiler directive RECMODE"V" either in the project properties or in a $SET statement at the top of the source code.
Incident #2583542