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

Call By Value & Call by Reference


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

New User


Joined: 02 Mar 2005
Posts: 11
Location: USA

PostPosted: Wed Mar 02, 2005 5:36 pm
Reply with quote

Hi,
can any one explain how u know in a program whether we used call by value or call by reference.pl. explain with example.
Back to top
View user's profile Send private message
varun

New User


Joined: 02 Mar 2005
Posts: 11
Location: USA

PostPosted: Wed Mar 02, 2005 7:48 pm
Reply with quote

Hi senthil,
Thanks for the reply.
can we use both call by value and call by reference in a single call.
if we do not mention any call by reference or value does it take default call by reference or call by value.
Back to top
View user's profile Send private message
ashok_bln
Warnings : 1

New User


Joined: 19 Feb 2005
Posts: 5
Location: bangalore

PostPosted: Wed Mar 02, 2005 10:26 pm
Reply with quote

yes i think we can use both call by content and call by reference in single program.

the default is call by reference

regards
ashok
Back to top
View user's profile Send private message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Wed Mar 02, 2005 10:56 pm
Reply with quote

Dear Friends,

You can use CALL BY VALUE and CALL BY CONTENT in a single Call statement.

Default is CALL BY REFERENCE, So if you miss anything, it's treated as CALL BY REFERENCE.

Ex: CALL A USING B, C BY CONTENT, D BY REFERENCE.
Back to top
View user's profile Send private message
varun

New User


Joined: 02 Mar 2005
Posts: 11
Location: USA

PostPosted: Wed Mar 02, 2005 11:44 pm
Reply with quote

Hi,
Thanks for helping
Back to top
View user's profile Send private message
DeepaBala

New User


Joined: 20 Feb 2007
Posts: 13
Location: Trivandrum

PostPosted: Thu Feb 22, 2007 10:35 am
Reply with quote

what is the difference in that two type of calling ?
plz any one clear for me
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Feb 22, 2007 10:43 am
Reply with quote

Hi There,
Please refer this

publib.boulder.ibm.com/infocenter/pdthelp/v1r1/index.jsp?topic=/com.ibm.entcobol4.doc/tpshr03.htm

Hope it will helpful
Back to top
View user's profile Send private message
DeepaBala

New User


Joined: 20 Feb 2007
Posts: 13
Location: Trivandrum

PostPosted: Thu Feb 22, 2007 10:54 am
Reply with quote

Thank u
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Thu Feb 22, 2007 11:59 am
Reply with quote

Deepbala,

Quote:
how to rectify file status 39



I this ur signature???????... I thought it was a question that u asked and had replied in my prev post.

Funny Signature ya..

Thamilzan.
Back to top
View user's profile Send private message
sachin_star3
Warnings : 1

New User


Joined: 30 Sep 2006
Posts: 78
Location: pune

PostPosted: Fri Feb 23, 2007 11:36 am
Reply with quote

answer
call by reference and call by value are types of static call
if you look in calling programme then
1] for call by reference : in procedure division there is mntion verb USING REFERENCE OR not mention because it is in default

2] for call by content (value ): in procedure division there compulsory mention the verb USING CONTENT
I GIVEN YOU EXAMPLES
EXAMPLE1.CALL BY CONTENT
ID DIVISION
PROGRAM-ID. XXX.
WORKING-STORAGE SECTION.
LINKAGE SECION.
77 A PIC 9(2).
77 B PIC 9(4).
77 C PIC 9(6).
PROCEDURE DIVISION USING CONTENT OF A, B, C.
COMPUTE C = A + B
DISPLAY C

EXAMPLE2.CALL BY REFERENCE
ID DIVISION
PROGRAM-ID. XXX.
WORKING-STORAGE SECTION.
LINKAGE SECION.
77 A PIC 9(2).
77 B PIC 9(4).
77 C PIC 9(6).
PROCEDURE DIVISION USING REFERENCE OF A, B, C.
COMPUTE C = A + B
DISPLAY C
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 Batch call online program, EXCI task ... CICS 3
No new posts CSQBGET - Call giving completion code... COBOL Programming 3
No new posts Reference for COND parameter. JCL & VSAM 1
Search our Forums:

Back to Top