what is static or dynamic call in cobol
Moderators: dbzTHEdinosauer, Moderator Group
-
- Active Member
- Posts: 59
- Joined: Tue Jul 24, 2007 7:25 pm
what is static or dynamic call in cobol
what is static or dynamic call in cobol .please give me a live example
Mainframe5,
Static CALLS
*****************
CALL 'PGMNAME' USING arguments
NOTE : The called subroutine is a literal, it is called in quotes.
Dynamic CALLs
*******************
01 WS-SUBPGM PIC X(8) VALUE 'PGMNAME1'.
CALL WS-SUBPGM USING arguments
NOTE : There are lot of advantages and disadvantages of STATIC VS DYNAMIC calls.
It depends on the scenarios what we are dealing in specific.
Example:
**********
Say we have a program A which is calling a sub routine B.
Lets assume the call is STATIC , When an executable is build for PGM A
the object module of the called sub routine B also needs to be part of the
executable A. PGM A executable should be self sufficient in itself, meaning
it should have all the other called sub routines object modules clubbed with the
object module of the main pgm A ..such that the executable can run.
Lets assume the call is DYNAMIC for the same scenario as above,
When the main program A calls the subroutine B the object module of the
B will be loaded dynamically by the linker when PGM A is in execution
and a call is made to B.
Meaning the executable A is not fully self sufficient in itself for execution of the
application, it is depended on the LINKER to connect to other DLL's or object modules of called pgms.
NOTE ; Now which is the better way STATIC OR DYNAMIC ??
Preferably in COBOL it is a good idea to use DYNAMIC calls instead of STATIC calls.
The reason is when you use DYNAMIC calls and say there are some changes to the
sub-routine B ( same scenario as above) it is enough if we re-compile just the
sub-routine B, and we do not need to recompile program A or any other programs which
calls sub-routine B.
If it is a STATIC call then we need to have the entire listing of PGMS
which calls the sub-routine B and re-compile all the pgms.
But if you speak in terms of the Application Programming in other languages again its different
Things which needs to be given a thought
1) Assume you are developing a S/W for some feature in other language say VB OR JAVA
the product is shipped in the market in the form of an EXE(executable file).
Now lets think which is better an STATIC / DYNAMIC call with in the application ???
IF it is a static call u can ship ur product as one EXE
If it is a dynamic all u need to ship ur product as set of DLL's. ( for each called sub-routine)
There will be cost implications and user friendly issues ......
We can go on ...on the current TOPIC STATIC VS DYNAMIC , but the GOLDEN RULE is the decision can be
made considering the bigger picture in mind and the exact scenario we are dealing with.
As Info :
TO have more understanding you can goggle it , you can find N no of useful links with N examples.
Hope this little information helps you...
Thanks,
Veera.
Static CALLS
*****************
CALL 'PGMNAME' USING arguments
NOTE : The called subroutine is a literal, it is called in quotes.
Dynamic CALLs
*******************
01 WS-SUBPGM PIC X(8) VALUE 'PGMNAME1'.
CALL WS-SUBPGM USING arguments
NOTE : There are lot of advantages and disadvantages of STATIC VS DYNAMIC calls.
It depends on the scenarios what we are dealing in specific.
Example:
**********
Say we have a program A which is calling a sub routine B.
Lets assume the call is STATIC , When an executable is build for PGM A
the object module of the called sub routine B also needs to be part of the
executable A. PGM A executable should be self sufficient in itself, meaning
it should have all the other called sub routines object modules clubbed with the
object module of the main pgm A ..such that the executable can run.
Lets assume the call is DYNAMIC for the same scenario as above,
When the main program A calls the subroutine B the object module of the
B will be loaded dynamically by the linker when PGM A is in execution
and a call is made to B.
Meaning the executable A is not fully self sufficient in itself for execution of the
application, it is depended on the LINKER to connect to other DLL's or object modules of called pgms.
NOTE ; Now which is the better way STATIC OR DYNAMIC ??
Preferably in COBOL it is a good idea to use DYNAMIC calls instead of STATIC calls.
The reason is when you use DYNAMIC calls and say there are some changes to the
sub-routine B ( same scenario as above) it is enough if we re-compile just the
sub-routine B, and we do not need to recompile program A or any other programs which
calls sub-routine B.
If it is a STATIC call then we need to have the entire listing of PGMS
which calls the sub-routine B and re-compile all the pgms.
But if you speak in terms of the Application Programming in other languages again its different
Things which needs to be given a thought
1) Assume you are developing a S/W for some feature in other language say VB OR JAVA
the product is shipped in the market in the form of an EXE(executable file).
Now lets think which is better an STATIC / DYNAMIC call with in the application ???
IF it is a static call u can ship ur product as one EXE
If it is a dynamic all u need to ship ur product as set of DLL's. ( for each called sub-routine)
There will be cost implications and user friendly issues ......
We can go on ...on the current TOPIC STATIC VS DYNAMIC , but the GOLDEN RULE is the decision can be
made considering the bigger picture in mind and the exact scenario we are dealing with.
As Info :
TO have more understanding you can goggle it , you can find N no of useful links with N examples.
Hope this little information helps you...
Thanks,
Veera.
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
Veera,
another great post!
Though it is a few years old, this is link to an article by Jim Moore which, technically is up-to-date and discusses a few other aspects of the dynam vs static arguement.
another great post!
Though it is a few years old, this is link to an article by Jim Moore which, technically is up-to-date and discusses a few other aspects of the dynam vs static arguement.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
-
- Member
- Posts: 2
- Joined: Wed Nov 21, 2007 9:01 pm
HI All,
I'm new to this forum and cobol and please let me know where can i find
simple cobol 85 compiler to install on my PC winXP
Please send info to shivaneeraja@gmail.com
bye
I'm new to this forum and cobol and please let me know where can i find
simple cobol 85 compiler to install on my PC winXP
Please send info to shivaneeraja@gmail.com
bye
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page