DSM Template Services Manual
Template Language
DSM Template Services Manual—427187-004
3-31
MSG Edit Code
EMSTEXT finds the main template and begins to create the display text, starting with
“ABC: Process terminated.” To continue, it must evaluate <1>. Finding edit
descriptor 1, EMSTEXT is directed to format the ZABC-TKN-STATUS token, using the
MSG edit code. MSG edit code requires a template lookup with these key parts, taken
from the event message buffer:
1. Subsystem ID: The subsystem ID is ZABC-VAL-SSID, the value of ZSPI-TKN-
SSID.
2. Token code: ZABC-TKN-STATUS.
3. Token value: To reflect the display text shown in Example 3-12, the value of the
ZABC-TKN-STATUS token in the event-message buffer must be 2. (If the value
has more than 32 bits, only the leftmost 32 bits are used.)
4. Template type: format.
After forming this key, EMSTEXT locates the template with the text “because
insufficient storage was allocated.” When EMSTEXT has substituted this text for the
<1>, the display text is complete.
If the ZABC-TKN-STATUS token has a value for which there are no matching
templates (4, for example), EMSTEXT formats the ZABC-TKN-STATUS token value
with EMSTEXT using the I edit code, formatting only the leftmost 32 bits. The
representation is always signed, regardless of the type of the token or field.
MSG alone (without token code or SSID option) is adequate to provide distinct keys for
the enumerated values of an unstructured token.
Additional parameters are necessary to format a structure field. If MSG alone were
permitted in this case, most parts of the key would be automatically the same
(subsystem-ID, template-type, and token code), and token values might overlap. This
would create duplicate keys. To avoid such duplication:
1. Define new token codes and associate each new code with a field of the structure.
2. Specify that token code in the MSG edit code of the field’s edit descriptor.
These new token codes need not appear in the event message at all. These MSG
statements show one way to avoid the duplicate template-key (key clash) problem: