Override display files in a CL procedure

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 Override with Display File (OVRDSPF) command are:

OVRDSPF   FILE(overridden-file-name) TOFILE(new-file-name)
          DEV(device-name)

The Override with Display File (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 Override with Display File (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 Send File (SNDF), Receive File (RCVF), or Send/Receive File (SNDRCVF) command need to be in the overriding file. In the following illustration, display file FILEY does not need record format TWO or THREE.


In this illustration, display file FILEY does not need record format TWO or THREE. 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.

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 Send File (SNDF), Receive File (RCVF), and Send/Receive File (SNDRCVF) commands when an Override with Display File (OVRDSPF) command is applied. If *FILE is specified on the DEV parameter of the Receive File (RCVF), Send File (SNDF), or Send/Receive File (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:

Related information
Override with Display File (OVRDSPF) command
Send File (SNDF) command
Receive File (RCVF) command
Send/Receive File (SNDRCVF) command