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


DS instruction

HLASM Language Reference
SC26-4940-06

The DS instruction:
  • Reserves areas of storage
  • Provides labels for these areas
  • Uses these areas by referring to the symbols defined as labels
  • If a control section has not previously been established, DS initiates an unnamed (private) control section
Read syntax diagramSkip visual syntax diagram
                   .-,-------.   
                   V         |   
>>-+--------+--DS----operand-+---------------------------------><
   '-symbol-'                    

symbol
Is one of the following:
  • An ordinary symbol
  • A variable symbol that has been assigned a character string with a value that is valid for an ordinary symbol
  • A sequence symbol

If symbol denotes an ordinary symbol, the ordinary symbol represents the address of the first byte of the storage area reserved. If several operands are specified, the first storage area defined is addressable by the ordinary symbol. The other storage areas can be reached by relative addressing.

operand
Is an operand of six subfields. The first five subfields describe the attributes of the symbol. The sixth subfield provides the nominal values that determine the implicit lengths; however no constants are generated.
A DS operand has this format:
Read syntax diagramSkip visual syntax diagram
>>-+--------------------+--type--+----------------+------------->
   '-duplication_factor-'        '-type_extension-'   

>--+--------------+--+----------+--nominal_value---------------><
   '-program_type-'  '-modifier-'                  

The format of the DS operand is identical to that of the DC operand; exactly the same subfields are used and are written in exactly the same sequence as they are in the DC operand. For more information about the subfields of the DC instruction, see DC instruction.

Unlike the DC instruction, the DS instruction causes no data to be assembled. Therefore, you do not have to specify the nominal value (sixth subfield) of a DS instruction operand. The DS instruction is the best way of symbolically defining storage for work areas, input and output buffers, and so on.

Although the formats are identical, there are two differences in the specification of subfields. They are:
  • The nominal value subfield is optional in a DS operand, but it is mandatory in a DC operand. If a nominal value is specified in a DS operand, it must be valid.
  • The maximum length that can be specified for the character (C) and hexadecimal (X) type areas is 65,535 bytes rather than 256 bytes for the same DC operands. The maximum length for the graphic (G) type is 65,534 bytes.
If symbol denotes an ordinary symbol, the ordinary symbol, as with the DC instruction:
  • Has an address value of the first byte of the area reserved, after any boundary alignment is done
  • Has a length attribute value, depending on the implicit or explicit length of the type of area reserved

If the DS instruction is specified with more than one operand or more than one nominal value in the operand, the label addresses the area reserved for the field that corresponds to the first nominal value of the first operand. The length attribute value is equal to the length explicitly specified or implicit in the first operand.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014