Page 1 of 1

Lnking error while calling sub-programs

PostPosted: Wed Nov 12, 2008 8:25 pm
by kiran_q
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?

Re: Lnking error while calling sub-programs

PostPosted: Thu Nov 13, 2008 12:53 am
by dick scherrer
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?

Re: Lnking error while calling sub-programs

PostPosted: Thu Nov 13, 2008 11:09 pm
by kiran_q
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'.

Re: Lnking error while calling sub-programs

PostPosted: Fri Nov 14, 2008 4:26 am
by dick scherrer
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.

Re: Lnking error while calling sub-programs

PostPosted: Sun Nov 16, 2008 12:11 pm
by kiran_q
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...

Re: Lnking error while calling sub-programs

PostPosted: Sun Nov 16, 2008 12:14 pm
by dick scherrer
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