Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6 -6
EDIT-PIC Clause
•
If a field’s data type and the edit picture are defined as two different data elements
in the working-storage section of a COBOL85 program, moving the data from one
picture to the other must be possible. The edit picture for an alphanumeric field
must be alphanumeric, and the edit picture for a numeric field must be numeric.
•
The length of the data in an edit picture must conform to the length of the field’s
data type. To determine the data length in an edit picture, count only the digits or
characters of data, not decorations. For example, the data length of $99.99 is 4.
For alphanumeric fields, the following rules about data length apply:
°
The length of the data in the edit picture must be less than or equal to the
length of the field.
°
The length of the data in the edit picture must be greater than 0.
For numeric fields, the following rules apply:
°
The length of the data to the left of the decimal point in the edit picture must be
less than or equal to the length of the field to the left of the decimal point.
°
The length of the data to the right of the decimal point in the edit picture must
be less than or equal to the length of the field to the right of the decimal point.
°
The length of the data in the edit picture must be greater than 0.
°
For SQL VARCHAR fields, the length of the data in the edit picture clause must
be less than or equal to the specified length of the VARCHAR field.
The maximum length of data in an EDIT-PIC clause is 32,767 bytes.
•
If an EDIT-PIC clause overrides an inherited edit picture, the edit picture specified
in the clause must conform to the type of the referenced definition.
•
If an EDIT-PIC clause contains an invalid edit picture, DDL generates an error
message and does not add the definition to the dictionary.
•
DDL supports SQL DATETIME and SQL INTERVAL line items that have an EDIT-
PIC clause. All EDIT-PIC types are valid on these line items except PIC 9, PIC A,
and PIC N.
•
You cannot use an EDIT-PIC clause for data types not supported by COBOL85.
EDIT-PIC Clause Examples
The following examples illustrate the rules for data length in edit pictures:
Elementary item:S999V99.
Valid:-$$$$.9
Invalid:-----.99
Valid:---.99
Although the first edit picture has more characters than the elementary item, the edit
picture is valid because the extra characters leave room to display the minus sign and
Содержание 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 ...