Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 59
TYPE Clause
TYPE Clause Examples
The following example illustrates some TYPE
data-type
clauses:
Appendix C, DDL Data Translation
, contains tables that show how DDL translates
similar TYPE clauses into host-language source code.
The following example illustrates using the TYPE clause to refer to existing dictionary
definitions. Assume the dictionary contains the following definitions:
DEF name.
02 last-name PIC X(10).
02 first-name PIC X(20).
END
DEF ordernum PIC 9(3) HEADING
"Order #".
DEF orddate TYPE SQL DATETIME YEAR TO DAYHEADING
"OrderDate".
DEF ordinterval TYPE SQL INTERVAL MONTH 2 HEADING "Order
Interval".
DEF deldate TYPE SQL DATE HEADING"Delivery
Date".
Another definition refers to each of the preceding definitions:
DEF orderinfo.
02 employee TYPE name.
02 ordernum TYPE *
HEADING
"Order/Number".
02 orderdt TYPE orddate
HEADING "Order Date".
02 orderint TYPE ordinterval
HEADING "Order
Interval".
02 delivdate TYPE deldate
HEADING "Deliv Date".
02 salesman PIC 9(4)
HEADING "Salesman #".
02 custnum PIC 9(4)
HEADING "Customer #".
END
DEF type-clause-example.•
02 chr TYPE CHARACTER 8.
02 bin-16 TYPE BINARY 16.
02 bin-16-u TYPE BINARY 16
UNSIGNED.
02 bin-16-s TYPE BINARY
16,2
02 bin-32 TYPE BINARY 32
02 bin-64 TYPE BINARY
64,16
02 flt TYPE FLOAT.
02 flt-64 TYPE FLOAT 64.
02 cmplx TYPE COMPLEX.
02 logicl TYPE LOGICAL.
02 char2 TYPE VARCHAR 25.
END
8 alphanumeric characters
Signed integer
Unsigned integer
Signed integer, 2 decimal positions
Signed double integer
Signed 4-word integer, 16 decimal positions
Signed 32-byte real number
Signed 64-byte real number
8-byte complex binary number
2-byte logical item
25-byte VARCHAR item with a
27-byte total length
VST614.vsd
Содержание DDL D40
Страница 36: ...Introduction to DDL Data Definition Language DDL Reference Manual 426798 002 1 14 Examining a Dictionary ...
Страница 66: ...Named Constants Data Definition Language DDL Reference Manual 426798 002 4 10 Standard SPI Constants ...
Страница 230: ...Dictionary Manipulation Statements Data Definition Language DDL Reference Manual 426798 002 8 14 SHOW USE OF Statement ...
Страница 370: ...Dictionary Maintenance Data Definition Language DDL Reference Manual 426798 002 10 24 Converting a Dictionary ...
Страница 456: ...Sample Schemas Data Definition Language DDL Reference Manual 426798 002 B 12 ASSNDDL Statements ...
Страница 470: ...DDL Data Translation Data Definition Language DDL Reference Manual 426798 002 C 14 ...
Страница 528: ...Dictionary Reports Data Definition Language DDL Reference Manual 426798 002 E 8 Requesting Reports ...
Страница 552: ...DDL Alignment Rules Data Definition Language DDL Reference Manual 426798 002 H 4 FIELDALIGN_SHARED8 Alignment Rules ...
Страница 576: ...Index Data Definition Language DDL Reference Manual 426798 002 Index 22 Special Characters ...