You can use the Override with Display File (OVRDSPF) command to replace the display file named in a CL procedure or program or to change certain parameters of the existing display file. This may be especially useful for files that have been renamed or moved since the module or program was compiled.
The initial parameters of the OVRDSPF command are:
OVRDSPF FILE(overridden-file-name) TOFILE(new-file-name) DEV(device-name)
The OVRDSPF command is valid for a file referred to by a CL procedure or program only if the file specified on the DCLF command was a display file when the module or program was created. The file used when the program is run must be of the same type as the file referred to when the module or program was created.
You must run the OVRDSPF command before opening the file that is being overridden. An open is caused by the first use of a send or receive command. The system overrides the file on finding any of the following conditions:
When you override to a different file, only those record format names
referred to on the SNDF, RCVF, or SNDRCVF command need to be in the overriding
file. In the following illustration, display file FILEY does not need
record format TWO or THREE.
You should make sure that the record format referred to names of the original file and the overriding files have the same field definitions and indicator names in the same order. You may get unexpected results if you specify LVLCHK(*NO).
Another consideration has to do with the DEV parameter on the SNDF, RCVF, and SNDRCVF commands when an OVRDSPF command is applied. If *FILE is specified on the DEV parameter of the RCVF, SNDF, or SNDRCVF command, the system automatically directs the operation to the correct device for the overridden file. If a specific device is specified on the DEV keyword of the RCVF, SNDF, or SNDRCVF command, one of the following may occur:
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.