Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a C++ Program

Status
Not open for further replies.

KEJ

Programmer
Oct 17, 2000
2
US
I have the need to call a C++ program from a mainframe COBOL II program. Is there anything special that needs to be done ? Any help would be appreciated. [sig][/sig]
 
Hi,

I am not familiar with C++ on the mainframe, but with assembler and Pl/1, which are both no problem to call from COBOL II.

Out of a 370 language manual:

| * If you want to call a C/C++ function with a function return value,
| use:

| CALL . . . RETURNING


but that is no valid COBOL II code, so you have to follow the instructions for assembler and in the C++ manual you can look after what to do to let the C++ program behave like an assembler program.

Perhaps you can even find something in the language environment manual.

If you can work with the newer COBOL version, it is easier.

You can find manuals at which contains a link to the COBOL manuals from IBM. [sig][/sig]
 
Yes, but it depends on the parameter types. COBOL has most of the types that C has, you just have to match the PIC and USAGE clauses carefully. Most COBOLs even have a POINTER data type these days if you have a need for one. (If you have this capability, it can be set to a location in your program with the SET statement.) Also be aware of the way the arguments should be passed. You can preceed the arguments with BY REFERENCE or BY CONTENT in order to get them passed the right way.

Betty Scherber
Brainbench MVP for COBOL II
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top