HP DDL D40 Reference Manual page 196

Data definition language
Table of Contents

Advertisement

SPI Tokens
The definition ZSPI-DDL-INT specifies the structure of all simple tokens of the token
type ZSPI-TYP-INT:
DEF zspi-ddl-int
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:
TOKEN-TYPE assn-typ-variable-token•
DEF IS assn-ddl-variable-token.
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
02
data-table
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.
Data Definition Language (DDL) Reference Manual—426798-002
TYPE BINARY 16
VALUE zspi-tdt-int2
OCCURS VARYING•
TYPE BINARY 16.
TYPE BINARY 32
OCCURS 1 TO 100 TIMES DEPENDING ON size.
SPI-NULL 0.
2-word integer token data
type
7 -6
TOKEN-TYPE Statement
VST702.vsd

Advertisement

Table of Contents
loading

Table of Contents