Data Definition Language (DDL) Reference Manual

Definition Attributes
Data Definition Language (DDL) Reference Manual529431-004
6-39
SPI-NULL
When a definition refers to another definition and the referring definition contains one
or more SPI-NULL clauses, these clauses override any SPI-NULL clauses in the
referenced definition. If the referring definition does not have any SPI-NULL clauses, it
inherits the SPI null value or values from the referenced definition.
If a field is sometimes used as an extensible structured token and sometimes for
another purpose, you can define the field with both an SPI-NULL clause and a VALUE
clause.
When JOBCLASS is used as an extensible structured token, the SSNULL procedure
initializes JOBCLASS to the specified SPI null value. When JOBCLASS is used for any
other purpose, the DDL compiler initializes it to the initial value specified in the VALUE
clause.
Example 6-28. SPI-NULL Clause For a Single Field
DEF assn-ddl-jobcode TYPE BINARY 16 SPI-NULL 0.
Example 6-29. SPI-NULL Clause For a Group of Fields
DEF assn-ddl-jobinfo SPI-NULL 1
02 jobcode TYPE BINARY 16. ! Inherits SPI-NULL value 1.
02 priority TYPE BINARY 16. ! Inherits SPI-NULL value 1.
END.
Example 6-30. Inherited and Overridden SPI-NULL Values
DEF assn-ddl-jobcode SPI-NULL 0.
02 prefix TYPE BINARY 16. ! SPI-NULL 0 (inherited)
02 code TYPE BINARY 16. ! SPI-NULL 0 (inherited)
END
DEF assn-ddl-jobinfo.
02 jobcode TYPE assn-ddl-jobcode. ! SPI-NULL 0 (inherited)
02 priority TYPE BINARY 16 SPI-NULL 1. ! SPI-NULL 1 (stated)
02 location TYPE BINARY 16. ! SPI-NULL 255 (default)
END
DEF assn-ddl-jobinfo-groups.
02 jobinfo-1 TYPE assn-ddl-jobinfo. ! Inherits jobinfo SPI-NULL values
02 jobinfo-2 TYPE assn-ddl-jobinfo SPI-NULL 2. ! Overrides inherited value
END
Example 6-31. Field Defined With SPI-NULL and VALUE Clauses
DEF jobclass TYPE BINARY 16 SPI-NULL 255
VALUE 0.