DSM Template Services Manual
Template Language
DSM Template Services Manual—427187-004
3-15
DEF_ENUM Statement
Considerations
•
This example used a shared token originally defined as ZSPI-TDT-ENUM.
However, a shared token could also be these token data types: (ZSPI-TDT-) INT,
UINT, BYTE, or BOOLEAN. Or it could be any of these DDL types: ZSPI-DDL-
BOOLEAN, LOGICAL 1, or LOGICAL 2. In these cases, you are creating new
enumerated values for the shared token. For example, if a shared token is defined
as an integer and does not have enumerated values, but you want to view text
instead of an integer value, enumerate the integer value for one or more
applications that uses the shared token.
•
You can enumerate a value of a field of a structure, rather than a simple token. For
example, instead of enumerating values of the token FEET-TKN-RETCODE,
enumerate values of FEET-TKN-STRUCT.RETCODE.
Example 3-7. DEF_ENUM Example—DDL Definition File for Fictitious
LEGS Subsystem
! DDL source code
! file name \cat.$kit.clsexmpl.d5b
?dict $kit.clstacl
! Make subsystem for LEGS.
! Define the subsystem ID for the subsystem LEGS. First the constants
! are declared, and then the subsystem ID is defined.
CONSTANT legs-val-ss-owner VALUE IS "BODY".
CONSTANT legs-val-ss-number VALUE IS 234.
CONSTANT legs-val-ss-version VALUE IS VERSION "C20".
CONSTANT legs-val-ssid-string VALUE IS "BODY.234.C20".
DEFINITION legs-val-ssid.
02 z-filler TYPE CHARACTER 8 VALUE IS legs-val-ss-owner.
02 z-owner REDEFINES z-filler
TYPE zspi-ddl-char8.
02 z-number TYPE zspi-ddl-int VALUE IS legs-val-ss-number.
02 z-version TYPE zspi-ddl-uint VALUE IS legs-val-ss-version.
END.
! Define the enumeration legs-ddl-domain-state. In the template source
! file listed previously, the shared token feet-tkn-retcode is associated
! with this enumeration by using a DEF_ENUM statement.
DEFINITION legs-ddl-domain-state TYPE ENUM TACL ENUM
BEGIN.
89 ds-transmitted VALUE IS 1 AS "TRANSMITTED".
89 ds-aborted VALUE IS 5 AS "ABORTED".
89 ds-recv-pending VALUE IS 13 AS "RECEIVE PENDING".
END.
! Define one possible value of zems-tkn-eventnumber. This value is used in
! the MSG statement in the preceding template source file.
CONSTANT legs-evt-print-retcode VALUE IS 1.