Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Migration Guide

IBM2812: poor TRANSLATE and VERIFY

This message alerts you to a coding practice that was ok under the old compiler, but for which there is a much better alternative with the new compiler: rather than declaring named constants with the attributes STATIC INIT, you can now with the attribute VALUE.

This change will particularly help code such as:

   test: proc( c );

     dcl c char(20);

     dcl upper char(26) static init('ABCDEFGHIJKLMNOPQRSTUVWXYZ');
     dcl lower char(26) static init('abcdefghijklmnopqrstuvwxyz');

     c = translate( c, upper, lower );
   end;

Since the named constants upper and lower are declared as STATIC INIT, both the old and new compilers will build the translate table at run time. This is expensive. However, the new compiler will also issue these informational messages:

IBM2812I I Argument number 2 to TRANSLATE built-in would lead to
                much better code if declared with the VALUE attribute.
     IBM2812I I Argument number 3 to TRANSLATE built-in would lead to
                much better code if declared with the VALUE attribute.

If you change the STATIC INIT in both declares to VALUE, these messages will be eliminated and the compiler will generate much better code.


Terms of use | Feedback

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