HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Parts (z/OS and CMS)

HLASM Language Reference
SC26-4940-06

Parts are the smallest externally named and independently relocatable subdivisions of elements in a merge class. A class containing parts can contain only parts, and a class containing anything other than parts cannot contain any parts.

ENTRY statements cannot define an entry point in a part.

You define a part with the CATTR instruction, which must follow the initiation of an executable section. The name of the class to which the part belongs is provided in the name entry of the CATTR instruction, and the name of the part is specified as an operand. The first definition of a class name can also specify the attributes of the class. (See CATTR instruction (z/OS and CMS) for further information.)

For example, suppose you define two parts in a class:
SECT_B   CSECT ,             Define section SECT_B
PClass   CATTR Part(Part_R),RMODE(ANY)  Define class PClass, part Part_R
         - - -               Statements included in Part_R
PClass   CATTR Part(Part_S)  Define part Part_S in class PClass
         - - -               Statements included in Part_S
PClass   CATTR Part(Part_R)  Resume class PClass and part Part_R
         - - -               More statements included in Part_R

These statements define a "merge" class PClass containing two parts, Part_R and Part_S. If other classes or other object files declare parts with the same names in the same class, the binder merges their contents to determine the final part definition in the program object.

You can provide additional statements for a part by specifying a CATTR statement with the class name in the name entry and the part name specified as the operand. No other class attributes can be specified following the first CATTR statement declaring the class.

Parts are automatically assigned a "merge" attribute, meaning that more than one identically named part might appear in a class defined in other assemblies or compilations. The binder assigns the longest length and strictest alignment of all such identically named parts, and merges the machine language text contributions of each to form the final text belonging to that part. The order of text merging depends on the sequence of parts processing by the binder.

Note: During linking, parts might be arranged in any order, depending on their priority attribute. Do not assume any ordering relationship among parts.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014