Numeric Items and Display Formats
Data Item Attribute
Data Editor handles the following data items as numeric items:
- External decimal item.
- External decimal item (LEADING).
- External decimal item (TRAILING).
- External decimal item (LEADING SEPARATE).
- External decimal item (TRADING SEPARATE).
- Internal decimal item (PACKED-DECIMAL).
- Internal decimal item (COMP-3).
- Binary item (BINARY).
- Binary item (COMP).
- Binary item (COMP-4).
- Binary item (COMP-5).
- Pointer item.
Default Value
When a new numeric item is created or a record is added, the Default Value is set to 0 (zero).
Input Specification
Characters that can be Input:  0 through 9, +, -, and "."  only
Number of Digits that can be Input: Upper limit depends on the item attribute.
Inputting a Sign
- A sign must be input at the beginning or at the end.
- Only one sign can be input.
- A sign that is input for an unsigned item is ignored.
- "+" is added to a signed item whose sign is omitted.
Inputting a Decimal Point
- Input a decimal point so that the number of digits will not exceed the range specified in the item attribute, unless both the integer and decimal parts are 0.
- Only one decimal point can be input.
- A decimal point can be input for an item without a decimal point as long as the decimal part is 0. In this case, only the integer part is valid.
- A decimal point can be omitted from an item with a decimal point as long as the number of digits in the integer part falls within the allowable range for the item attribute, or is 0 because the input value is handled as an integer.
- The input position of the sign must be first or last.
Display Specification
Items are displayed in a format conforming to the respective numeric item attributes. The display format also differs depending on the specification of the environment settings. Zeros are suppressed in numeric items in the display format. The following is an example of a display format:
Examples:
Attribute Value Zero Suppress Do Not Zero Suppress
No Sign and Decimal point 9(4) 0 0 0000
123 123 0123
With Sign S9(4) 0 +0 +0000
123 +123 +0123
With Decimal point V9(4) 0 0 0.0000
0.123 0.123 0.1230
With Sign and Decimal point SV9(4) 0 +0 +0.0000
0.123 +0.123 +0.1230
If the numeric part is not valid, a numeric error occurs. For the external decimal item attribute, the numeric value is recognized by the low-order four bits. For any other attributes, the entire item is processed as 0 if an error occurs. However, an error is not always managed in this manner.
Example of external decimal:
   A character "A" (0x41): Recognized as "1".
   A character "J" S(0x4A): Recognized as "0" (because it is over 9).
Stored Data Format
Data is stored in a format conforming to the respective numeric item attribute defined in the COPY clause.