Lnking error while calling sub-programs



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Lnking error while calling sub-programs

Postby kiran_q » Wed Nov 12, 2008 8:25 pm

HI am new to mainframe, today was trying to write an small batch program which calls another two sub-program based on some condition, no data is passed b/w calling program and called program, so i used simple "CALL <sub-pgrm name>" without giving USING parameter and no linkage section was specified. but when the program is compiled it's throwing an error asas unresolved reference(first i compiled both sub-pgrm then with main program). so my question here is how would linking b/w this two sub-program to main program is done or is there anything i have misssed out to specify from calling program?
kiran_q
 
Posts: 9
Joined: Wed Nov 12, 2008 8:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Lnking error while calling sub-programs

 

Re: Lnking error while calling sub-programs

Postby dick scherrer » Thu Nov 13, 2008 12:53 am

Hello and welcome to the forum,

If you use a dynamic call, the called module will not be resolved until execution.

What happens when you try to execute the "first" program?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Lnking error while calling sub-programs

Postby kiran_q » Thu Nov 13, 2008 11:09 pm

HI Dick,

The main program only is not getting compiled successfully(both sub programs are compiled successfully), it's throwing with return code 12 with error as unresolved reference(showing sub-program names).i do specified with loadlib of sub-program in 'syslib'.
kiran_q
 
Posts: 9
Joined: Wed Nov 12, 2008 8:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Lnking error while calling sub-programs

Postby dick scherrer » Fri Nov 14, 2008 4:26 am

Hello,

Are you using the "system standard" compile jcl or are you using compile jcl you created? If you are not using the standard compile jcl, do so.

It may be that the sub-programs have actually been linked as a name not the same as the name being called or these modules have been linked into some other loadlib.

You might also change the CALLs to be dynamic rather than static and try again.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Lnking error while calling sub-programs

Postby kiran_q » Sun Nov 16, 2008 12:11 pm

Dick thank you for openhearted support, i got it right now.....
the code is working fine, Actually it was problem with DCB parameters in syslib ...
once again thank you very much...
kiran_q
 
Posts: 9
Joined: Wed Nov 12, 2008 8:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Lnking error while calling sub-programs

Postby dick scherrer » Sun Nov 16, 2008 12:14 pm

You're welcome :)

the code is working fine, Actually it was problem with DCB parameters in syslib ...

Thank you for letting us know it is working.

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post