Override of file attributes

 

Overriding file attributes is the simplest form of overriding a file. File attributes are built as a result of the following actions:

For example, assume that you create a printer file OUTPUT whose attributes are:

The Create Printer File (CRTPRTF) command looks like this:
CRTPRTF FILE(QGPL/OUTPUT) SPOOL(*YES) +
  PAGESIZE(60 80) LPI(6) COPIES(2) +
  FILESEP(2) OVRFLW(55)

You specify the printer file OUTPUT in your application program with an overflow line number of 58 and a page size of 66 by 132. However, before you run the application program, you want to change the number of printed copies to 3, and the overflow line to 60. The override command looks like this:

OVRPRTF FILE(OUTPUT) COPIES(3) OVRFLW(60)
Then you call the application program, and three copies of the output print.

When the application program opens the OUTPUT file, the system merges the file-specified attributes, program-specified attributes, and override-specified attributes to form the open data path. The system uses the open data path when the program runs. The system merges file-specified overrides with the program-specified attributes first. Then it merges these merged attributes with the override attributes. In this example, when the OUTPUT file is opened and output operations are performed, spooled output will be produced with a page size of 66 by 132, six lines per inch, three copies, and two file separator pages. The spooled output will overflow at 60 lines.

Figure 1 explains this example. Figure 1. Override file attributes

Overriding file attributes

 

Parent topic:

Application of overrides