Data Definition Language (DDL) Reference Manual
SPI Tokens
Data Definition Language (DDL) Reference Manual—529431-004
7-11
Standard SPI TOKEN-CODE Definitions
The file ZSPIDEF.ZSPIDDL on the disk volume chosen for your system contains the
DDL definitions of the standard token codes. To use the standard SPI definitions,
compile this file into your dictionary, using the DDL SOURCE command. For a
complete description of the standard SPI token codes, see the SPI Programming
Manual and the SPI Common Extensions Manual.
The definition of ZSPI-TKN-RETCODE and the standard token-type definition to which
it refers, ZSPI-TYP-ENUM, are in the file ZSPIDEF.ZSPIDDL.
When writing your own subsystem, you often need to define your own token codes. For
example, you might need tokens to pass status information to and from your
subsystem. Example 7-9 on page 7-11 shows the TOKEN-CODE statements to define
two such token codes and the TOKEN-TYPE statement to define their token type.
In Example 7-9
on page 7-11, the token type is the same in both TOKEN-CODE
statements. Any number of tokens can be of the same token type.
From the definitions in Example 7-9 on page 7-11, the DDL compiler generates the
source code in Example 7-10 on page 7-11 through Example 7-14 on page 7-12.
The DDL compiler generates the value of the token code in Example 7-10 on
page 7-11 from the values specified for the token data type in the referenced TOKEN-
TYPE statement and for the token number in the VALUE clause of the TOKEN-CODE
statement—the two token codes differ only in their token numbers. The DDL compiler
performs an unsigned left-shift on each of these values to generate the single COBOL
NATIVE-4 value shown in the example.
Note. When you define a token code specifically for your own subsystem, do not begin its
name with the letter Z; this ensures that your token-code name is not the same as any current
or future name supplied by HP.
Example 7-8. Definition of Standard Return Token
TOKEN-CODE zspi-tkn-retcode VALUE IS 0
TOKEN-TYPE IS zspi-typ-enum.
Example 7-9. Possible Subsystem Token Codes
TOKEN-TYPE assn-typ-status VALUE IS zspi-tdt-enum
DEF IS zspi-ddl-enum.
TOKEN-CODE assn-tkn-my-status VALUE IS 101
TOKEN-TYPE IS assn-typ-status.
TOKEN-CODE assn-tkn-stat-reply VALUE IS 102
TOKEN-TYPE IS assn-typ-status.
Example 7-10. COBOL Source Code Generated for Example 7-9 on page 7-11
01 ASSN-TKN-MY-STATUS NATIVE-4 VALUE IS 184680549.
01 ASSN-TKN-STAT-REPLY NATIVE-4 VALUE IS 184680550.