GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 144 of 150    Print  
COBOL dynamic call and static call
what is difference between dynamic call and static call with examples ..?


  
Total Answers and Comments: 2 Last Update: July 01, 2008     Asked by: raju_68 
  
 Sponsored Links



 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 11, 2008 07:58:19   #1  
shaikmf Member Since: June 2008   Contribution: 2    

RE: COBOL dynamic call and static call
Static Call:
1. in COBOL if you Code a call statement as fooliows is a static call.
CALL 'Pgm1' Using Var1, Var2, ...
2. Compiler option for Static call is NODYNAM
3. Calling Program and Called program loads are available in same loadmoduale.
4. It occupies more Real memory due to all loadmodules are available in real memory.
5. Processing will be Fast due to all programs loads are available in memory.

Dynamic Call:
2. If you write a Call statement by using Call leterals this type of call is called as Dynamic call as follows.
CALL WS-PGM1 Using Var1, Var2,...
2. Compiler Option for Dynamic call is DYNAM.
3. Called program and calling program will be available in separate loads.
4. On Execution Program will occupy less memory due to only active program load will be loaded in the real memory.
5. Processing speed will be slow compare with Static call. because main program calling Subprogram then main program will be replaced with subprogram in the memory and once sub program finishes execution again main program will be loaded so loading and unloading will decrease speed of execution.

 
Is this answer useful? Yes | No
July 01, 2008 07:54:01   #2  
arnab.ece Member Since: May 2008   Contribution: 0    

RE: COBOL dynamic call and static call
here is some information about static and dynamic calls which may help you.

Static CALLs
In COBOL, you normally call a subroutine like this:

CALL 'A' USING arguments

The static form of the CALL statement specifies the name of the subroutine as a literal; e.g., it is in quotes.

This is the static form of a subroutine call. The compiler generates object code for this which will cause the linker to copy the object module a.obj into your executable when it is linked.

So, if you modify "A" and recompile it, you must also relink all of the executables that call "A", because the each of the executables contains its own copy of "A".

Dynamic CALLs
In COBOL, the dynamic form of a subroutine call is coded like this:

01 SUBROUTINE-A PIC X(8) VALUE 'A'.
CALL SUBROUTINE-A USING arguments


The dynamic form of the CALL statement specifies the name of the subroutine using a variable; the variable contains the name of the subroutine to be invoked.

The difference is that the name of the subroutine is found in the variable SUBROUTINE-A. The compiled code will cause the operating system to load the subroutine when it is required instead of incorporating it into the executable..

some compilers let you set options that will override the calling mechanisms shown above. Therefore, even if your program is coded to call a program statically, the compiler can convert it to the dynamic form of CALL if you set (or don't set) the correct compiler options(i.e thru DYNAM option in jcl)

 
Is this answer useful? Yes | No

 Related Questions

There are at least five differences: COBOL II supports structured programming by using in line PERFORMs and explicit scope terminators, it introduces new features (EVALUATE, SET .. TO TRUE, CALL .. BY 
Latest Answer : The END Delimiter --> END-READ                               END-PERFORM                              ...

A scope terminator brackets its preceding verb, eg. IF .. END-IF, so that all statements between the verb and its scope terminator are grouped together. Other common COBOL II verbs are READ, PERFORM, EVALUATE, 
Latest Answer : terminators like END-PEROFRM END-EVALUTE are called explicit scope terminaotr available in COBOL 85. ...

The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line PERFORMs work as long as there are no internal 
Latest Answer : In-line perform is a concept where the control will execute a block of statements residing in a same paragraph and here the control will not shift form one paragraph to another paragraph. ...

NEXT SENTENCE gives control to the verb following the next period. CONTINUE gives control to the next verb after the explicit scope terminator. (This is not one of COBOL II's finer implementations). 
Latest Answer : According to this code If "Next sentence" is given the control wil go to the statement after   "ADD +1 TO INPUT-COUNT"(control will go to verb following the next period).If "continue "is given control will go to  ...

EVALUATE can be used in place of the nested IF THEN ELSE statements.  
Latest Answer : EVALUATE statement contrusts a case structure. The explicit scope terminator for EVALUATE is END-EVALUATE. The various cases can be places between the EVALUATE and END-EVALUATE statements. Example:Here SQLCODE is a built in variable name EVALUATE SQLCODE ...

Partial list: REMARKS, NOMINAL KEY, PAGE-COUNTER, CURRENT-DAY, TIME-OF-DAY, STATE, FLOW, COUNT, EXAMINE, EXHIBIT, READY TRACE and RESET TRACE.  

The parameters passed in a call by context are protected from modification by the called program. In a normal call they are able to be modified.  
Latest Answer : In call by content a copy of variable is passed to the sub program. In case of call by address the address is passed. ...

Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc?
An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntaxes: 1.) USING, GIVING sorts are 

Comp is a binary usage, while comp-3 indicates packed decimal. The other common usages are binary and display. Display is the default. 3/28/00 Dave Herrmann: 'I was reading your FAQ on Cobol, as 
Latest Answer : COMP Comp is used for Binary Representation it allows only S and 9 ... s9(01) to s9(04) it takes 2 bytes memory s9(05) to s9(09) it takes 4 bytes memory s9(10) to s9(18) it takes 8 bytes memory COMP-3 :- Comp-3 is used for Packed Decimal values it ...

In a COBOL II perform statement, when is the conditional tested, before or after the perform execution?
In COBOL II the optional clause WITH TEST BEFORE or WITH TEST AFTER can be added to all perform statements. By default the test is performed before the perform.  


 Sponsored Links



 
Related Articles

C++ Static Functions

C Static Functions Static member functions have a class scope and they do not have access to the this pointer of the class When a member is declared as static a static member of class it has only one data for the entire class even though there are many objects created for the class The main usage of
 

How does the function call within function get evaluated?

Whenever we have more than one function which is called for a finite number of times then such a function gets evaluated from inside out. Let us understand this concept with an example. For instance consider a function sample called within it 4 times as given in program below: main() { int a=50;
 

How to call C header that is not provided generally by system in C++?

Headers can be called by using extern C Syntax of extern C is: extern "C" <function declaration> for example to call C functions from C++ we can write extern "C" { <function declaration> <function declaration> ...
 

What is difference between call by value and call by reference in function?

The arguments passed to function can be of two types 1. Values passed 2. Address passed The first type refers to call by value and the second type refers to call by reference. For instance consider program1 main() { int x=50, y=70; interchange(x,y); printf(“x=%d y=%d”,x,
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

Mainframe Features

Mainframe Features In this Mainframe tutorial you will learn about features of Mainframe Processing power memory capacity performance computing multiple operating system time sharing reliability serviceability availability clustering technology and other features available in Mainframe mosgoogle cen
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

Static Functions - An Introduction

Static Functions An Introduction The static member functions have a class scope and they do not have access to the this pointer of the class When a member is declared as static that is a static member of class have only one such data for the entire class even though there are many objects created fo
 

HR Interview - HR Interview Mistakes You Will Want To Avoid

HR Interview Mistakes You Will Want To Avoid The job interview can be a stressful process This is especially true for those who are going after a competitive position Your nonverbal communication combined with the answers you give during the interview will determine if you are hired mosgoogle While
 

Sponsored Links

 
Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape