Rational Developer for System z
PL/I for Windows, Version 7.6, Programming Guide

Language elements causing run-time differences

There are also some language elements that can cause your program to run differently under PL/I for Windows. than it does under OS PL/I, due to differences in the implementation of the language by the compiler. Each of the following items is described in terms of its PL/I for Windows behavior.

FIXED BIN(p) maps to one byte if p <= 7
If you have any variables declared as FIXED BIN with a precision of 7 or less, they occupy one byte of storage under PL/I for Windows. instead of two as under OS PL/I. If the variable is part of a structure, this usually changes how the structure is mapped, and that could affect how your program runs. For example, if the structure were read in from a file created on the mainframe, fewer bytes would be read in.

To avoid this difference, you could change the precision of the variable to a value between 8 and 15 (inclusive).

INITIAL attribute for AREAs is ignored
To keep PL/I for Windows product from ignoring the INITIAL attribute for AREAs, convert INITIAL clauses into assignment statements.

For example, in the following code fragment, the elements of the array are not initialized to a1, a2, a3, and a4.

  dcl (a1,a2,a3,a4) area;
  dcl a(4) area init( a1, a2, a3, a4 );

However, you can rewrite the code as follows so that the array is initialized as desired.

  dcl (a1,a2,a3,a4) area;
  dcl a(4) area;

  a(1) = a1;
  a(2) = a2;
  a(3) = a3;
  a(4) = a4;
Issuing of ERROR messages
When the ERROR condition is raised, no ERROR message is issued under PL/I for Windows if the following two conditions are met: ERROR messages are directed to STDERR rather than to the SYSPRINT data set. By default, this is the terminal. If SYSPRINT is directed to the terminal, any output in the SYSPRINT buffer (not yet written to SYSPRINT) is written before any ERROR message is written.
ADD, DIVIDE, and MULTIPLY do not return scaled FIXED BIN
Under the RULES(IBM) compile-time option, which is the default, variables can be declared as FIXED BIN with a nonzero scale factor. Infix, prefix, and comparison operations are performed on scaled FIXED BIN as with the mainframe. However, when the ADD, DIVIDE, or MULTIPLY built-in functions have arguments with nonzero factors or specify a result with a nonzero scale factor, the PL/I for Windows compilers evaluate the built-in function as FIXED DEC rather as FIXED BIN as the mainframe compiler.

For example, the PL/I for Windows compilers would evaluate the DIVIDE built-in function in the assignment statement below as a FIXED DEC expression:

  dcl (i,j) fixed bin(15);
  dcl x     fixed bin(15,2);
     .
     .
     .
  x = divide(i,j,15,2)
Enablement of OVERFLOW and ZERODIVIDE
For OVERFLOW and ZERODIVIDE, the ERROR condition is raised under the following conditions:

Terms of use | Feedback

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