Application of overrides
You can perform two general types of overrides, which are file overrides and overrides for program device entries.
- File overrides
- File overrides let you override the following things:
- File attributes
- File names
- File attributes and file names simultaneously
- File open scope
- File types
For more information about overriding file types, see File redirection.
- Overrides for program device entries
Overrides for program device entries let you override the attribute of an ICF file that provides the link between the application and each of the remote servers or devices with which your program communicates. For more information about overrides on program device entries, see the ICF Programming
book.
- Override of file attributes
Overriding file attributes is the simplest form of overriding a file.
- Override of file names
Overriding file names is another simple form that you change the file used by the program. This might be useful for files that you moved or renamed after the program compiled.
- Override of file names and file attributes
This form of overriding files is a combination of overriding file attributes and overriding file names. With this form of override, you can override the file that is to be used in a program and you can also override the attributes of the overriding file.
- Override of the scope of an open file
The open scope (OPNSCOPE) parameter on the appropriate override command enables you to change the scope of a file open operation. The values for the OPNSCOPE parameter can be either *JOB or *ACTGRPDFN (default).
- How the system processes overrides
In the Integrated Language Environment®, overrides can be scoped to the call level, the activation-group level (the default), and the job level.
- Scenario: Effect of exits on overrides
Exits (ENDPGM, RETURN, or abnormal exits) from a call operation delete overrides that are scoped to that call level. However, they do not delete overrides that are issued in that call level that are scoped to the activation group level or the job level.
- Scenario: Effect of TFRCTL on overrides
The TFRCTL command replaces one program with another program at the same call level. The program to which control is transferred runs at the same call level as the program that contained the TFRCTL command. An override command in a program that transfers control to another program is not deleted during the transfer of control.
- Scenario: Overrides to the same file at the same call level
When you enter two overrides for the same file name at the same call level, the second override replaces the first override. This allows you to replace an override at a single call level, without having to delete the first override.
- CL program overrides
If a control language (CL) program overrides a file and then calls a high-level language program, the override remains in effect for the high-level language program.
- Securing files against overrides
On occasion, you might want to prevent the person or program that calls your program from changing the file names or attributes you have specified. You can prevent additional file overrides by coding the SECURE(*YES) parameter on a file override command for each file that needs protection. This protects your file from overrides at lower call levels, the activation group level, and the job level.
- Usage of a generic override for printer files
The OVRPRTF command allows you to have one override for all the printer files in your job with the same set of values. Without the generic override, you would need to do a separate override for each of the printer files.
- Application of overrides when compiling a program
Overrides can be applied at the time a program is being compiled for either of two purposes: to select the source file, or to provide external data definitions for the compiler to use in defining the record formats to be used on I/O operations.
Parent topic:
Overrides
Related concepts
File types
File redirection
Related information