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

Environment differences affecting portability

There are some differences, other than data representation, between the workstation and mainframe platforms that can also affect the portability of your programs. This section describes some of these differences.

File names
File naming conventions on the PC are very different from those on the mainframe. The following file name, for example, is valid on the PC, but not on the mainframe:
  d:\programs\data\myfile.dat
This can affect portability if you use file names in your PL/I source as part of the TITLE option of the OPEN and FETCH statements.
File attributes
PL/I allows many file attributes to be specified as part of the ENVIRONMENT attribute in a file declaration. Many of these attributes have no meaning on the workstation, in which case the compiler ignores them. If your program depends on these attributes being respected, your program is not likely to port successfully.
Control codes
Some characters that have no particular meaning on the mainframe are interpreted as control characters by the workstation and can lead to incorrect processing of data files having a TYPE of either LF, LFEOF, CRLF, or CRLFEOF. Such files should not contain any of the following characters:

For example, if the file in the code below has TYPE(CRLF), the WRITE statement raises the ERROR condition with oncode 1041 because 2573 has the hexadecimal value '0D0A'x. This would not occur if the file had TYPE of either FIXED, VARLS, or VARMS.

    dcl
      1 a native,
        2 b char(10),
        2 c fixed bin(15),
        2 d char(10);

    dcl f file output;

    a.b = 'alpha';
    a.c = 2573;
    a.d = 'omega';

    write file(f) from(a);
Device-dependent control codes
Use of device-dependent (platform-specific) control codes in your programs or files can cause problems when trying to port them to other platforms that do not necessarily support the control codes.

As with all other very platform-specific code, it is best to isolate such code as much as possible so that it can be replaced easily when you move the application to another platform.


Terms of use | Feedback

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