Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 77
USAGE Clause
•
A field can be declared as COMP-3 if the associated PICTURE declaration is of
the form:
PIC [S] 9.....[(length)] [ v 9.....[(length)] ]
•
The symbol “9” can occur a maximum of 18 times in a PICTURE clause for an item
declared as COMP-3.
•
When a group is declared as COMP-3, each member is also COMP-3. All
elements of the group must have a PICTURE declaration compatible with COMP-
3.
•
A COMP-3 item can refer to another item (TYPE * or TYPE
def-name
) provided
the referenced item has been declared as COMP-3. If the referenced definition is a
group item, then either the item itself or all of its constituent elements should have
been declared as COMP-3.
•
The number of bytes required by a data item that has been declared with USAGE
as COMP-3, COMPUTATIONAL-3, or PACKED-DECIMAL, depends upon the
number of 9s specified in the picture clause of that item.
•
When a DDL item contains any PACKED-DECIMAL field (declared with a USAGE
clause COMP-3, COMPUTATIONAL-3, or PACKED-DECIMAL value), then DDL
only supports the generation of output for COBOL.
USAGE Clause Examples
Although source code can be produced for computational items in each language,
problems can occur when data is stored in such items. Consider a field described as
follows:
PIC 9(7) COMP.
A COBOL program can enter only 7 digits into the field, but a TAL program can enter a
much larger value into the INT(32) field generated from the description. Problems can
occur if this larger value is accessed by the COBOL program.
You can avoid such problems in COBOL by using TYPE BINARY
n
, instead of PIC and
COMP, in the DDL source code. A BINARY data type translates into a COBOL
NATIVE-2, NATIVE-4, or NATIVE-8 data type.
The following code examples show the COBOL output that DDL generates for fields
defined with USAGE IS INDEX. Error messages result when the size of the field
Содержание 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 ...