View previous topic :: View next topic
|
Author |
Message |
mf_karthik
New User
Joined: 26 Jul 2005 Posts: 55
|
|
|
|
hi
can anybody explain call by reference, call bycontent with small examples.i already searched the forum |
|
Back to top |
|
|
jon_s_rice
Active User
Joined: 24 Mar 2005 Posts: 102 Location: Douglasville, GA USA
|
|
|
|
Call by reference passes the field to the called program. Any changes to the fields is chaned in the calling program. Call by content passes a copy of the fields to the called program. Any changes will not affect the fields in the calling program. |
|
Back to top |
|
|
dsbhati
New User
Joined: 13 Jun 2005 Posts: 10 Location: india
|
|
|
|
hi all,
which one is default in cobol????
thanks guys.. |
|
Back to top |
|
|
ec10058
New User
Joined: 22 Jun 2005 Posts: 1 Location: pune
|
|
|
|
Hi Karthik,
The default in COBOL is Call By Reference.
It refers to the address of the value (sent by the calling program) & any change made here will be reflected in the calling program.
Where as Call by Value or Content will make a local copy of the data sent (by calling prg).
(Correct me if I am wrong)
Regards,
Vishwa |
|
Back to top |
|
|
sanya9
New User
Joined: 05 Sep 2005 Posts: 13
|
|
|
|
Hi,
karthiak,
Call ref is deafult in cobol.suppose u doing some changes in sub-program.that will affect in ur mainframe
call by content is when u're doing changes in sub-program.it vll apllicable for only sub-program not to mainframe.
urs..
friend
if any mistakes ..pls be correct |
|
Back to top |
|
|
sanya9
New User
Joined: 05 Sep 2005 Posts: 13
|
|
|
|
Hi,
karthiak,
Call ref is deafult in cobol.suppose u doing some changes in sub-program.that will affect in ur mainframe
call by content is when u're doing changes in sub-program.it vll apllicable for only sub-program not to mainprogram.
sorry for mistake mainframe..mainprogram
urs...
friend
if any mistakes ..pls be correct
Back to top
View user's profile Send private message |
|
Back to top |
|
|
sanya9
New User
Joined: 05 Sep 2005 Posts: 13
|
|
|
|
Hi,
karthiak,
Call ref is deafult in cobol.suppose u doing some changes in sub-program.that will affect in ur mainframe
call by content is when u're doing changes in sub-program.it vll apllicable for only sub-program not to mainprogram.
sorry for mistake mainframe..mainprogram
urs...
friend
if any mistakes ..pls be correct
Back to top
View user's profile Send private message |
|
Back to top |
|
|
yogeswariumapathy
New User
Joined: 14 Sep 2005 Posts: 4
|
|
|
|
hi
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 refrence 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 |
|
Back to top |
|
|
Sridevi_C
Active User
Joined: 22 Sep 2005 Posts: 104 Location: Concord, New Hampshire, USA.
|
|
|
|
Hi Yogeswariumapathy,
A small correction.....it's not called "dummy parameters". (Ofcourse, there's such a term in PL/I).In COBOL,they are called as "formal parameters".
Regards,
Sridevi. |
|
Back to top |
|
|
inamadugu Warnings : 1 New User
Joined: 23 Aug 2007 Posts: 18 Location: Delhi
|
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
inamadugu,
Thanks for the link.
You are replying to 2005 post, not sure TS still require/follow this. |
|
Back to top |
|
|
|