Source Definition

The source definition of a message field describes the address and length of the binary data to be converted in the message.
source
Read syntax diagramSkip visual syntax diagram addr . len
addr
Tells the compiler where it can find the data to be converted in the message field. The address value can be specified in the following ways:
Method Explanation
MSGBLOK parameter

For example: n
Parameters in the MSGBLOK can contain the values to be converted. Each parameter has a number, starting from 1. Parameter 1 is at address MSGBVARS+0, parameter 2 at MSGBVARS+8, and parameter n is at MSGBVARS+(n-1)*8. You can use this number to refer to a MSGBLOK parameter. For example, 1.8 specifies that the first MSGBLOK parameter (MSGBVARS+0) contains the field data, which is 8 bytes long.
Offset from a parameter

For example:  n+offset
A parameter that is not aligned at the start of a data area can also point to the address of the field data. Here, you can use the + character to identify the appropriate parameter. For example, 2+4.4 specifies that the source starts 4 bytes after parameter 2 (at MSGBVARS+12) and is 4 bytes long.
Data area pointed to by
a parameter

For example:  n!offset
A MSGBLOK parameter can also contain a pointer to a data area that is the source of a message field. The ! character identifies when this type of indirection is needed to find the source. For example, 2!8.2 identifies the following information about the source:
2!
The first 4 bytes of MSGBLOK parameter 2 are a pointer.
8
Add 8 to the value of the pointer to find the address of the source.
.2
The length of the source is 2 bytes.

You can specify the ! and + symbols several times in a statement to create many levels of indirection.

Symbolic reference

For example:
   n!(label-offset)
You can use symbolic references to find information within a data structure. For example, to find a LINKID in a LINKTABL entry, you can specify 1!LINKID. This produces the same results as specifying 1!(LINKID-LINKTABL).L'LINKID. The compiler calculates the LINKID-LINKTABL offset by treating LINKID as a relative address, based on the LINKTABL DSECT. The length defaults to the length of the LINKID field.

You can specify several symbolic references at the same time. However, when many symbols are used, the last one in the chain is used as the default length. For example, 1!PORTLINK!LINKID is the same as specifying 1!(PORTLINK-PORT)!(LINKID-LINKTABL).L'LINKID. In both cases, the first parameter in the MSGBLOK is treated as a pointer to the PORT entry. The PORTLINK field of this PORT entry is taken as a pointer to a LINKTABL entry. The value of LINKID field of this LINKTABL entry is then used as the message field.

Parameter default

For example:  n!label
If you use the first parameter of a data area to locate the source of a message field, you do not need to specify the initial parameter. For example, LINKID is the same as 1!LINKID. However, if the needed parameter is not parameter 1, you must specify the parameter (for example, LINKID …, 2!TAGORGID). You can specify the USING option on a message definition to override the default parameter number where none is explicitly specified.
len
Length of the value to be converted in the message field. If you specify the len as a decimal integer in the message definition, that value is used. If you specify a symbolic reference for the address, the length of the source field is used. For example, if the address is LINKID, the length will be L'LINKID, which is 8. If you do not specify a len value, the default length of the selected data type is assumed (see Data Type Definition).