Visual Cobol for Eclipse ?'s

[Migrated content. Thread originally posted on 27 April 2012]

1. How do you pass in linkage-section data items when running in the DEBUG perspective?

2. Can you explicitly point to VSAM files for testing in DEBUG perspective?
I'm trying it like this but it's not working, I get file status 9/45 on OPEN...
"C:\Development Projects\TestFiles\MYVSAM.dat"

3. Is there a setting that lets you have a different extension other than .cbl?
We have many named *.CL2, but when you bring them into the Eclipse editor it doesn't do syntax checking unless they are rename to *.cbl.
  • Question 1: pass linkage section data to .dll

    I am assuming that in question 1 you would like to populate the linkage section when the .dll is run without a main program, is this correct? I tried this by putting the parameters on the command line in run configuration settings but that did not appear to work.

    I am therefore still researching question 1 on passing linkage section items.

    Question 2: Access indexed file directly using full path name.

    Yes you should be able to assign directly to a filename in your program like you are doing and it should work.

    I just tried it here and it works fine.

    The 9/45 status code does not make much sense as it means the following:

    COBRT045 Attempt to OPEN an NLS file using incompatible language definition (Fatal)

    The NLS control information for a file in your program does not match the same NLS control information in the header of your index file. Alternatively, your index file has become corrupted.


    Rebuild your index file, or rerun your program using the backup copy of that file. If you have added a great deal of information since you last took a backup, you might want to rebuild the file using a utility that is able to read the data, if it is not corrupt, and build a new index for it.

    How are you opening the indexed file and with what type of program was it created? i.e., Net Express, ACU, RM etc.?

    Question 3: Setting new extension for COBOL Editor.

    The COBOL editor is customizable from Window > Preferences > Micro Focus COBOL > Editor. You can change the above features, as well as colors, line numbers, margins and more.

    You can also associate a new file extension with the COBOL editor. See Window > Preferences > General > Editors > File Associations. You can also associate a file extension with the content type of a COBOL file.

  • For #1 That is what I am trying too...
    Run Configurations--> General --> Start Options--> Command Line arguments

    For #2 The VSAM files are created by Cobol programs running in Server Express 5.1 on Red Hat Linux.

  • Also, for #1. This is a stand alone program, in production it gets the linkage parameters passed in via a batch script.
  • For #1 you are supposed to be able to enable the linkage section to receive the command line parameters by setting the run-time tunable "command_line_linkage=TRUE" in a cobconfig file but this does not appear to be working correctly. I will write this up as a bug.

    An alternative would be to use:

    working-storage section.
    01  wsCommandLine    pic x(256).
    procedure division.

        accept wsCommandLine from command-line

    For #2 I have no idea why you are getting this file status when trying to open the file in Visual COBOL.

    Can you run the Visual COBOL rebuild utility against this file from the command line and tell me what it reports?

    rebuild filename.dat /i

    You will most likely have to open up a support incident for this issue as we might need to get a copy of the file or set up tracing.
  • Verified Answer

    For question #1 passing command line as linkage parameters to main .EXE.

    This does work correctly if you set the COBCONFIG environment variable to point to a cobconfig.cfg file containing the tunable:

    set command_line_linkage=TRUE

    but the command line must be defined as follows:

       linkage section.
       01 lnkCommandLine.
          05 lnkCommandLineLen        pic 9(4) comp.
          05 lnkCommandLineContents   pic x(256).

       procedure division using lnkCommandLine.

           display lnkCommandLineContents(1:lnkCommandLineLen)

    In the Eclipse IDE, this means you must set the environment variable COBCONFIG to the location of your config file in the Environment tab of the Run/Debug launch configuration.

    You can then pass parameter via the command line (in the General tab of the Run/Debug launch configuration).

    or you can use ACCEPT wsVariable from COMMAND-LINE as shown previously.

  • Thanks Chris.
    The passing command line as linkage parameters to main .EXE is now working fine.

    I'm still researching the VSAM file problem, I think there's more to it than what I have reported so far.

    I tried the instructions for adding additional file extensions in the file types box on the Window/Preferences screen and it accepted the new entry and its associated editors but it is still not working. The content type box does not have 'cobol source file' as an option to associate with it.
  • I don't know if this makes a difference or not but the VSAM files are defined using Clerity UniKix before being used in the COBOL programs.
    When referencing a VSAM .dat file explicitly in the program as we're doing, is there something we need to do with the corresponding .idx file?
  • I can successfully add the *.cl2 extension to Eclipse and associate it with the COBOL Editor and then can open files with that extension and get full colorization, syntax check etc.

    I tried this in Visual COBOL Eclipse R4 Update 2.
    Is this the version that you are using?

    Steps are as follows:

    1. Navigate to Window-->Preferences.
    2. Navigate to General-->Editors->File Associations
    3. Click Add button in top window
    4. enter *.cl2 and click OK
    5. With this new extension highlighted, click Add button in bottom window.
    6. Select COBOL Editor from the list of editors.
    7. Click on OK.

    If this works differently for you then you might be on an earlier product release and need to upgrade to R4 Update 2.

    For the indexed file problem.

    If these are Micro Focus indexed files of type IDXFORMAT"4" then the file handler will be expecting the .idx to be present in the same location as the .dat file when you specify .dat as the extension.

    Do you have any idea what Clerity UniKix does to the files?

    I would suggest running the rebuild utility against the file to see if it is being recognized correctly.
    from a Visual COBOL command prompt run:

    rebuild filename.dat /i
    where filename.dat is the name of your existing file.

    What does rebuild report?
  • I am using Visual COBOL Eclipse R4 Update 2.
    I follow the same steps you listed & I get recognition & colorization but not syntax checking?

    For the indexed file problem.

    I'm not exactly sure what Clerity UniKix does to the files, but we are using the file without any issues in our production envireonment which is Server Express 5.1 on Red Hat Linux.

    When I try running the rebuild utility against the file I get an error message saying I need to run it with /o on this type of file.
  • You are correct for the file extension as it does do colorization but it is still not recognized as a COBOL source file for background parsing and compilation.

    I am checking into this.

    As for your indexed file issue it appears that the file is corrupt.
    This is most likely due to the method that you brought this file over from Unix.

    Did you transfer the files using a binary protocol so that it would not try to convert EOL characters?
    Check the file sizes for both the .DAT and .IDX files between Unix and Windows.
    They should be the same size.

    If they are not then you need to retransfer these as binary files.