Structures
The structures are generated by macros that have various parameters to control the action of the macro.
Specifying the name of the structure
To declare more than one instance of a structure, the macro prefixes the name of each field in the structure with a user-specifiable string and an underscore.
* Declare two object descriptors
CMQODA , Prefix used="MQOD_" (the default)
MY_MQOD CMQODA , Prefix used="MY_MQOD_"
The structure declarations shown in this section use the default prefix.
Specifying the form of the structure
- DSECT=YES
- An assembler DSECT instruction is used to start a new data section; the structure definition immediately follows the DSECT statement. The label on the macro invocation is used as the name of the data section; if no label is specified, the name of the structure is used.
- DSECT=NO
- Assembler DC instructions are used to define the structure at the current position in the routine. The fields are initialized with values, which can be specified by coding the relevant parameters on the macro invocation. Fields for which no values are specified on the macro invocation are initialized with default values.
Controlling the version of the structure
By default, the macros always declare the most recent version of each structure.
Version field in the structure, that parameter defines the
initial value for the Version field, and does not control the
version of the structure actually declared. To control the version of the structure that is
declared, use the DCLVER parameter:- DCLVER=CURRENT
- The version declared is the current (most recent) version.
- DCLVER=SPECIFIED
- The version declared is the version specified by the VERSION parameter. If you
omit the VERSION parameter, the default is version 1.
If you specify the VERSION parameter, the value must be a self-defining numeric constant, or the named constant for the version required (for example, MQCNO_VERSION_3). If you specify some other value, the structure is declared as if DCLVER=CURRENT had been specified, even if the value of VERSION resolves to a valid value.
Declaring one structure embedded within another
- NESTED=YES
- The structure declaration is nested within another.
- NESTED=NO
- The structure declaration is not nested within another.
Specifying initial values for fields
Specify the value to be used to initialize a field in a structure by coding the name of that field (without the prefix) as a parameter on the macro invocation, accompanied by the value required.
MsgType field initialized with MQMT_REQUEST, and the
ReplyToQ field initialized with the string "MY_REPLY_TO_QUEUE",
use the following: MY_MQMD CMQMDA MSGTYPE=MQMT_REQUEST, X
REPLYTOQ=MY_REPLY_TO_QUEUE
If you specify a named constant (equate) as a value on the macro invocation, use the CMQA macro to define the named constant. Do not enclose character string values in single quotation marks.
Controlling the listing
- LIST=YES
- The structure declaration appears in the assembler listing.
- LIST=NO
- The structure declaration does not appear in the assembler listing.