IBM Support

How to preprocess a PLI program wih dual NOT symbol in IBM Developer for z/OS?

How To


Summary

This document shows a possible solution to edit PL/I programs containing the multiple logical NOT symbol ¬ (EBCDIC x'5F') and ^ and when you use UTF-8 encoding in IBM Developer for z/OS (IDz) client.

To correctly parse a PL/I program with many macros, the IDz real-time syntax check needs to preprocess it using the local compiler through menu "Identified using configured preprocessor".

However, the local PL/I compiler supports only single-byte characters as logical NOT symbol and character ¬ is single byte in EBCDIC while it is double bytes in UTF-8. It thus cannot be used as logical NOT symbol.

PL/I NOT symbol ¬ can be automatically converted to an alternate not symbol like ^ on the Remote System Explorer file system mapping.

However, this method does not work with a program that uses both NOT symbol ¬ and ^.
When ^ is already used, setting also ^ as alternative not symbol for ¬ will lead to the error:
CRRZI0487E File '{0}' contains characters that cannot be transferred correctly between the local and remote systems. These characters will be highlighted. The file will be opened in read-only mode.

Objective

A local custom preprocessor can be created to convert all ¬ into ^ before calling the local PL/I preprocessor.
For example with the following PL/I program:
PLI without preprocessing
And include file:
include

Steps

Attachment idzPliNotpreprocessor_sample.zip is a Java project containing a PL/I custom preprocessor with the following code:
public static void main(String[] args) {
          // read the file line by line
          while ((strLine = reader.readLine()) != null) {
            log("read line=" + strLine);
          strLine = fixPli(strLine);
          log("write line=" + strLine);
          writer.write(strLine);
          writer.write("\n");
}
    private static String fixPli(String strLine) {
        PliLine srcLine = new PliLine(strLine);
        return srcLine.fixPliNot();
    }
    public String fixPliNot(){
        return line.replace('¬', '^');
    }
Once exported to a JAR file (attachment plinot.zip), you can use it with your property group.
After preprocessing, the editor shows no more syntax check errors or invalid statements:
PLI code after preprocessing
Configure a custom preprocessor
You can add this custom preprocessor to your property group on tab PL/I and item "Local Preprocessor":
property group
Arguments are:
-cp "c:\temp\plinot.jar" custom.idz.PliNot "${resource_loc}" "${rdz_cache_home}\BuildOutput\${resource_fn}.pli"
${rdz_cache_home} can be used when the PL/I program is opened directly from the remote systems explorer.
Output is: ${resource_fn}.pli
Run it
You can run it from the PL/I editor with menu Source > Preprocessor Statements > Identified using configured preprocessors
menu
The preprocessor runs:
popup
Result and log can be found on the Remote console view:
console

Additional Information

All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind.
IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB35","label":"Mainframe SW"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSTRMM","label":"IBM Developer for z\/OS"},"ARM Category":[{"code":"a8m0z0000001iNHAAY","label":"IBM Developer for Z\/OS-\u003EIDz Client-\u003EEditors-\u003EPL\/I Editor-\u003EPreprocessor"}],"ARM Case Number":"TS003758546","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"},{"Type":"MASTER","Line of Business":{"code":"LOB35","label":"Mainframe SW"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSTRMM","label":"IBM Developer for z\/OS"},"ARM Category":[{"code":"a8m0z00000009HWAAY","label":"IBM Developer for Z\/OS-\u003EIDz Client-\u003EEditors"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Product Synonym

IDz

Document Information

Modified date:
28 September 2023

UID

ibm16332431