── MODIFY ─<object code file title>─ ; ─────────────────► ┌◄────────────── ; ─────────────────┐ ►──┴─┬─ /1\ INITIALIZE ──────────────┬─┴────────────────┤ ├─ <task attribute assignment> ─┤ ├─ <file equation> ─────────────┤ ├─ <library equation> ──────────┤ └─ <database equation> ─────────┘
Explanation
The MODIFY statement permanently changes the attributes within an object code file. See the File Attributes Programming Reference Manual for more information on file attributes.
The MODIFY statement permits task attributes, file equations, library equations, and database equations that are compiled into an object code file to be added to or changed, without recompiling the source file. The attributes listed in the MODIFY statement are permanently stored in the object code file after they have been merged with the previous attributes. If an attribute specified in a MODIFY statement had previously been assigned for that object code file, the new value given in the MODIFY statement is used.
When the MODIFY statement is used with the INITIALIZE keyword, the attributes previously assigned for that object code file are removed. If the INITIALIZE keyword is used, it must precede any task attribute assignments, file equations, library equations, and database equations.
The PRINTPARTIAL file attribute and the REQUESTNAME print modifier cannot be modified.
The file to be modified must be an executable object code file. If you attempt to modify a nonexecutable object code file, the job or processed subroutine containing the MODIFY statement is discontinued.
An object code file that is a compiler must be designated as such after being modified, even if it had previously been designated as a compiler, with the MC (Make Compiler) system command.
The identity specified in the MP (Mark Program) system command is not preserved after the code file is modified. The MP system command needs to be re-applied to a code file that has been altered with the MODIFY statement.
An object code file for which the APL file attribute has the value TRUE cannot be modified. To modify an APL object code file, you must first disable APL access. Change the value of APL to FALSE with the ALTER statement and then modify the code file with the MODIFY statement.
Note: | An object code file associated with a data base (for example, ACCESSROUTINES, DMSUPPORT, and so on) should not be modified with the MODIFY statement. A data base open error may occur when a program accessing the data base is executed. |
When the MODIFY statement creates a new copy of an object code file, the value of the FAMILYINDEX file attribute is not preserved. If you modify a file that should reside on a particular pack, and MODIFY creates a new copy, you might need to recopy the file and specify the appropriate FAMILYINDEX in the COPY statement.
The MODIFY statement can be used to assign initial AX entries or to replace an existing AX entry in a code file. The code file can be assigned multiple initial AX entries by the AX attribute assignments specified in the MODIFY command. If the MODIFY statement is used to replace an existing AX entry and the code file contains multiple AX entries, then the AX entry specified in the MODIFY statement becomes the first in the code file, and the remaining entries are unaffected. If the MODIFY statement specifies more than one AX entry for replacement, only the last is used.
Family substitution is used if the job or task has an active family specification. Only the primary family name is used. Refer to FAMILY Assignment and Interrogating Complex Task Attributes.
Note: | Using the NAME task attribute as part of the MODIFY statement overrides the file name specified in <object code file title>. |
The following example modifies OBJECT/X:
MODIFY OBJECT/X; NAME = OBJECT/Y
Examples
This example illustrates how the MODIFY statement changes attributes of the object code file OBJECT/TEST. The attributes are changed so that subsequent runs of OBJECT/TEST have a PRIORITY of 55 and have the substitute family USERS when family substitution is invoked:
MODIFY (JONES)OBJECT/TEST; PRIORITY = 55; FAMILY DISK = USERS OTHERWISE DISK;
This example changes the attributes of OBJECT/PROG2 so that subsequent runs of OBJECT/PROG2 use the disk file X for the file INPUT, have a PRIORITY of 45, and have the Boolean attribute SW1 set to TRUE:
MODIFY OBJECT/PROG2; FILE INPUT (TITLE = X, KIND = DISK); PRIORITY = 45; SW1;
This example illustrates the MODIFY statement used in conjunction with the INITIALIZE statement:
MODIFY PAYROLL/TRIALBALANCE ON ACCOUNTING; INITIALIZE; TARGET = 1000; SW8