File Management - IBM
File Management - IBM File Management - IBM
46 File Management V4R5 Override 1 OVRDKTF FILE(PRTA) TOFILE(DKB) + LABEL(DKFIRST) CALL PGM(A) Program A Override 2 OVRPRTF FILE(DKA) TOFILE(PRTA) + SPOOL(*YES) CALL PGM(B) Program B Override 3 OVRDKTF FILE(PRTB) TOFILE(DKA) + DEV(DKT02) LABEL(DKLAST) Override 4 OVRDKTF FILE(DKA) TOFILE(DKC) + DEV(DKT02) LABEL(DKTTST) CALL PGM(C) Program C Override 5 OVRPRTF FILE(DKA) + TOFILE(PRTB) + SCHEDULE(*JOBEND) CALL PGM(D) Program D Override 6 OVRDKTF FILE(DKA) + VOL(MASTER) CALL PGM(MAKEMASTER) Program MAKEMASTER (Program MAKEMASTER attempts to open file DKA, but actually opens the diskette file DKB.) In the preceding example, the file that program MAKEMASTER actually opens is the diskette file DKB because of the following reasons: v Override 6, which is applied first, does not cause file DKA to be overridden with any other file. v Override 5, which is applied second, causes file DKA to be overridden with printer file PRTB. v Override 4 is ignored at this level because override 5 changed the file name to PRTB. v Override 3, which is applied third, causes file PRTB to be overridden with diskette file DKA. v Override 2, which is applied fourth, causes file DKA to be overridden with printer file PRTA. v Override 1, which is applied last, causes file PRTA to be overridden with diskette file DKB. Therefore, the file that program MAKEMASTER opens is the diskette file DKB. Because file DKB is a diskette file, the system overrides only those attributes that are specified on the Override with Diskette File (OVRDKTF) commands: VOL(MASTER) from override 6; DEV(DKT02) from override 3; and LABEL(DKFIRST) from override 1.
The attributes specified on the Override with Printer File (OVRPRTF) commands are ignored (even though they might have been allowed on the OVRDKTF commands). Refer to “Redirecting files” on page 64 for more information on the effect of overrides that change the file type. Processing overrides: General principles The system processes overrides according to the following general principles: v Overrides applied include any that are in effect at the time a file is opened by an application program, when a program that opens a file is compiled, or when certain system commands are used. (See “Overriding file attributes” on page 38, “Applying overrides when compiling a program” on page 53, and “Effect of overrides on some commands” on page 35). Thus, any overrides that are to be applied must be specified either before the file is opened by a program or before a program that opens the file is compiled. It is not necessary that overrides must be supplied for every file that is used in a program. Any file name for which no override is supplied is used as the actual file name. v Override commands that are scoped to the job level remain in effect until they are replaced, deleted, or until the job in which they are specified ends. For more information on deleting overrides, see “Deleting overrides” on page 54. v There can be only one active override for a file at each level (job level, activation group level, or call level). If more than one override for the same file exists at the same level, the most recent one is active. For an example of how the system processes overrides when more than one override for the same file exists at the same level, see “Overrides to the same file at the same call level: scenario 1” on page 49. v Override commands that are scoped to the job level apply to all programs that are running in the job regardless of the call level or activation group in which the overrides are specified. v Override commands that are scoped to an activation group level apply to all programs that are running in the activation group regardless of the call level in which the overrides are specified. v An override command (scoped to the call level) that is entered interactively exists at the call level for the caller of that command processor. For example, an override (scoped to the call level) that is entered on the command entry display cannot be deleted or replaced from a command processor that is called from the command entry display. v The call level of an override (scoped to the call level) that is coded in a CL program is the call level of the CL program. v An override (scoped to the call level) outside a program in a batch job takes the call level of the batch job command processor. v If an override command (scoped to the call level) is run using a call to the QCMDEXC program, the override takes the call level of the program that called the QCMDEXC program. For an example, see “CL program overrides” on page 50. v Exits (ENDPGM, RETURN, or abnormal exits) from a call operation delete overrides scoped to that call level. However, they do not delete overrides that are issued in that call level when they are scoped to the activation group level or the job level. For an example, see “Effect of exits on overrides: scenario” on page 48. v The TFRCTL command causes one program to be replaced by another program at the same call level. The program, to which control is transferred, runs at the Chapter 3. Using overrides 47
- Page 6 and 7: | | | | | Special considerations fo
- Page 8 and 9: vi File Management V4R5
- Page 10 and 11: viii File Management V4R5
- Page 12 and 13: 2 File Management V4R5 v Distribute
- Page 14 and 15: Table 1. File Types and Their Main
- Page 16 and 17: Table 2. High-Level Languages and T
- Page 18 and 19: | | Table 3. High-Level Languages a
- Page 20 and 21: Add Add new records to the file. Up
- Page 22 and 23: | Sharing files 12 File Management
- Page 24 and 25: 14 File Management V4R5 For example
- Page 26 and 27: 16 File Management V4R5 File resour
- Page 28 and 29: 18 File Management V4R5 v “Displa
- Page 30 and 31: Application 1 Application 2 Applica
- Page 32 and 33: 22 File Management V4R5 LVLCHK(*NO)
- Page 34 and 35: The open feedback area also contain
- Page 36 and 37: 26 File Management V4R5 Table 6. OS
- Page 38 and 39: 28 File Management V4R5 Table 7. Ma
- Page 40 and 41: 30 File Management V4R5 Depending o
- Page 42 and 43: 32 File Management V4R5
- Page 44 and 45: 34 File Management V4R5 Handling ov
- Page 46 and 47: 36 File Management V4R5 output queu
- Page 48 and 49: 38 File Management V4R5 The followi
- Page 50 and 51: 40 File Management V4R5 application
- Page 52 and 53: 42 File Management V4R5 activation
- Page 54 and 55: Program A (in user default activati
- Page 58 and 59: 48 File Management V4R5 same call l
- Page 60 and 61: 50 File Management V4R5 Program A .
- Page 62 and 63: 52 File Management V4R5 Applying OV
- Page 64 and 65: Deleting overrides 54 File Manageme
- Page 66 and 67: Program A (in user default activati
- Page 68 and 69: 58 File Management V4R5 Displaying
- Page 70 and 71: 60 File Management V4R5 Command 7 d
- Page 72 and 73: 62 File Management V4R5 Display All
- Page 74 and 75: Redirecting files 64 File Managemen
- Page 76 and 77: 66 File Management V4R5 Default act
- Page 78 and 79: 68 File Management V4R5 From Databa
- Page 80 and 81: Copying files: overview 70 File Man
- Page 82 and 83: 72 File Management V4R5 Table 9. Co
- Page 84 and 85: Table 10. Summary of Copy Functions
- Page 86 and 87: 76 File Management V4R5 Copying fil
- Page 88 and 89: Resending copy file completion mess
- Page 90 and 91: 80 File Management V4R5 from-file m
- Page 92 and 93: CPYSRCF command support for CCSIDs
- Page 94 and 95: | | | | | | | | | | | | | | | | | |
- Page 96 and 97: | | | | | | | | | | | | | | | | 86
- Page 98 and 99: | | | | | | | | | | | | | | | | | |
- Page 100 and 101: 90 File Management V4R5 Copying onl
- Page 102 and 103: Selecting the records to copy 92 Fi
- Page 104 and 105: 94 File Management V4R5 Selecting r
46 <strong>File</strong> <strong>Management</strong> V4R5<br />
Override 1 OVRDKTF FILE(PRTA) TOFILE(DKB) +<br />
LABEL(DKFIRST)<br />
CALL PGM(A)<br />
Program A<br />
Override 2 OVRPRTF FILE(DKA) TOFILE(PRTA) +<br />
SPOOL(*YES)<br />
CALL PGM(B)<br />
Program B<br />
Override 3 OVRDKTF FILE(PRTB) TOFILE(DKA) +<br />
DEV(DKT02) LABEL(DKLAST)<br />
Override 4 OVRDKTF FILE(DKA) TOFILE(DKC) +<br />
DEV(DKT02) LABEL(DKTTST)<br />
CALL PGM(C)<br />
Program C<br />
Override 5 OVRPRTF FILE(DKA) +<br />
TOFILE(PRTB) +<br />
SCHEDULE(*JOBEND)<br />
CALL PGM(D)<br />
Program D<br />
Override 6 OVRDKTF FILE(DKA) +<br />
VOL(MASTER)<br />
CALL PGM(MAKEMASTER)<br />
Program MAKEMASTER<br />
(Program<br />
MAKEMASTER<br />
attempts to open file<br />
DKA, but actually<br />
opens the diskette file<br />
DKB.)<br />
In the preceding example, the file that program MAKEMASTER actually opens is<br />
the diskette file DKB because of the following reasons:<br />
v Override 6, which is applied first, does not cause file DKA to be overridden<br />
with any other file.<br />
v Override 5, which is applied second, causes file DKA to be overridden with<br />
printer file PRTB.<br />
v Override 4 is ignored at this level because override 5 changed the file name to<br />
PRTB.<br />
v Override 3, which is applied third, causes file PRTB to be overridden with<br />
diskette file DKA.<br />
v Override 2, which is applied fourth, causes file DKA to be overridden with<br />
printer file PRTA.<br />
v Override 1, which is applied last, causes file PRTA to be overridden with<br />
diskette file DKB.<br />
Therefore, the file that program MAKEMASTER opens is the diskette file DKB.<br />
Because file DKB is a diskette file, the system overrides only those attributes that<br />
are specified on the Override with Diskette <strong>File</strong> (OVRDKTF) commands:<br />
VOL(MASTER) from override 6; DEV(DKT02) from override 3; and<br />
LABEL(DKFIRST) from override 1.