Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
To name fields within an area HLASM Language Reference SC26-4940-06 |
|
Using a duplication factor of zero in a DS instruction also provides a label for an area of storage without reserving the area. Use DS or DC instructions to reserve storage for, and assign labels to, fields within the area. These fields can then be addressed symbolically. (Another way of accomplishing this is described in DSECT instruction.) The whole area is addressable by its label. In addition, the symbolic label has the length attribute value of the whole area. Within the area, each field is addressable by its label. For example, assume that 80-character records are to be read into
an area for processing and that each record has the following format:
The following example shows how DS instructions might be used to
assign a name to the record area, then define the fields of the area
and allocate storage for them. The first statement names the whole
area by defining the symbol RDAREA; this statement gives RDAREA a length attribute of 80 bytes, but does not reserve
any storage. Similarly, the fifth statement names a 6 byte area by
defining the symbol DATE; the three subsequent statements
define the fields of DATE and allocate storage for them.
The second, ninth, and last statements are used for spacing purposes
and, therefore, are not named.
Here are some more examples of DS statements:
To define four 10 byte fields and one 100 byte field, the respective
DS statements might be as follows:
Although FIELD might have been specified as one 40 byte field, the preceding definition has the advantage of providing FIELD with a length attribute of 10. This is pertinent when using FIELD as an SS machine instruction operand. |
Copyright IBM Corporation 1990, 2014
|