Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Explain call by reference and Call by Content

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Explain call by reference and Call by Content
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    Post subject:
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    Post subject:
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    Post subject: Re: call by reference
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    Post subject: call refernece
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    Post subject:
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    Post subject: call reference
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    Post subject: i'm sure
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    Post subject:
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    Post subject: Reply to: Explain call by reference and Call by Content
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: 1439
Location: Bangalore,India

PostPosted: Tue Nov 13, 2007 12:45 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts Need help in triggering a PL1 module ... Varungv99 IMS DB/DC 0 Fri Apr 07, 2017 10:01 am
No new posts Cobol EZASOKET call to SETSOCKOPT fails Andi1982 COBOL Programming 6 Thu Oct 06, 2016 7:12 pm
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us