View previous topic :: View next topic
|
Author |
Message |
veerabhadra
New User
Joined: 22 Jun 2006 Posts: 3
|
|
|
|
My main program is calling (static call) 5 sub programs.
My understanding for static call is ... I have to compile all the main and sub programs separately. and at the time of link edit we should link edit all the modules(main and sub) to a single load module with the main program name.
Here I have a question .. How to link edit the main and my 5 sub programs to a single load module. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Your best bet is to talk with your system support people. They can show how this is done on your system.
In general, you compile the 5 subprograms and link them. Once they are compiled/linked, compile and link the main program. The link for the main program should automatically include the called modules. Unless there is something "special" in your environment, you should not need to do anythng else.
As i mentioned, your system support people will know exactly. |
|
Back to top |
|
|
annujp
New User
Joined: 31 Aug 2005 Posts: 39 Location: St Paul,MN
|
|
|
|
If your main program is TEST which calls two sub programs TESTA and TESTB, then you need to compile and linkedit (this can be done in a single compile JCL) TESTA and TESTB first.
Then compile and link edit the main program TEST.
Thanks
Anitha |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Link your sub programs with NCAL.
When you link your main program put the PDS with the sub programs allocated to DD SYSLIB. The sub programs will automatically be picked up from here. |
|
Back to top |
|
|
veerabhadra
New User
Joined: 22 Jun 2006 Posts: 3
|
|
|
|
Thanks for your replies...
From the above can I say as following...
Compile and link edit the sub programs.
Compile and link edit the main program.
We need to refer the sub programs.. Automatically at the time compile/link edit time of main program it link edits the subprograms into main program..
Is my understanding correct? |
|
Back to top |
|
|
veerabhadra
New User
Joined: 22 Jun 2006 Posts: 3
|
|
|
|
Hi Douglas,
Link your sub programs with NCAL.
When you link your main program put the PDS with the sub programs allocated to DD SYSLIB. The sub programs will automatically be picked up from here
What is this NCAL? Is it similar to IEWL?
You mentioned to put the sub pgms library to DD SYSLIB.
You mean source programs library or the one which contains the object module?? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
You mentioned to put the sub pgms library to DD SYSLIB.
You mean source programs library or the one which contains the object module?? |
You never want to point the output of a compile/link at your source library.
If you search in these forums, you will see multiple topics where someone damaged their source library this way. |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
NCAL is a Linkage Editor Option so that called modules (like the COBOL support routines) will not be linked into the sub modules when they are first linked. These sub modules are linked into a PDS. This PDS that the sub modules are linked into should be allocated to the DD SYSlib in the link step when the main program is linked. When linking the main program do not use NCAL. The sub modules and all of the COBOL support routines will be linked in at this time. Sorry I was not more explicit in my previous post. |
|
Back to top |
|
|
|