Numeric character data represents
numeric values. The picture specification cannot contain the character
data picture characters X or A. The picture characters for numeric
character data can also specify editing of the data.
A numeric character variable can have two values, depending upon
how the variable is used. The types of values are as follows:
- Arithmetic
- The arithmetic value is the value expressed by the decimal
digits of the data item, the assumed location of a decimal point,
possibly a sign, and an optionally-signed exponent or scaling factor.
The arithmetic value of a numeric character variable is used in
the following situations:
- Whenever the variable appears in an expression that results
in a coded arithmetic value or bit value (this includes expressions
with the ¬, &, |, and comparison operators;
even comparison with a character string uses the arithmetic value
of a numeric character variable)
- Whenever the variable is assigned to a coded arithmetic, numeric character,
or bit variable
- When used with the C, E, F, B, and P (numeric) format items
in edit-directed I/O.
The arithmetic value of the numeric character variable is converted
to internal coded arithmetic representation.
- Character
value
- The character value is the value expressed by the decimal
digits of the data item, as well as all of the editing and insertion
characters appearing in the picture specification. The character
value does not, however, include the assumed location of a decimal
point, as specified by the picture characters V, K, or F. The character
value of a numeric character variable is used:
- Whenever the variable appears in a character expression
- In an assignment to a character variable
- Whenever the data is printed using list-directed or data-directed
output
- Whenever a reference is made to a character variable that is
defined or based on the numeric character variable
- Whenever the variable is printed using edit-directed output
with the A or P (character) format items.
No data conversion is necessary.
Numeric character data can contain only decimal digits, an optional
decimal point, an optional letter E, and one or two plus or minus
signs. Other
characters generally associated with arithmetic data, such as currency
symbols, can also be specified, but they are not a part of the arithmetic
value of the numeric character variable, although the characters
are stored with the digits and are part of the character value of
the variable.
A numeric character specification consists of one or more fields,
each field describing a fixed-point number. A
floating-point specification has two fields--one for the mantissa
and one for the exponent. The first field can be divided into subfields
by inserting a V picture specification character. The data
preceding the V (if any) and that following it (if any) are subfields
of the specification.
A requirement of the picture specification for numeric character
data is that each field must contain at least one picture character
that specifies a digit position. This picture character, however,
need not be the digit character 9. Other picture characters, such as
the zero suppression characters (Z or *), also specify
digit positions.
Note:
All characters except K, V, and F specify the occurrence
of a character in the character representation.
The picture characters for numeric character specifications are
discussed in the following sections:
- Digits and decimal points describes data specified with the picture
characters 9 and V.
- Zero suppression describes picture data specified with
the picture characters Z and asterisk (*).
- Insertion characters discusses the use of the insertion characters (point,
comma, slash, and B).
- Insertion and decimal point characters describes the use of the decimal point
and insertion characters with the V picture character.
- Defining currency symbols describes how to define your own character(s)
as a currency symbol, and Signs and currency symbols describes the use
of signs and currency symbols.
- Credit, debit, overpunched, and zero replacement characters discusses the picture characters CR,
DB, T, I, R, and Y used for credit, debit, overpunched, and zero
replacement functions.
- Exponent characters discusses the picture characters K and
E used for exponents.
- Scaling factor describes the picture character F used
for scaling factors.
- Picture repetition factor describes the picture repetition character.
|
This information center is powered by Eclipse technology. (http://www.eclipse.org)