AS400 RPG: override a file that is defined in Fspec
If the need is to just override the file to a single file then in the F Spec we can define the EXTFILE() EXTMBR() to override the file FDDMF UF A E K DISK EXTFILE(LIB/FILENAME) EXTMBR(MBRA) If the need is to override the file to different file then we need to execute the override command based on the logic. We can use QCMDEXEC to run the CL command so that we dont need another CL program to do Overrides. To override a file that is defined in the F Spec we need to override the file before it is open.. So we need to control the file opening using USROPN option on that file. Run the command to override using QCMDEXEC. The scope of the override has to at job level due to ILE concept and activation group the default scope (Activation Group level) wont work. Then open the file and perform the program logic. At end close the file and delete the override (LVL(*JOB)) F Spec: FDDMF UF A E K DISK PreFix(Ddm_) F