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
 
Regarding static and dynamic call.

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

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Wed Oct 11, 2006 11:06 am    Post subject: Regarding static and dynamic call.
Reply with quote

can anyone pls tell me exactly wats static call and dynamic call.

static call the called program cannot be changed
dynamic call the called program can be changed

apart from this pls explain me.
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Oct 11, 2006 11:22 am    Post subject:
Reply with quote

Hi There,

The Difference :

The main difference between static and dynamic call is the time at which the load module of a subroutine gets invoked or gets attached to the load module of its main program. To get a better picture, let us take an example.

Let A be the Main Program, and this main program invokes the subroutines X, Y and Z. We would have coded the modules X, Y, Z and would have compiled it before executing A.


Static Call:

Now, a static call to the modules X, Y and Z means attaching the load modules of X, Y, Z to the load module of A. It?s like creating a single pack which contains all the load modules needed to execute a higher level program which calls many other programs. This can be done by specifying the compiler option "NODYAM" while compiling the program.

All the load modules of sub routines are embedded within the load module of the main progam.


Dynamic Call:

A dynamic call to the modules X,Y and Z means that you will not attach the load modules of X,Y, Z to the load module of A. The load modules of X,Y and Z will lie in a separate library and the load module of A will lie in a separate library. You will just refer to the library in which the load modules of X,Y and Z lie, while executing the program A. So when ever the subroutines X or Y or Z are invoked in the program A, the library which is specified will be searched for the load modules. By mistake, if the library of the subroutine does not contain the referred program, the system standard library will be searched. If the program is not found in standard library too, the programs will abend. This can be done by specifying the compiler option "DYNAM" while compiling the program.

Performance Comparison of Static Call and Dynamic Call:
Both Static call and Dynamic Call are advantageous depending on various parameters.
1) If your subroutines involve frequent changes, then static call will be a burden. Since the load module of the subroutine is embedded inside the load module of the main program, when ever you recompile the subroutine, you should relink(Process of replacing the old load module with new one) the main program. This surely will be a burden.
In dynamic call, it?s enough if you recompile the sub-routine and put it in the specified library. The new load module will be invoked automatically from the library specified.
2) On the other hand, statically called programs take less time to execute. The overload of searching the library and then invoking the required load is not present in case of static calls.
So, depending on our application need both static calls and dynamic calls are advantageous
Back to top
View user's profile Send private message
jose.jeyan

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Wed Oct 11, 2006 12:36 pm    Post subject: Re: Regarding static and dynamic call.
Reply with quote

Loads of thanks to u man,I have asked to many people and now getting a clear idea of it.

is there any difference in coding (in cobol pgm)

as we can call in the procedure division as well as in the working storage section.

jose.jeyan
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Wed Oct 11, 2006 12:41 pm    Post subject:
Reply with quote

JOSE,

While coding in you calling program,

For a Dynamic Call:
In working storage:
77 WS-DYNAMIC-ROUTINE PIC X(08) VALUE 'XXXXXXX'.
CALL WS-DYNAMIC-ROUTINE USING LINK-VARIABLES.

For a static Call:
CALL 'XXXXXX' USING LINK-VARIABLES.


~Vamsi
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Wed Oct 11, 2006 3:16 pm    Post subject: Re: Regarding static and dynamic call.
Reply with quote

Hi,

I think Static and Dynamic calls are not based on how you written your call statement.
This will be set with compiler options.
If compiler option "dynam" is on then call will be dynamic otherwise call will be static.
Back to top
View user's profile Send private message
bonniem

New User


Joined: 09 Aug 2005
Posts: 67

PostPosted: Wed Oct 11, 2006 5:37 pm    Post subject:
Reply with quote

What surya said is right if the call is "CALL 'XXXXXX' USING LINK-VARIABLES."

In this case it depends on the compiler option.

If call is like
77 WS-DYNAMIC-ROUTINE PIC X(08) VALUE 'XXXXXXX'.
CALL WS-DYNAMIC-ROUTINE USING LINK-VARIABLES.

then it is dynamic, whatever the compiler option.
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Thu Oct 12, 2006 4:32 pm    Post subject: Re: Regarding static and dynamic call.
Reply with quote

Hi,


Static or Dynamic call is depends only on Compiler option.
If Compiler option set to "NODYNAM" then it is Static Call else "DYNAM" then it is Dynamic call.

There is no dependency on moving called program name to WS-working variable or using called program name directly in CALL staement.
Back to top
View user's profile Send private message
zaq2wsx

New User


Joined: 16 Oct 2006
Posts: 3

PostPosted: Tue Oct 17, 2006 11:05 am    Post subject: Hi guys, the compile option
Reply with quote

you mentioned compile option above is for the calling program or the called program? I guess it is for the calling program. Do we need to specify the compile option for the called program? And where we specify the library which hold the dynamically called modules?
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Wed Oct 18, 2006 11:15 am    Post subject: Re: Regarding static and dynamic call.
Reply with quote

Hi,

Your guess is correct. In Calling program we need to mention compiler option, no need in Called program.

Quote:

And where we specify the library which hold the dynamically called modules?

Can you explain clearly.
Back to top
View user's profile Send private message
zaq2wsx

New User


Joined: 16 Oct 2006
Posts: 3

PostPosted: Wed Oct 18, 2006 3:39 pm    Post subject: hi
Reply with quote

So when ever the subroutines X or Y or Z are invoked in the program A, the library which is specified will be searched for the load modules. By mistake, if the library of the subroutine does not contain the referred program, the system standard library will be searched. If the program is not found in standard library too, the programs will abend. This can be done by specifying the compiler option "DYNAM" while compiling the program.

For example, I want load module of subprogram X in library ABC.LOAD, how to do that? And if the load module X is in library ABC.LOAD, where to specify the library when run program A? In the JCL of program A? how to specify? Are there examples? Thanks in advance!
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Oct 18, 2006 4:31 pm    Post subject:
Reply with quote

Hi zaq2wsx,

U can specify ur load library in compiled jcl of sub pgm X like
//LKED.SYSLIB DD DSN=MVS.COB2LIB,DISP=SHR
// DD DSN=ABC.LOAD,DISP=SHR
// DD DSN=SUBLIB,DISP=SHR
// DD DSN=IMS2.SUBLIB,DISP=SHR
// DD DSN=X1.TELON.LOAD,DISP=SHR
// DD DSN=SYS1.DSNDB2S.SDSNLOAD,DISP=SHR

& In main program compiled jcl u can specify load lib of X in

//LKED.SYSLMOD DD DSN=ABC.LOAD,DISP=SHR


Correction r welcome
Back to top
View user's profile Send private message
zaq2wsx

New User


Joined: 16 Oct 2006
Posts: 3

PostPosted: Thu Oct 19, 2006 7:57 am    Post subject:
Reply with quote

Thank you very much!
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 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
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us