Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 53
TYPE Clause
°
If an SQL VARCHAR field is defined in or referenced by a RECORD
statement, the maximum field length is the maximum record length,
which depends on the file type:
The maximum length leaves room for a two-byte length field.
•
DDL starts each SQL VARCHAR field on a word boundary, generating a
one-byte filler character if necessary.
•
DDL starts each occurrence generated by an OCCURS clause on a word
boundary, generating a one-byte filler character, if necessary, before the
next occurrence.
•
In the supported host languages (C, COBOL, FORTRAN, Pascal, pTAL,
TACL, and TAL), DDL outputs an SQL VARCHAR field as a group with two
elementary items. The elements are:
The LEN item has a data type that corresponds to a DDL BINARY field.
The VAL item has a data type that corresponds to a DDL CHARACTER
field.
°
SQL DATETIME data type:
•
The syntax for the SQL DATETIME data type differs from the
corresponding SQL syntax. For DDL, you do not use parentheses around
the
end-field-precision
item; for SQL you do enclose
end-field-
precision
in parentheses.
•
The language output for an SQL DATETIME, SQL DATE, TIME, or SQL
TIMESTAMP field corresponds to a DDL CHARACTER data type.
•
DDL generates a field whose length is the maximum byte length required
for the longest possible DATETIME string for the SQL DATETIME type in
ANSI format. See
Appendix D, Dictionary Database Structure
, for a list of
SQL DATETIME byte lengths.
•
If you specify a VALUE clause for an SQL DATETIME field, its value must
be SYSTEM, CURRENT, or
datetime-literal
. You cannot specify
VALUE ZERO or VALUE ZEROES for an SQL DATETIME field. See
VALUE Clause
on page 6-79, for additional information about these values.
Entry-Sequenced files
4,072 bytes
Key-Sequenced files
4,062 bytes
Relative files
4,072 bytes
Unstructured files
4,096 bytes
LEN
The length of the data element
VAL
The actual value