Visual COBOL Environment Variables Not Working on Linux

I use tutorial project - 03_01_Simple_structure.

If I run it in Visual COBOL on Windows, Environment Variables are working, COBOL executable code can access them in the console windows.

But I run the same code with correct Environment Variables Path on RED HAT Enterprise. The executable code complains not finding them. I need to copy the PATH into the code to replace the Environment Variables, that works !

Could someone help me to confirm that -

That might be the issue on my Linux machine only,  or that might be a little bug with Visual COBOL tools on LINUX.

Appreciated.

  • Hello jzhang18,

    I have an idea why this may be happening. By default, when you first run or debug a program in Visual COBOL for Eclipse, a new "Run Configuration" or "Debug Configuration" is automatically created. This configuration will inherit the Environment settings you've specified inside of Project Properties, but *only if you've set the Project Property for the environment before you first run the program*.  Otherwise, you'll need to either:

    1) Modify the existing Run or Debug configuration to define the environment variable(s) in the Environment tab

    2) Create a new Run or Debug configuration, now that the Project Settings specify the Environment variable. The Environment setting will be automatically added to the new runtime configuration. In this case, you need to be sure to *use* the new configuration when you run or debug your program.

    Please see the following link for information about setting environment variables in a Run or Debug configuration:

    documentation.microfocus.com/.../GUID-A966EA64-54AF-4963-BE78-75744DB6F9F8.html

  • Corrected above answer to remove references to "Build Configuration" which do not apply here.

  • Verified Answer

    Thank you, Blair

       I tried your instruction,  it still did not work for me.  I found the reason for that issue:

    In COBOL code, no matter I use Upper or Low case for Environment Variable.  The COBOL executable is always looking for UPPER CASE variable, e.g.

    Select InFile assign datain.   --- > at run-time, COBOL expects DATAIN (not datain)

    On Windows System, it does not matter if the environment variable is defined as

    datain   = PATH to the file

    or

    DATAIN = PATH to the file

    Because Windows is case-insensitive OS, but on LINUX, datain and DATAIN mean 2 things.

    I think it would be better -- in Visual COBOL, automatically convert any environment variable with all CAPITAL letters. (force to use UPPER case at design time, or convert to UPPER case at run-time, either is good)

    With that way, developer can easily move COBOL project between Windows and Linux.]

    Thank you again for the help.

    -Jack

  • In the next version of Visual COBOL,  I would like to see this implementation:

    When user adds the environment variables,  as normal:

    When he clicks Apply or OK button,   the environment variables become:

    It solves the issue for  Visual COBOL on Linux, and it works fine on Windows.

  • In the next version of Visual COBOL,  I would like to see this implementation:

    When user adds the environment variables,  as normal:

    When he clicks Apply or OK button,   the environment variables become:

    It solves the issue for  Visual COBOL on Linux, and it works fine on Windows.