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

Language-specified defaults

When a variable has not been declared with any data attributes, it is given arithmetic attributes by default. If mode, scale, and base are not specified by a DECLARE or DEFAULT statement, the DEFAULT compiler option determines its attributes as follows:

If a scaling factor is specified in the precision attribute, the attribute FIXED is applied before any other attributes. Therefore, a declaration with the attributes BINARY(p,q) is always equivalent to a declaration with the attributes FIXED BINARY(p,q).

If a precision is not specified in an arithmetic declaration, the DEFAULT compiler option determines the precision as indicated in Table 27. The language-specified defaults for scope, storage and alignment attributes are shown in Table 8 and Table 7.

If no description list is given in an ENTRY declaration, the attributes for the argument must match those specified for the corresponding parameter in the invoked procedure. For example, given the following declaration:

  dcl X entry;
  call X( 1 );

The argument has the attributes REAL FIXED DECIMAL(1,0). This would be an error if the procedure x declared its parameter with other attributes, as shown in the following example:

  X: proc( Y );
    dcl Y fixed bin(15);

This potential problem can be easily avoided if the entry declaration specifies the attributes for all of its parameters.

Table 27. Default arithmetic precisions
Attributes DEFAULT(IBM) DEFAULT(ANS)
DECIMAL FIXED (5,0) (10,0)
BINARY FIXED (15,0) (31,0)
DECIMAL FLOAT (6) (6)
BINARY FLOAT (21) (21)

Terms of use | Feedback

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