Visual COBOL and RM/COBOL differ in how they handle record length fields and some data fields when you open an RM/COBOL indexed file.
In
Visual COBOL, when you try to open an RM/COBOL indexed file, you may receive either a run-time error
COBRT161 Illegal intermediate code or a file status code 39
A conflict has been detected between the fixed file attributes and the attributes specified for that file in the program.
You must ensure that you read in the same size records that were created in RM/COBOL.
In Visual Studio, hover over the level 01 item of the file description to display the length of the record.
If the length of the file description does not match that which was processed in RM/COBOL, check the following:
- In RM/COBOL, you can set the
RECORD CONTAINS nn CHARACTERS clause to be a different length than the actual length specified in the record description. If this clause is greater than the actual description, you must pad the record description with filler bytes to match the
RECORD CONTAINS clause.
- If you have signed numeric display data in your file,
Visual COBOL will treat the sign as a separate byte if you are using the RM directive without "ANSI" specified. If these fields are stored as sign internal, you must use RM"ANSI" or do not use the RM directive at all.