


I have done the following to make this work:
TESTOPM - regular cobol OPM program. This is the top of my calling chain with a working storage.
In there I do a CALL TESTCBLLE USING WS-FLAG.
So far I have a call from an OPM Cobol Program to a COBOL ILE program (created with CRTBNDCBL).
Then I do a call from TESTCBLLE to TESTCILE (c program used with CRTBNDC) as:
CALL TESTCILE USING BY REFERENCE RESULT-STRING (just passing text to try).
Then I move a 'Y' back to WS-FLAG in TESTCBLLE.
All of my displays are in the TESTCBLLE to display:
DISPLAY "BEFORE CALLING TESTCILE " RESULT-STRING
DISPLAY "CALLING TESTCILE FROM TESTCBLLE"
CALL "TESTCLE" USING BY REFERENCE RESULT-STRING.
DISPLAY "AFTER CALLING TESTCILE " RESULT-STRING
It seems to be working.
I went from CBL OPM to CB ILE to C ILE. All three are programs, not modules. I created the ILE's by using the CRTBND.
Then back in the top of the food chain program, TESTOPM, after I do my call to the TESTCBLLE program I do:
DISPLAY "WAS OPEM TO ILE CBL TO ILE C A SUCCESS?" WS-FLAG.


I have a typo above:
Written originally: ‘This simply has a call to the SANDBOX *PGM.’
Should be: ‘This simply has a call to the TESTING *PGM.’
Can I call the COBOL module?
Yes and no. That is, you don’t call “modules” — you call procedures or programs.
A module will include one or more procedures. One or more modules are bound together to create either a program or a ‘service program’.
Once a program is created, you will call the program. The call will be to the entry procedure.
Within the program, you can call any of the other procedures in the same module. You may also call procedures in other modules if they were exported. By not exporting, the procedures remain private to the module.
Instead of a program, you might choose to create a service program. A service program is little other than a group of modules collected together. It’s usually best if the modules have related purposes. There’s not much point in grouping things together otherwise.
A service program is a way to use modules over and over without needing to recompile every program that uses them.
But your test case is a program, so we’ll stick with that for now.
You have a program named TESTING. It was built from a module named TESTCBLLE and a module named TESTCILE.
You would call it from another COBOL program with CALL ‘TESTING’ USING WS-FLAG.
In the COBOL module, you probably want to call into a procedure in the C module. That will take a little more discussion. The discussion should continue here rather than in a different question in order to keep all related information in one place.
If the CALL statement above isn’t working correctly for you, let us know. We’ll ask questions to locate the problem.
Tom
You have a program named TESTING. It was built from a module named TESTCBLLE and a module named TESTCILE.
You would call it from another COBOL program with CALL ‘TESTING’ USING WS-FLAG.
Is the CALL statement failing or giving unexpected results? Next steps are fairly easy if you need help. Don’t hesitate to have a dialog.
Tom