Pathmaker Programming Guide

Using Null Values
Defining Data for a NonStop SQL Pathmaker Application
C–2 067868 Tandem Computers Incorporated
In contrast, this definition uses the NOT NULL clause:
CREATE TABLE employee (name CHAR(20) NOT NULL);
For this version of the definition, the Pathmaker product will generate the following
COBOL output in the requester context portion of the requester source code Working-
Storage Section:
01 EMPLOYEE.
02 NAME PIC X(20)
VALUE SPACE.
General Guidelines for
Using Null Values
Here are some guidelines for using null values:
The Pathmaker product uses the same format described for requesters to generate
IPC definitions and logical file entries in the server. The values you enter on the
IPC Definition Screen are used to create request and reply structures in the server;
the values you enter on the Logical File Entries screen are used to create host
variables in the server.
When the Pathmaker product generates the host variable for a column that allows
null values, an elementary name can become a group level name. In the previous
example, when the EMPLOYEE table allowed null values, the NAME column was
generated as a group level item with two elementary items (INDICATOR and
VALU) belonging to it.
For items declared as numeric, allowing null values changes the data type of
the original column name. For example:
CREATE TABLE numeric (column PIC 9);
would be generated in COBOL as:
01 NUMERIC.
02 COLUMN.
03 INDICATOR PIC S9(4) COMP VALUE 0.
03 VALU PIC 9
VALUE ZERO.
COBOL considers group level items alphanumeric. You would get a compiler
error if you tried to move a numeric value to COLUMN OF NUMERIC.
Likewise, if you are using C, you must assign the numeric value to the
appropriate member of the struct.