When using MPE file equations, you must exercise caution if you are also using the ACUCOBOL-GT FILE_PREFIX or FILE_SUFFIX run-time configuration variables. This is because the runtime prepends the FILE_PREFIX and appends the FILE_SUFFIX strings to the name of the file specified in the SELECT statement. As a result, this name no longer matches the name specified in the file equation. This can result in errors when the run-time tries to access the file.
For example, if you have a SELECT statement such as:
SELECT MYFILE ASSIGN TO "MYFILE"
And you have a file equation such as:
FILE MYFILE=FILEX
And you have a configuration variable such as:
FILE_PREFIX /ACUCOBOL/DATA
The run-time attempts to open a file called /ACUCOBOL/DATA/MYFILE when it should have been opening a file called MYFILE.
To prevent this renaming from happening, you can one of these:
SELECT MYFILE ASSIGN TO "-F MYFILE"
The -F in both cases tells the runtime to use the name as it appears and not to prepend the FILE_PREFIX to the name of the file. The open then treats MYFILE as a file equation and should find the correct file.