Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
COBOL-Call by value & call by reference

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Thu Sep 08, 2005 3:08 pm    Post subject: COBOL-Call by value & call by reference
Reply with quote

Whether is it possible for me to implement the concept of Call by value and call by reference in COBOL? If yes, explain with an example.
Back to top
View user's profile Send private message

nitin_agr

New User


Joined: 06 Sep 2005
Posts: 28
Location: Minneapolis US

PostPosted: Fri Sep 09, 2005 12:00 am    Post subject:
Reply with quote

Yes, This is possible in COBOL.
Refer to following....


CALL PGM1 USING parm1

This parm1 can be passed either by value or by reference (address) as follows:

CALL PGM1 USING BY REFERENCE parm1

CALL PGM1 USING BY CONTENT parm1

CALL PGM1 USING BY VALUE parm1

Guys, Do correct if I am wrong at any point...

Nitin
Back to top
View user's profile Send private message
wattamwar rakeshkumar

New User


Joined: 22 Nov 2007
Posts: 2
Location: pune

PostPosted: Thu Nov 22, 2007 5:05 pm    Post subject:
Reply with quote

CALL PGM1 USING BY VALUE parm1

I am doubtfull for this statment.

Even if the meaning off call by value & content is same
call by value is used in c language.

Wheather u have used it(above statement) practically,

Thanx & regards
Rakesh
Back to top
View user's profile Send private message
ramesh_ibm

New User


Joined: 17 Nov 2007
Posts: 16
Location: banglore

PostPosted: Thu Nov 22, 2007 8:05 pm    Post subject: Reply to: COBOL-Call by value & call by reference
Reply with quote

Call By Reference is Default means the sub program changes are shared by the main program

Code:

MOVE '10' TO VAR-1
CALL SUB-PGM-A USING VAR-1
IN SUB-PGM-A MOVE '20' TO VAR-1
COME OUT OF THE SUB-PGM
DISPLAY VAR-1 IN MAIN PROGRAM
VAR-1 = '20'


Call By Content or Value means the sub program changes are local to the sub program only

The same code above displays VAR-1 = '10' if you
code CALL SUB-PGM-A BY CONTENT USING VAR-1
Back to top
View user's profile Send private message
wattamwar rakeshkumar

New User


Joined: 22 Nov 2007
Posts: 2
Location: pune

PostPosted: Fri Nov 23, 2007 10:13 am    Post subject: Re: Reply to: COBOL-Call by value & call by reference
Reply with quote

my q is can we code in mainframe Rejion

CALL SUB-PGM-A BY VALUE USING VAR-1

can we use VALUE VERB IN COBOL

IS IT CORRECT AS PER ANSI STANDERD?



THANKS
RAKESH
Back to top
View user's profile Send private message
kovur

New User


Joined: 15 Nov 2007
Posts: 37
Location: India

PostPosted: Fri Nov 23, 2007 10:35 am    Post subject: Reply to: COBOL-Call by value & call by reference
Reply with quote

Hi,
Refer to the following post.
http://ibmmainframes.com/about5939.html
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us