View previous topic :: View next topic
|
Author |
Message |
ys_more
New User
Joined: 21 Jun 2005 Posts: 5
|
|
|
|
Hi , I want to convert a negative value into positive value . Is there any intrinsic function available. do we have -- as valid operator in cobol |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
ys_more,
Not that I know of, and the coding to do it in cobol is pretty complex.
Code: |
IF VE < 0
THEN
MULTIPLY VE BY -1
END-IF. |
|
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
I assume your field is part of a file rec that you're reading into your pgm.
I haven't done this in a while, but you can define the field as unsigned, then move it to itself. That strips the sign.
Code: |
01 rec1.
.
.
.
05 var1 pic 9(004).
.
.
move var1 to var1 |
|
|
Back to top |
|
|
|