Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

E-format item

The floating-point (or E) format item describes the character representation of a real floating-point decimal arithmetic data value.

Read syntax diagramSkip visual syntax diagram>>-E--(--field-width,fractional-digits-------------------------->
 
>--+---------------------+--)----------------------------------><
   '-,significant-digits-'
 
field-width
Specifies the total number of characters in the field. It is evaluated and converted to an integer value w each time the format item is used.
fractional-digits
Specifies the number of digits in the mantissa that follow the decimal point. It is evaluated and converted to an integer value d each time the format item is used.
significant-digits
Specifies the number of digits that must appear in the mantissa. It is evaluated and converted to an integer value s each time the format item is used.

The following must be true:

  w >= s = d+1 or w = 0

When w ¬= 0

  s > 0, d >= 0

The values for w, d, and s are field-width, fractional-digits, and significant-digits, respectively.

On input, either the data value in the data stream is an optionally signed real decimal floating-point or fixed-point constant located anywhere within the specified field or the CONVERSION condition is raised. (For convenience, the E preceding a signed exponent can be omitted.)

The field width includes leading and trailing blanks, the exponent position, the positions for the optional plus or minus signs, the position for the optional letter E, and the position for the optional decimal point in the mantissa.

The data value can appear anywhere within the specified field; blanks can appear before and after the data value in the field and are ignored. If the entire field is blank, the CONVERSION condition is raised. When no decimal point appears, fractional-digits specifies the number of character positions in the mantissa to the right of the assumed decimal point. If a decimal point does appear in the number, it overrides the specification of fractional-digits.

If field-width is 0, there is no assignment to the data-list item.

The statement:

  get file(A) edit (Cost) (E(10,6));

obtains the next 10 characters from A and interprets them as a floating-point decimal number. A decimal point is assumed before the rightmost 6 digits of the mantissa. The value of the number is converted to the attributes of COST and assigned to this variable.

On output, the data-list item is converted to floating-point and rounded if necessary. The rounding of data is as follows: if truncation causes a digit to be lost from the right, and this digit is greater than or equal to 5, 1 is added to the digit to the left of the truncated digit. This addition might cause adjustment of the exponent.

The character string written in the stream for output has one of the following syntaxes:

Note:
Blanks are not allowed between the elements of the character strings.

The exponent is a 4-digit integer, which can be 4 zeros.

If the field width is such that significant digits or the sign are lost, the SIZE condition is raised. If the character string does not fill the specified field on output, the character string is right-adjusted and extended on the left with blanks.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)