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

Change values of variables


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts SELECT from data change table DB2 5
Search our Forums:

Back to Top