Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

.cobos file for compilation on PC.

2011-11-14
2013-04-25
  • Hi all,
    I'm trying out the COBOS project in conjunction with Eclipse.
    I have created a small project containing 1 cobol source. Since I can not connect
    to a mainframe I would like to compile my program on the PC. Therefore I adapted
    the .cobos file, but I'm not sure it is correct.
    When I compile the source, I have to fill in my user-ID and password to connect
    to localhost, but then I get the error that it is not possible to connect to port 22.
    Where can I change this and what is the correct portnumber ?

    I also would like to know if it is possible to test the program on PC environment.
    If yes, how can this be done when the program needs input and/or output files.

    I read that is should be possible to use DB2. Is this only possible on mainframe
    or can it also be used with DB2 Express-C on PC environment.

    Kind regards
         Walter Verbraeken

     
  • Hello Walter,

    Currently, the menu Cobos is designed to work with a mainframe: the compilation item launches a build script on the mainframe. that's the raison why you are asked to connect.
    To build an executable on the PC, I tried to change the settings for OpenCobol Check syntax in the .cobos  file(<build> tag) but it does not work because Cobos inserts an incompatible parameter.

    So the solution is to run  OpenCobol through Run / External Tools:
    You create a configuration in the Main tab:
    location: <your path> eclipse\plugins\com.metrixware.cobos.core_2.2.0.RC1\OpenCobol\COBC\cobc.exe
    working directory: ${workspace_loc}${project_path} for example
    arguments: "${workspace_loc}${resource_path}" <- name of program Currently edited
    you have to add the necessary parameters (run cobc - help in a command windows for syntax details)
    for example, with the -C parameter, you get the translation  of your Cobol program in C language.

    in Environment tab, you can set variables for  OpenCObol run. for example:
    COB_CONFIG_DIR <your eclipse path>\plugins\com.metrixware.cobos.core_2.2.0.RC1\OpenCobol\config

    To produce an executable, you have to install gcc on your PC.

    It would be great if anyone of us could write a detailed how-to !

    You open and write sequential files on a PC without problems.

    For DB2, you can download and install DB2 UDB on your PC and create a configuration running DB2 preprocessor before OpenCobol step. It's that simple ! :)

    I hope it will help.

    Regards
    O.Boiteux