Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 216
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: 216
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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us