ALTERW allows you to change or delete symbols, control sections, or common areas and lengthen sections in a program module. The value specified on the MODE parameter determines whether the request is performed on all items currently in the workmod, or delayed to be performed only on the next program module included in the workmod.
The ALTERW request with MODE=NEXT should be followed by an include request for an object module or program module. If it is not, any pending alterations for the next included data set are ignored.
The syntax of the ALTERW call is:
[symbol] | IEWBIND | FUNC=ALTERW [,VERSION=version] |
The alteration is performed either on the next module included in the workmod or on all modules currently in the workmod, depending on the argument specified on the MODE parameter. The possible arguments are as follows:
If NEWNAME is already a defined symbol in the workmod, the existing NEWNAME is deleted when this function begins processing. A warning message is issued. Note that the results of the CHANGE operation can differ from those of the linkage editor in this situation,
The value for MODE can be abbreviated as I or N.
An ALTERW request is valid only when the processing intent is BIND.
NEWNAME is required for change and replace alterations. It is ignored on delete and expand alterations.
The scope of the requested operation is the designated workmod or the next module to be included into the workmod by the binder, regardless of its source. An included module refers to the next object or program module to enter the designated workmod; the first END record (object module) or end-of-module indication (program module) delimits the scope of ALTERW. Alter Workmod does not affect any module(s) residing in other workmods or that enter the workmod following the target module.
If an ALTERW request is not followed by an INCLUDE, such that a BINDW, LOADW or SAVEW request is received and alterations are pending, the alterations are not applied to the first autocalled module but are ignored. Similarly, if one or more alterations are pending as a result of a CHANGE or REPLACE control statement encountered in an autocalled member and an end-of-file is encountered, those alterations are not applied to the next autocalled member.
ALTERW has no effect on symbols or section names appearing in previous or subsequent deferred function requests, such as ADDA, ALIGNT, INSERTS, ORDERS, or SETL.
The common binder API reason codes are shown in Table 1.
Return Code | Reason Code | Explanation |
---|---|---|
00 | 00000000 | Normal completion. Module altered or deferred request accepted. |
04 | 83000702 | OLDNAME not found. For an immediate-mode change or replace request, no ESD entries in the module contained the specified name. |
04 | 83000706 | Duplicate name. For an immediate mode request, the replacement name already exists as an external symbol in the target workmod. The old name or section will be deleted if necessary, and the requested change will be made. |
08 | 83000550 | A section for which an expand request was made is not in the target workmod. Workmod is unchanged. |
08 | 83000551 | The name on an expand request matched a symbol in workmod that was not a section name. Workmod is unchanged. |
08 | 83000552 | The name on a change or replace request is blank. Workmod is unchanged. |
08 | 83000553 | Expand request for more than 1 gigabytes was made. Workmod is unchanged. |
08 | 83000554 | The class name specified or defaulted does not exist in the section you specified. The element cannot be expanded. Workmod is unchanged. |
08 | 83000555 | Designated class is not a text class. The element cannot be expanded. Workmod is unchanged. |
12 | 83000104 | INTENT=ACCESS specified for workmod. Module could not be altered. |
If your program does not use the IEWBIND macro, place the address of the ALTERW parameter list in general purpose register 1.
PARMLIST | DS | 0F | |
DC | A(ALTERW) | Function code | |
DC | A(RETCODE) | Return code | |
DC | A(RSNCODE) | Reason code | |
DC | A(WORKMOD) | Workmod token | |
DC | A(ATYPE) | Alter type | |
DC | A(MODE) | Alter mode | |
DC | A(OLDNAME) | Old name | |
DC | A(NEWNAME) | New name | |
DC | A(COUNT) | Number of bytes | |
DC | A(CLASS) | Class | |
ALTERW | DC | H'50' | ALTERW function code |
DC | H'version' | Interface version number | |
ATYPE | DC | C'C' | Alter
type: 'C' = Change |
MODE | DC | C'N' | Alter mode: 'I' = Immediate |