30.06.2013 Views

File Management - IBM

File Management - IBM

File Management - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

40 <strong>File</strong> <strong>Management</strong> V4R5<br />

application program specifies the OUTPUT printer file). In addition to having the<br />

application program use the printer file REPORTS, you want to produce three<br />

copies. Assume that the following command created the file REPORTS:<br />

CRTPRTF FILE(REPORTS) SPOOL(*YES) +<br />

PAGESIZE(68 132) LPI(8) OVRFLW(60) +<br />

COPIES(2) FILESEP(1)<br />

Before you run the program, type the following command:<br />

OVRPRTF FILE(OUTPUT) TOFILE(REPORTS) COPIES(3)<br />

Then call the application program, and the program produces three copies of the<br />

output using the printer file REPORTS.<br />

Note that this is not equal to the following two override commands:<br />

Override 1 OVRPRTF FILE(OUTPUT) TOFILE(REPORTS)<br />

Override 2 OVRPRTF FILE(REPORTS) COPIES(3)<br />

Only one override is applied for each call level for an open of a particular file;<br />

therefore, if you want to override the file that the program uses and also override<br />

the attributes of the overriding file from one call level, you must use a single<br />

command. If you use two overrides, the first override uses the printer file<br />

REPORTS to print the output. The system ignores the second override.<br />

Overriding the scope of an open file<br />

To change the scope of a file open operation, use the open scope (OPNSCOPE)<br />

parameter on the appropriate override command. The values for the OPNSCOPE<br />

parameter can be either *JOB or *ACTGRPDFN (default). Use this parameter to<br />

change the scope of an open operation from the call level number or activation<br />

group level to the job level.<br />

For example, the following override command scopes the open operation of the<br />

BILLING file to the job level:<br />

OVRDBF FILE(BILLING) OPNSCOPE(*JOB)<br />

How the system processes overrides<br />

Figure 4 on page 41 shows a representation of a job running in the integrated<br />

language environment.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!