Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Mixing Cobol and C++

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Grant Goodale

New User


Joined: 13 Nov 2010
Posts: 55
Location: Brampton, Ontario, Canada

PostPosted: Wed Nov 24, 2010 8:58 pm    Post subject: Mixing Cobol and C++
Reply with quote

We have a legacy Cobol program that calls an Assembler routine dynamically for table handling functions. We want to convert this Assembler routine to C/C++. That is no big problem. the problem comes in when the C++ is running in 64 bit mode. This requires that the C++ be set up as XPLINK. However, the Language Environment manuals state that a Cobol dynamic call of an XPLINK function is not supported.

I have tried creating a small Assembler module as "glue" code but the parameters passed into C++ end up being junk.

Has anyone addressed any similar problems of mixing Cobol and C++ dynamically?

TIA
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Wed Nov 24, 2010 9:03 pm    Post subject: Reply to: Mixing Cobol and C++
Reply with quote

why C++ and why 64bits
do You have a <doctors> prescription for that ? icon_biggrin.gif

in one of Your previous post we discussed about C not C++
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Nov 24, 2010 9:03 pm    Post subject: Reply to: Mixing Cobol and C++
Reply with quote

HLASM can run above the bar, so why C or C++?

COBOL will NEVER be above the bar in the near future but perhaps, one day.

Is this a management directive?

Bill
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Wed Nov 24, 2010 9:08 pm    Post subject: Reply to: Mixing Cobol and C++
Reply with quote

/sillyness on
C++ is for lame programmers
they can legally tell that they did not make errors... they just inherited them
/sillyness off
Back to top
View user's profile Send private message
Grant Goodale

New User


Joined: 13 Nov 2010
Posts: 55
Location: Brampton, Ontario, Canada

PostPosted: Wed Nov 24, 2010 9:09 pm    Post subject:
Reply with quote

We have already converted the Assembler to 64 bit and that runs just fine.

They want to convert to C so that future maintenance might be easier. Us old Assembler types are starting to die off and they are thinking down the road.

They have no desire to have Cobol above the bar. This is a table handling subourtine and it now handles some very big tables -3GB plus.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Nov 24, 2010 9:17 pm    Post subject: Reply to: Mixing Cobol and C++
Reply with quote

Well, I can't help from here. I'm not that literate in C.

This sounds like one of those management decisions, like "If our Assembler person gets hit by a bus, who will maintain this routine".

Of course, these are the builtin-in scare tactics that they use for justification.

But, as I eluded to, COBOL will never be above the bar and won't go beyond AMODE 31. However, never versions of Enterprise PL/I can go above the bar.

Assembler will always be around, long after we're all dust in the wind, so this seems like an overreaction.

You could pass this on to your next Journeyman? icon_wink.gif

Bill
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Nov 25, 2010 3:03 pm    Post subject: Re: Reply to: Mixing Cobol and C++
Reply with quote

Bill O'Boyle wrote:
This sounds like one of those management decisions, like "If our Assembler person gets hit by a bus, who will maintain this routine".
This sentence was actually told in some of your meetings, Bill...or...?

I had a good laugh, however...icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Nov 25, 2010 3:16 pm    Post subject: Re: Mixing Cobol and C++
Reply with quote

Grant Goodale wrote:
This requires that the C++ be set up as XPLINK. However, the Language Environment manuals state that a Cobol dynamic call of an XPLINK function is not supported.
Grant - I'm not very sure and have never tried this, however, may be this part of the manual can help you The only way a COBOL routine can call an XPLINK-compiled routine is if the caller is compiled with the Enterprise COBOL for z/OS or COBOL for OS/390 & VM compiler with the DLL compiler option, and the target of the call is in a separate DLL, or vice versa. though as you said, COBOL Dynamic Call to XPLINK is not supported..is just the next line manual.

Another links: http://www-03.ibm.com/systems/z/os/zos/installation/zos_cobol_faqs.html
http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.ceea400/clcccb3.htm
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Nov 25, 2010 9:29 pm    Post subject:
Reply with quote

Hi Anuj,

Quote:
This sentence was actually told in some of your meetings, Bill...or...?
This is often heard in meetings and in one-on-one converstion.

When someone has knowledge that would be needed but has not been distributed (meeting or e-mail or other document) they might say something like: "If i get hit by a bus, the cd with the data is in my cabinet".

They don't really expect to get hit by a bus, but this is used generically to refer to a sudden unexpected absence icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us