IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to call OO cobol from legacy cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
namitjai

New User


Joined: 12 Feb 2008
Posts: 41
Location: Bangalore

PostPosted: Thu Feb 12, 2009 5:18 pm
Reply with quote

Hi,

I am able to call Java methods from OO cobol program. But I am not able to get hold of the way in order to call OO cobol program from procedural cobol program(legacy cobol program). Can anybody please help me over this.

Thanks,
NAMIT JAIN
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Feb 12, 2009 9:17 pm
Reply with quote

Hello,

What have you tried? What happened?

Is there a problem with compiling, link editing, or run-time?

If you explain where things are going wrong, someone may be able to offer a suggestion.

For starters, i'd be tempted to write the famous "hello world" program in OO cobol and invoke it from some procedural stub (the only thing the stub would do is disply that it was calling the "hello world" module and another display saying it had successfully returned from the "hello world" module). The "output" would be only the 3 display statements. Once this is working, expand to the real requirement.
Back to top
View user's profile Send private message
namitjai

New User


Joined: 12 Feb 2008
Posts: 41
Location: Bangalore

PostPosted: Fri Feb 13, 2009 11:56 am
Reply with quote

I am able to invoke "Hello world" program from my OO cobol program ,but I want to invoke that OO cobol program from a procedural OO cobol program(My requirement is to create a OO cobol wrapper which can be invoked from the legacy cobol applications(procedural cobol programs). This is to enable interaction between Legacy cobol application and Java programs) Now when I am trying to link edit the Sample procedural cobol program I am getting error as :

IEW2456E 9207 SYMBOL GetJVMPtr UNRESOLVED. MEMBER COULD NOT BE INCLUDED FROM THE DESIGNATED CALL LIBRARY.
IEW2456E 9207 SYMBOL GetEnvPtr UNRESOLVED. MEMBER COULD NOT BE INCLUDED FROM THE DESIGNATED CALL LIBRARY.
IEW2456E 9207 SYMBOL GetClassObject UNRESOLVED. MEMBER COULD NOT BE INCLUDED FROM THE DESIGNATED CALL LIBRARY.


Can you please tell me what mistake I am probably making.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Feb 13, 2009 12:05 pm
Reply with quote

Hello,

Suggest you work with your system support people. It sounds like one or more load libraries are not available to your process.

You may need new inclusions in the compile/link jcl as well as the execute jcl.

Your support people should be able to tell you where the needed modules reside and incorporate them into the standard comp;ile/link jcl.

Good luck icon_smile.gif
Back to top
View user's profile Send private message
namitjai

New User


Joined: 12 Feb 2008
Posts: 41
Location: Bangalore

PostPosted: Fri Feb 13, 2009 12:15 pm
Reply with quote

I am including given below two libraries in my link edit part of OO cobol program(OOSAMP) :
INCLUDE '/usr/lpp/java/J1.4/bin/classic/libjvm.x'
INCLUDE '/usr/lpp/cobol/lib/igzcjava.x'


and its working fine as I checked its connectivity with the JAVA methods which are residing in USS. But its giving me the error(Which I mentioned in above post) in the link edit part of sample legacy cobol program(BCHDRVR) in which I am making a static call to the OOSAMP from BCHDRVR. I included these two files in the link edit step of BCHDRVR also.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Feb 13, 2009 12:59 pm
Reply with quote

namitjai,
why are you making the non-oo to oo CALL static?
Back to top
View user's profile Send private message
namitjai

New User


Joined: 12 Feb 2008
Posts: 41
Location: Bangalore

PostPosted: Fri Feb 13, 2009 1:03 pm
Reply with quote

Because My OO cobol is a dll and My non-oo cobol is a nondll and according to a document we can make call from a non-dll to a dll by:

Put the COBOL DLL programs that you want to call from the COBOL non-DLL programs in the load module that contains the main program. Use static calls from the COBOL non-DLL programs to call the COBOL DLL programs.

The COBOL DLL programs in the load module that contains the main program can call COBOL DLL programs in other DLLs.


Can yoy please let me know if there is any other way to call a OO cobol from my non-oo cobol program.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Feb 13, 2009 8:53 pm
Reply with quote

Hello,

If you use static calls, you will have to find a way for those modules to be available to the linkedit.

Suggest you make contact with whoever provided the directions to use static calls.

As an experiment, what happens if you try dynamic calls?
Back to top
View user's profile Send private message
namitjai

New User


Joined: 12 Feb 2008
Posts: 41
Location: Bangalore

PostPosted: Mon Feb 16, 2009 11:53 am
Reply with quote

I tried using Dynamic calls but compiler shows error saying DLL application cannot be called using Dynamic call...However I am able to resolve my compiler issue by giving following compiler options in my JCL;
Compile step: PARM='RENT'
LInk Step: PARM='RENT,LIST,LET,MAP,XREF,CASE(MIXED),DYNAM(DLL),
// RMODE(ANY)'

Thanks for your help.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Feb 16, 2009 9:50 pm
Reply with quote

Good to hear it is working - thank you for posting your resolution icon_smile.gif

d
Back to top
View user's profile Send private message
namitjai

New User


Joined: 12 Feb 2008
Posts: 41
Location: Bangalore

PostPosted: Wed Feb 18, 2009 11:07 am
Reply with quote

Hi,

I missed the link for the reply posted for my last post. I posted my problem in continuation of this post ..is it possible to get that link again? If not than can you please let me know solution for my problem once again:

Problem:
I wanted to know the code snippet for handling String array in my OO cobol program(in Z/OS). String array I am getting from my java method residing in USS.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top