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
 

 

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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


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