SPI Tokens
Data Definition Language (DDL) Reference Manual — 426798-002
7 -6
TOKEN-TYPE Statement
The definition ZSPI-DDL-INT specifies the structure of all simple tokens of the token
type ZSPI-TYP-INT:
DEF zspi-ddl-int TYPE BINARY 16 SPI-NULL 0.
These definitions are in the file ZSPIDEF.ZSPIDDL.
The following examples illustrate the definition of two token types you might define for
your own subsystem.
•
The first token type is defined by reference to the standard definition shown in the
preceding example:
TOKEN-TYPE assn-typ-status
VALUE IS zspi-tdt-int
DEF IS zspi-ddl-int.
Notice that this token type,
assn-typ-status
, is identical to the token type
ZSPI-TYP-INT except for its name. You could use ZSPI-TYP-INT instead of
defining your own token type. This first example illustrates that you have the choice
of redefining a standard token type with a name that is meaningful to your
subsystem.
•
The second token-type example contains a varying number of two-word integers:
Note that the DEF IS clause is included for documentation only; it is not used to
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 documented in the following 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
The following examples show the source code DDL generates from the preceding
TOKEN-TYPE statements:
•
COBOL source code:
01 ZSPI-TYP-INT NATIVE-2 VALUE IS 514.
01 ASSN-TYP-STATUS NATIVE-2 VALUE IS 514.
01 ASSN-TYP-VARIABLE-TOKEN NATIVE-2 VALUE IS 1023.
TOKEN-TYPE assn-typ-variable-token•
VALUE zspi-tdt-int2
OCCURS VARYING•
DEF IS assn-ddl-variable-token.
2-word integer token data
type
VST702.vsd