Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
what is the difference b/w the mainprogram and sub program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: what is the difference b/w the mainprogram and sub program
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: 215
Location: India

PostPosted: Fri May 23, 2008 12:05 pm    Post subject: Re: what is the difference b/w the mainprogram and sub prog
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    Post subject:
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    Post subject: Reply to: what is the difference b/w the mainprogram and su
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: 215
Location: India

PostPosted: Fri May 23, 2008 2:01 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Fri May 23, 2008 2:40 pm    Post subject: Reply to: what is the difference b/w the mainprogram and su
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 4 Fri Sep 22, 2017 4:56 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us