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
 

 

Change values of variables

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

New User


Joined: 28 Feb 2006
Posts: 3
Location: Hyderabad

PostPosted: Tue Feb 28, 2006 11:45 am    Post subject: Change values of variables
Reply with quote

Hi,

There are two variable say A and B with values 5 and 6 respectively. I want to swap these two values without using temporary variable in cobol.

Please post the reply
Back to top
View user's profile Send private message

nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Tue Feb 28, 2006 11:49 am    Post subject:
Reply with quote

Hi,
U can do like
A=A*B
B=A/B
A=A/B

AND ONE MORE WAY IS
A=A+B
B=A-B
A=A-B
Back to top
View user's profile Send private message
suji

New User


Joined: 28 Feb 2006
Posts: 3
Location: Hyderabad

PostPosted: Tue Feb 28, 2006 11:55 am    Post subject: Re: Change values of variables
Reply with quote

Thanks a lot Nuthan
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 Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am


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