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

Intermediate results

When an expression is evaluated, the target attributes usually are partly derived from the source, partly from the operation being performed, and partly from the attributes of a second operand. Some defaults may be used, and some implementation restrictions (for example, maximum precision) and conventions exist. An intermediate result can undergo conversion if a further operation is performed. After an expression is evaluated, the result can be further converted for assignment to a variable or pseudovariable. These conversions follow the same rules as the conversion of programmer-defined data, for example:

  declare A character(8),
          B fixed decimal(3,2),
          C fixed binary(10);
  A = B + C;

During the evaluation of the expression B + C and during the assignment of that result, there are four different results:

  1. The intermediate result to which the converted binary equivalent of B is assigned
  2. The intermediate result to which the binary result of the addition is assigned
  3. The intermediate result to which the converted decimal fixed-point equivalent of the binary result is assigned
  4. A, the final destination of the result, to which the converted character equivalent of the decimal fixed-point representation of the value is assigned

The attributes of the first result are determined from the attributes of the source B, from the operator, and from the attributes of the other operand. If one operand of an arithmetic infix operator is binary, the other is converted to binary before evaluation.

The attributes of the second result are determined from the attributes of the source (C and the converted representation of B).

The attributes of the third result are determined in part from the source (the second result) and in part from the attributes of the eventual target A. The only attribute determined from the eventual target is DECIMAL (a binary arithmetic representation must be converted to decimal representation before it can be converted to a character value).

The attributes of A are known from the DECLARE statement.


Terms of use | Feedback

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