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

How to convert a numeric edited variable's sign.


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

New User


Joined: 12 Sep 2007
Posts: 21
Location: chennai

PostPosted: Mon Jan 28, 2008 1:05 pm
Reply with quote

Can we convert sign of a numeric edited variable in cobol using a simple way.

Ex : if a data field whose declaration is -------------9.999 and value is -456.347 how can i convert this value to 456.347 in a simple way preferably using a command.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jan 28, 2008 2:37 pm
Reply with quote

numeric-signed-variable * -1 = numeric-signed-variable with opposite sign.
Back to top
View user's profile Send private message
rag swain

New User


Joined: 17 Dec 2007
Posts: 33
Location: pune,INDIA

PostPosted: Mon Jan 28, 2008 4:39 pm
Reply with quote

Go for a sign test in an IF statement and if it is negative MULTIPLY -1 TO that variable to get your desired ouput.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
Search our Forums:

Back to Top