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
 

 

Another view of the diff between Static & Dynamic calls

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
Hari Koteswararao

New User


Joined: 09 Mar 2010
Posts: 1
Location: Kolkata

PostPosted: Thu Mar 11, 2010 6:07 pm    Post subject: Another view of the diff between Static & Dynamic calls
Reply with quote

After reading a very old thread, Difference between Static Call and Dynamic Call in COBOL,
I am going to explain with an example: Main program:PROGA, sub prog:PROGB.


1.In this case if you use CALL PROGB USING A,B,C; It is call static call
if you move sub prog name to some WS variable and
CALL WS-VAR USING A,B,C---It is called Dynatmic.
2. in static call if you made any changes in sub program you have to compile all the programs. but in Dynamic call need to compile only the changed programs.
3.in static call all the sub modules are link edited with main load module
where as in Dynamic call created different loadmodules.
Back to top
View user's profile Send private message

Karthikeyan Subbarayan

New User


Joined: 24 Feb 2008
Posts: 56
Location: Boston

PostPosted: Thu Mar 11, 2010 6:15 pm    Post subject:
Reply with quote

I dont think calling a Sub program with some WS variable is a Dynamic call.
some additional info.
Dynamic
1) If the subprogram undergoes change. Recompile of sub program is enough
2) Sub routine picked during run time form load library
3) Program will be in the initial state every time.
4) Size of load module will be less.
Static
1) If the subprogram undergoes change. Recompile of sub program & main program is required
2) Sub module link edited with main module
3) Program won’t be in the initial state.
4) Size of the load module will be more
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Thu Mar 11, 2010 11:14 pm    Post subject:
Reply with quote

Hello,

Quote:
I dont think calling a Sub program with some WS variable is a Dynamic call.
Suggest you re-consider. . .

When a CALL is made via a WS variable it is not resolved during the linkedit and will be resolved at execution - i.e. dynamically.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Mar 12, 2010 9:36 am    Post subject:
Reply with quote

Note also that the DYNAM compiler option will cause a CALL literal to be a dynamic CALL instead of a static CALL. See Programming Guide for details.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Fri Mar 12, 2010 10:02 pm    Post subject:
Reply with quote

Note, too, that in a STATIC call environment, if you change and re-compile a sub-program it is really not necessary to re-COMPILE the MAIN program, it is only necessary to re-LINK ( re-bind ) the main program - to replace the (obsolete) sub-program in the statically-linked executable.

Additionally, in a DYNAMIC call environment, a sub-program will not necessarily be in its initial state on every call unless a) a CANCEL statement has been issued prior to each CALL, or b) the sub-program has been compiled with the INITIAL attribute. In fact, there is no guarantee that the sub-program will be in its initial state even on the first call, if the sub-program was compiled with the RECURSIVE attribute, since there could be a "used" copy of the module in-core at the time of the call.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts REXX to view the PGM or PROC jackzhang75 CLIST & REXX 11 Tue Jun 20, 2017 1:20 am
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts How to see VIEW definition from BMC c... rohanthengal DB2 1 Thu May 04, 2017 1:50 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


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