Data Definition Language (DDL) Reference Manual

SPI Tokens
Data Definition Language (DDL) Reference Manual529431-004
7-6
Standard SPI TOKEN-TYPE Definitions
The definition zspi-ddl-int specifies the structure of all simple tokens of the token
type zspi-typ-int in Example 7-1 on page 7-6:
DEF zspi-ddl-int TYPE BINARY 16 SPI-NULL 0.
These definitions are in the file ZSPIDEF.ZSPIDDL.
Example 7-2 on page 7-6 defines two token types you might use for your own
subsystem:
The first token type, assn-typ-status, is defined by reference to the standard
definition in Example 7-1 on page 7-6. This token type is identical to the token type
zspi-typ-int except for its name. You can use zspi-typ-int instead of
defining your own token type, but redefining a standard token type allows you to
give it a name that is meaningful to your subsystem.
The second token-type, assn-typ-variable-token, contains a varying
number of two-word integers. The DEF IS clause is included for documentation
only; it does not determine the token length of the token type. Because the token
type is defined as variable-length with OCCURS VARYING, the token length is set
to 255 by default. The token’s structure is equivalent to this definition:
DEF assn-ddl-variable-token.
02 size TYPE BINARY 16.
02 data-table TYPE BINARY 32
OCCURS 1 TO 100 TIMES DEPENDING ON size.
END
From the definitions in Example 7-2
on page 7-6, the DDL compiler generates the
source code in Example 7-3
on page 7-7 through Example 7-7 on page 7-8.
Example 7-1. Standard SPI Token Definition for Simple Token With 16-Bit Integer
Values
TOKEN-TYPE zspi-typ-int ! Token name
VALUE IS zspi-tdt-int ! Token data type
DEF IS zspi-ddl-int. ! Token definition
Example 7-2. Possible Subsystem Token Types
TOKEN-TYPE assn-typ-status
VALUE IS zspi-tdt-int
DEF IS zspi-ddl-int.
TOKEN-TYPE assn-typ-variable-token
VALUE IS zspi-tdt-int2 ! 2-word integer token data type
OCCURS VARYING
DEF IS assn-ddl-variable-token. ! For documentation only