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

How to compile static call programs


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

New User


Joined: 22 Jun 2006
Posts: 3

PostPosted: Fri Oct 12, 2007 7:39 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Oct 12, 2007 8:05 pm
Reply with quote

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
View user's profile Send private message
annujp

New User


Joined: 31 Aug 2005
Posts: 39
Location: St Paul,MN

PostPosted: Fri Oct 12, 2007 8:17 pm
Reply with quote

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
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Fri Oct 12, 2007 8:54 pm
Reply with quote

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
View user's profile Send private message
veerabhadra

New User


Joined: 22 Jun 2006
Posts: 3

PostPosted: Fri Oct 12, 2007 8:59 pm
Reply with quote

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
View user's profile Send private message
veerabhadra

New User


Joined: 22 Jun 2006
Posts: 3

PostPosted: Fri Oct 12, 2007 9:36 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Oct 13, 2007 12:06 am
Reply with quote

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
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Sat Oct 13, 2007 12:29 am
Reply with quote

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
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts C Compile time time stamps Java & MQSeries 10
No new posts Fetch data from programs execute (dat... DB2 3
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
Search our Forums:

Back to Top