GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 104 of 162    Print  
what is the difference between the 'call by value' and 'call by reference'?

  
Total Answers and Comments: 3 Last Update: April 09, 2009     Asked by: shivanag 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
April 24, 2007 07:06:05   #1  
shob        

RE: what is the difference between the 'call by value'...
Call by reference :
- address of the parameters will be passed to the sub-program. Changes to the parameter in the called program affect the corresponding argument in the calling program.

Default is call by reference

Call by value:

-only the copy of the contents will be passed to the sub-program.The called program cannot change the value of this parameter as referenced in the CALL statement's USING phrase.


 
Is this answer useful? Yes | No
December 09, 2008 01:10:52   #2  
mahantesh.bh Member Since: December 2008   Contribution: 1    

RE: what is the difference between the 'call by value' and 'call by reference'?

Call by value:

This is default in cobol no need to specify the call by value. The changes to the variable in the called program in reflected back in the calling program.

Call by content:

This should be specified along with call and here the content of the variable is passed to the called program but the changes in the called programwill not be relected in the calling program.


 
Is this answer useful? Yes | No
April 09, 2009 06:17:20   #3  
pravichopade Member Since: September 2006   Contribution: 2    

RE: what is the difference between the 'call by value' and 'call by reference'?
Call by reference is default call in Cobol.

Call by Value:
In call by value both the actual and dummy parameters will occupy different memory space.
so the changes made in the subprog will not affect(/modify) the actual parameters in the main prog.

Call by ref:
In call by reference both the actual and dummy parameters will occupy the same memory location.
so the changes made in the subprog will modify the actual parameters in the main program.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape