Override file attributes

Find out why file attributes are built. You can also see a override file attribute example.

File attributes are built as a result of the following:

The simplest form of overriding a file is to override some attribute of the file.

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

The Create Tape File (CRTTAPF) command looks like this:
CRTTAPF  FILE(QGPL/OUTPUT) DEV(TAP01)
DENSITY(1600) CODE(*ASCII) ENDOPT(*UNLOAD)
Your application program has the tape file OUTPUT specified with a character code type of EBCDIC and a density of 3200. However, before you run the application program, you want to change the density to 6250 bpi and the end option to *REWIND. The override command looks like this:
OVRTAPF  FILE(OUTPUT) DENSITY(6250)
ENDOPT(*REWIND)

When you call the application program, the system uses a tape density of 6250 bpi and the end option is *REWIND.

When the application program opens the file, the system merges these to form the open data path (ODP):

The program uses the open data path (ODP) during the running of the program. File overrides have precedence overprogram-specified attributes. Program-specified attributes have precedence over file-specified attributes. In Figure 1, when you open the file and you perform output operations, the program writes:

Figure 1 explains this example.

Figure 1. Override file attributes
This diagram is explained
in the example mentioned above.