IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Explain call by reference and Call by Content


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mf_karthik

New User


Joined: 26 Jul 2005
Posts: 55

PostPosted: Wed Sep 28, 2005 5:28 am
Reply with quote

hi
can anybody explain call by reference, call bycontent with small examples.i already searched the forum
Back to top
View user's profile Send private message
jon_s_rice

Active User


Joined: 24 Mar 2005
Posts: 102
Location: Douglasville, GA USA

PostPosted: Wed Sep 28, 2005 6:58 am
Reply with quote

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
View user's profile Send private message
dsbhati

New User


Joined: 13 Jun 2005
Posts: 10
Location: india

PostPosted: Wed Sep 28, 2005 10:20 am
Reply with quote

hi all,

which one is default in cobol????

thanks guys..
Back to top
View user's profile Send private message
ec10058

New User


Joined: 22 Jun 2005
Posts: 1
Location: pune

PostPosted: Wed Sep 28, 2005 11:49 am
Reply with quote

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
View user's profile Send private message
sanya9

New User


Joined: 05 Sep 2005
Posts: 13

PostPosted: Sat Oct 15, 2005 8:24 pm
Reply with quote

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
View user's profile Send private message
sanya9

New User


Joined: 05 Sep 2005
Posts: 13

PostPosted: Sat Oct 15, 2005 8:27 pm
Reply with quote

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
View user's profile Send private message
sanya9

New User


Joined: 05 Sep 2005
Posts: 13

PostPosted: Sat Oct 15, 2005 8:28 pm
Reply with quote

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
View user's profile Send private message
yogeswariumapathy

New User


Joined: 14 Sep 2005
Posts: 4

PostPosted: Sun Oct 16, 2005 8:29 pm
Reply with quote

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
View user's profile Send private message
Sridevi_C

Active User


Joined: 22 Sep 2005
Posts: 104
Location: Concord, New Hampshire, USA.

PostPosted: Sun Oct 16, 2005 11:55 pm
Reply with quote

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
View user's profile Send private message
inamadugu
Warnings : 1

New User


Joined: 23 Aug 2007
Posts: 18
Location: Delhi

PostPosted: Tue Nov 13, 2007 11:32 am
Reply with quote

Hi,
refer to the link.
http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.ibm.etools.iseries.pgmgd.doc/c0925405220.htm
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Nov 13, 2007 12:45 pm
Reply with quote

inamadugu,

Thanks for the link.

You are replying to 2005 post, not sure TS still require/follow this.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Call program, directly from panel CLIST & REXX 9
No new posts DB2 Statistics - Using EXPLAIN and qu... DB2 1
No new posts Reformat and relocate content DFSORT/ICETOOL 4
No new posts Batch call online program, EXCI task ... CICS 3
Search our Forums:

Back to Top