Skip to main content

[Migrated content. Thread originally posted on 17 February 2011]

Hello,

First of all, congratulations for your product. We are working under RM/COBOL since years, and this seems really a very good alternative for us.

I'm performing a simple test: under Eclipse, I have two programs, and the first program does nothing but sets the parameters for the second and executes CALL "PROGRAM". I've tried this in a single executable project, several executables in an unique project, one project executabe with the caller and another library project for the second, etc.

The problem is that I cannot execute never the second program, due to incorrect path errors...

I'm sure I'm doing something wrong. But, what?

Regards

[Migrated content. Thread originally posted on 17 February 2011]

Hello,

First of all, congratulations for your product. We are working under RM/COBOL since years, and this seems really a very good alternative for us.

I'm performing a simple test: under Eclipse, I have two programs, and the first program does nothing but sets the parameters for the second and executes CALL "PROGRAM". I've tried this in a single executable project, several executables in an unique project, one project executabe with the caller and another library project for the second, etc.

The problem is that I cannot execute never the second program, due to incorrect path errors...

I'm sure I'm doing something wrong. But, what?

Regards
Using the following two programs Prog1.cbl and Prog2.cbl.

If they both exist in a project for a single executable file then Prog1 will call Prog2 by entry point and as long as they match it should work.

But if Prog1.cbl is in a project for an executable and Prog2.cbl is in a separate project for a .DLL then you have to do the following so that Prog1.exe can find Prog2.dll:

1. The project containing the called program must have the same name as the program in the call statement,
i.e. Prog2. This will cause it to create the executable Prog2.dll.

2. You must add the location of the Prog2.dll to your system PATH and then start Eclipse so it will pick it up.
In my example here using my workspace this would be:
C:\\Users\\crg\\workspace\\Prog2\\New_Configuration.bin

3. As an alternative to 2 above you could add the full path to the name of the program being called.
i.e. call "C:\\Users\\crg\\workspace\\Prog2\\New_Configuration.bin\\prog2.dll" using params

EXEs cannot call other .EXEs.
They must call either entry points within themselves or entry points within a .DLL.



Prog1.cbl:
       program-id. Prog1 as "Prog1".
       data division.
       working-storage section.
       01 next-prog    pic x(30)  value "prog2".
       01 params       pic x(5)   value "12345".
       procedure division.

           display "in prog 1"
           call "prog2" using params
           call next-prog using params       
           display "back = " params
           goback.

       end program Prog1.
Prog2.cbl:

       program-id. Prog2 as "Prog2".
       data division.
       working-storage section.
       linkage section.
       01 params     pic x(5).
       procedure division using params.
           display "in prog2"
           move "prog2" to params
           goback.
       end program Prog2.

[Migrated content. Thread originally posted on 17 February 2011]

Hello,

First of all, congratulations for your product. We are working under RM/COBOL since years, and this seems really a very good alternative for us.

I'm performing a simple test: under Eclipse, I have two programs, and the first program does nothing but sets the parameters for the second and executes CALL "PROGRAM". I've tried this in a single executable project, several executables in an unique project, one project executabe with the caller and another library project for the second, etc.

The problem is that I cannot execute never the second program, due to incorrect path errors...

I'm sure I'm doing something wrong. But, what?

Regards
Hello,

When you say:

"f they both exist in a project for a single executable file then Prog1 will call Prog2 by entry point and as long as they match it should work."

You mean that the following CALL in a single exe project will work?

PRBASE0003:
CALL "BASE0003" USING PARAMETROS-0003.
BASE0003:
IDENTIFICATION DIVISION.
PROGRAM-ID. BASE0003.

In my case, execution starts with BASE0003, and I don't know how to set PRBASE0003 as the default main program.

[Migrated content. Thread originally posted on 17 February 2011]

Hello,

First of all, congratulations for your product. We are working under RM/COBOL since years, and this seems really a very good alternative for us.

I'm performing a simple test: under Eclipse, I have two programs, and the first program does nothing but sets the parameters for the second and executes CALL "PROGRAM". I've tried this in a single executable project, several executables in an unique project, one project executabe with the caller and another library project for the second, etc.

The problem is that I cannot execute never the second program, due to incorrect path errors...

I'm sure I'm doing something wrong. But, what?

Regards
Great! It works!

Thank you

[Migrated content. Thread originally posted on 17 February 2011]

Hello,

First of all, congratulations for your product. We are working under RM/COBOL since years, and this seems really a very good alternative for us.

I'm performing a simple test: under Eclipse, I have two programs, and the first program does nothing but sets the parameters for the second and executes CALL "PROGRAM". I've tried this in a single executable project, several executables in an unique project, one project executabe with the caller and another library project for the second, etc.

The problem is that I cannot execute never the second program, due to incorrect path errors...

I'm sure I'm doing something wrong. But, what?

Regards
Right click on the project name and Select Properties.
Select Build Configurations and highlight the desired build and click the Edit button.
Click Next 3 times until you are on Link Settings.

In the Entry point field type: PRBASE0003
Click Finish.

PRBASE0003 should now be the starting program.