Resolving COBOL Importer Errors

When your application is unsuccessful in importing a COBOL file into your project, your application will display an error message. You may then correct the problem and re-import the file.
Types of Error Messages
  1. COBOL files that are part of your workspace (local): When your application is unsuccessful in importing a local COBOL file (which is part of the workspace) into your project, syntax error messages will appear in the task list. To view the source of the error in your code, click on the error message line in the problems view, as illustrated here:
    COBOL syntax error message
    Errors will also be logged in a generic log file, located under the metadata directory: [workspace]\.metadata\CommonBaseEvents.log
  2. COBOL files that are not part of your workspace: If the file is not part of the workspace the syntax error messages, if any, are logged in the log file. The error messages will also show up in the details section of the importer failure error dialog.
  3. Data name mangling: Only the Filler data item name is mangled to fill_XX (where XX is a suffix that is incremented for each filler data item encountered under a 01 level data structure. It is reset whenever a new 01 level data structure occurs) . For example
    1 struct. 
               5 Group1. 
                 10 Filler PIC X(30). -> fill_0
                 10 Sub-Group1.
                    15 Filler PIC x(10). -> fill_1
               5 Group2. 
                 10 Filler   PIC X(30). -> fill_2
                 10 Sub-Group1.
                    15 Filler PIC x(10). -> fill_3
     1 struct1.
               5 Group1. 
                 10 Filler PIC X(30). -> fill_0
                 10 Sub-Group1.
                    15 Filler PIC x(10). -> fill_1
               5 Group2. 
                 10 Filler   PIC X(30). -> fill_2
                 10 Sub-Group1.
                    15 Filler PIC x(10). -> fill_3

Resolving Import Problems

  1. Problem: Import succeeds, but there is no data: Possible reasons for this include
    • The COBOL source is a nested program (which the COBOL importer does not support).
    • A COPY book (.cpy file) contains a complete program.
      Solution
      • Rename it to .cbl, .cob or .ccp
      • Change the default behavior of the file extension .cpy to refer to Full Program. You can change the file extension support for .cpy to "FP" by using the File Extension Support table in the "More COBOL options" tab of the COBOL importer preferences page (Window > Preferences > Importer > COBOL).
  2. Problem: COPY library not found: The error "COPY library not found" error may appear in the task list as follows:
    COPY library not found

    The reason for this error is that the COPYBOOK(s) are not in the same location as the main source file. To resolve this, make sure that the COPYBOOKs are located in the same location as the main source file. In addition, you can use the SYSLIB table in the Preferences page to provide location(s) to find the copybooks.

  3. Problem: The current locale does not support DBCS data: The error "The current locale does not support DBCS data" may appear in the problems task list as follows:
    The current locale does not support DBCS data

    To resolve this problem, change the compile time locale to the one that supports DBCS data by going into the "More COBOL options" tab of the COBOL importer preferences page (Window > Preferences > Importer > COBOL) and select, for example, ja_JP for "Compile time locale name."

  4. Problem: Non-COBOL character(s) were found: The error "Non-COBOL character(s) were found" may appear in the problems task list as follows:Non-COBOL characters found
    Solution
    • If the COBOL source has data names in DBCS, change the compile time locale to the one which supports DBCS data by going into the "More COBOL options" tab of the COBOL importer preferences page (Window > Preferences > Importer > COBOL) and select say ja_JP for "Compile time locale name".

Feedback