Is there a way for one program (Program A) to open files, accept input from a screen, then call a second program (Program B) for file processing without Program A closing the files and Program B reopening files?
Declaring the file FD as external in both programs accomplish the desired task:
FD custom-file external. 01 custom-record ....etc
This way the file can be opened and closed in ProgramA and read, write, etc. in ProgramB. ProgramB can not open again the file because it will generate an error.