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

what is the difference b/w the mainprogram and sub program


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

New User


Joined: 23 May 2008
Posts: 1
Location: Hyd

PostPosted: Fri May 23, 2008 11:35 am
Reply with quote

just I want differenc b/w mainprogarm and sub program
at same time dynamic call and static call
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Fri May 23, 2008 12:05 pm
Reply with quote

sureshreddypalukuru wrote:
just I want differenc b/w mainprogarm and sub program
at same time dynamic call and static call


Hi Suresh,

Subprogram usually will have a specific logic which can be used at many places i mean which can be called by many programs.

Means if u have the specific logic used at many places then it will be coded in Subprogram.

For ur second one

If compiled as NODYNAM:
CALL 'literal' is a static call
CALL WS-label is a dynamic call

If compiled as DYNAM:
CALL 'literal' is a dynamic call
CALL WS-label is a dynamic call


How much expensive is Dynamic calls?
If I have a choice to make it static or dynamic what should be my choice?


If storage is of main concern, then we can go for "Dynamic call" as module will be loaded to main memory only when it is called/needed.

If speed is of main concern, then we can go for "Static Call" as all modules will be link-edited together into the calling module during compilation process only.


The dynamic and static calling depends on Compiler options only.

U can check a program is calling other pgm dynamically/ statically by looking at the load module.

Suppose program XYZ is calling ABC , then the load module of XYZ in case of dynamic calling will not have any other load module.

If XYZ has a static call to ABC , in that case load module of XYZ will be having load module of ABC also attached to it. If XYZ is calling more then one programs static way , then u will find all those load modules attached in the load module of XYZ.
In case of static calling , first u will have to compile the called programs and then compile the main program.
Back to top
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Fri May 23, 2008 12:33 pm
Reply with quote

Dont u think this has the answers in the manuals?
Back to top
View user's profile Send private message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Fri May 23, 2008 12:42 pm
Reply with quote

Even these are availables in any FAQs of COBOL.
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Fri May 23, 2008 2:01 pm
Reply with quote

the_gautam wrote:
Dont u think this has the answers in the manuals?


Yes ofcourse...As i have info which i got from this forum i have shared the same.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri May 23, 2008 2:40 pm
Reply with quote

gautam,

Quote:
Dont u think this has the answers in the manuals?


Yes, but it doesn't stop anyone from answering.
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 Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top