You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
38 <strong>File</strong> <strong>Management</strong> V4R5<br />
The following topics provide additional information about how overrides work on<br />
AS/400 and how they affect and are affected by different events:<br />
v “How the system processes overrides” on page 40<br />
v “Effect of exits on overrides: scenario” on page 48<br />
v “Effect of TFRCTL on overrides-Scenario” on page 49<br />
v “Overrides to the same file at the same call level: scenario 1” on page 49<br />
v “Overrides to the same file at the same call level: scenario 2” on page 49<br />
v “CL program overrides” on page 50<br />
v “Securing files against overrides” on page 51<br />
v “Using a generic override for printer files” on page 51<br />
v “Applying overrides when compiling a program” on page 53<br />
Overriding file attributes<br />
The simplest form of overriding a file is to override some attributes of the file. <strong>File</strong><br />
attributes are built as a result of the following:<br />
v Create file and add member commands. Initially, these commands build the file<br />
attributes.<br />
v Program using the files. At compile time, the user program can specify some of<br />
the file attributes. (The attributes that you can specify depend on the high-level<br />
language in which the program is written.)<br />
v Override commands. At the time when a program runs, these commands can<br />
override the file attributes previously built by the merging of the file description<br />
and the file parameters specified in the user program.<br />
For example, assume that you create a printer file OUTPUT whose attributes are:<br />
v Page size of 60 by 80<br />
v Six lines per inch<br />
v Two copies of printed output<br />
v Two pages for file separators<br />
v Overflow line number of 55<br />
The Create Printer <strong>File</strong> (CRTPRTF) command looks like this:<br />
CRTPRTF FILE(QGPL/OUTPUT) SPOOL(*YES) +<br />
PAGESIZE(60 80) LPI(6) COPIES(2) +<br />
FILESEP(2) OVRFLW(55)<br />
You specify the printer file OUTPUT in your application program with an overflow<br />
line number of 58 and a page size of 66 by 132.<br />
However, before you run the application program, you want to change the number<br />
of printed copies to 3, and the overflow line to 60. The override command looks<br />
like this:<br />
OVRPRTF FILE(OUTPUT) COPIES(3) OVRFLW(60)<br />
Then you call the application program, and three copies of the output print.<br />
When the application program opens the OUTPUT file, the system merges the<br />
file-specified attributes, program-specified attributes, and override-specified<br />
attributes to form the open data path. The system uses the open data path when<br />
the program runs. The system merges file-specified overrides with the<br />
program-specified attributes first. Then it merges these merged attributes with the