You can use OVRDBF for one or both files as long as the override is executed before the file is opened. Or you can use the EXTFILE(filename) keyword, perhaps with a variable that holds a value in the ‘libname/filename’ format.
The program file names will need to be different from each other.
You can use copies of the file descriptions and rename them to match the program file names in order to compile. (The copies only need the description; members aren’t needed nor is any data needed.) If you can’t create temporary file descriptions to compile over, you can issue OVRDBF commands in the job that does the compile.
Beyond those, use embedded SQL. You can use any file names and library names you need.
file is defined once
I didn’t catch that part when I first read the question. After reading again, I’m not clear on the point of the question.
Why is there a requirement for a single program definition when it’s known that there are two files?
As Tom said, we need more specs.
Do you need to process data from these files as if they were one file
All data from lib1/file then all the data from lib2/file