Troubleshooting
Problem
Warning "ERROR_TOKEN unexpected tokens ignored" is displayed when editing a COBOL program in IBM Developer for z/OS editors.
Symptom
COBOL syntax would be similar to the following:
raises a warning:
If many of these warnings appear in the code, it can be disturbing for the developer.
MOVE 5 TO MY-VAL(MY-IDX,2).
raises a warning:
"ERROR_TOKEN unexpected tokens ignored"
If many of these warnings appear in the code, it can be disturbing for the developer.
Cause
This is working as designed and follows the COBOL rules (see links section below ). The IBM COBOL compiler will also give a warning:
IGYPS0001-W A blank was missing before character "1" in column 30.
A blank was assumed.
Resolving The Problem
The problem can be solved by using an IDz preprocessor mechanism.
This technote gives an example.
Java code of the preprocessor
The main class:
Known issues
To test the attached preprocessor sample
The attached jar file can be used as-is, but it will attempt to create a log file in
with these settings:
To modify the attached preprocessor sample
Import the jar file in RDz as Java project:
You can then modify the code and export it again to a jar file:
This technote gives an example.
- When the member is opened in the IDz COBOL Editor, a warning is displayed.
- A preprocessor is configured on the property group:
- Editor preferences are set to not ignore spaces: uncheck Ignore changes to tab and space characters in Preferences > COBOL > Editor > Preprocessor Integration and also set for the LPEX and/or PL/I Editor.
- Preprocessor is invoked
- Warning disappears and COBOL Editor shows the difference with the original code:
Java code of the preprocessor
The main class:
- reads the COBOL member line by line
- add a blank if needed using Java regular expression
public static void main(String[] args) { |
/** |
Known issues
- The above code does not check if the modified line (ie with added blanks) goes over the 72 column.
- The preprocessor should not be configured to ignore spaces otherwise it will not detect any differences before and after preprocessing.
To test the attached preprocessor sample
The attached jar file can be used as-is, but it will attempt to create a log file in
c:\temp\mycblpreproc.log
- Save the jar in c:\temp\mycblpreproc.jar for example.
- Configure it as Local preprocessor on your property group:
with these settings:
Preprocessor name | <your IBM JDK path>, for example C:\Users\IBM_ADMIN\IBM\SDP9\jdk\bin\javaw.exe |
Preprocessor arguments | -classpath c:\temp\mycblpreproc.jar com.ibm.support.rdz.preprocessor.MyCobolPreprocessor "${resource_loc}" "${resource_fn}.cee" |
Preprocessor output filename | ${resource_fn}.cee |
To modify the attached preprocessor sample
Import the jar file in RDz as Java project:
- Menu File > Import > General > Existing projects into Workspace
- Select "Select archive file"
- Click Finish
You can then modify the code and export it again to a jar file:
- Right-click on the Java project MyRDzPreprocessors and select menu Export
- Select menu Java > Jar file
Related Information
[{"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":"a8m0z00000009EiAAI","label":"IBM Developer for Z\/OS-\u003EIDz Client-\u003EEditors-\u003ECobol Editor-\u003EContent Assist"}],"ARM Case Number":"","Platform":[{"code":"PF033","label":"Windows"}],"Version":"All Versions"}]
Product Synonym
idz
Was this topic helpful?
Document Information
Modified date:
28 September 2023
UID
swg21683178