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

Using the macro facility to help port programs

In many cases, potential portability problems can be avoided by using the macro facility because it has the capability of isolating platform-specific code. For example, you can include platform-specific code in a compilation for a given platform and exclude it from compilation for a different platform.

The PL/I for Windows macro facility COMPILETIME built-in function returns the date using the format 'DD.MMM.YY', while the OS PL/I macro facility COMPILETIME built-in function returns the date using the format 'DD MMM YY'.

This allows you to write code that can contain conditional system-dependent code that compiles correctly under PL/I for Windows and all versions of the mainframe PL/I compiler, for example:

  %dcl compiletime builtin;

  %if substr(compiletime,3,1) = '.' %then
    %do;
       /* Windows PL/I code */
    %end;
  %else
    %do;
       /* OS PL/I code */
    %end;

For information about the macro facility, see the PL/I Language Reference.


Terms of use | Feedback

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