View previous topic :: View next topic
|
Author |
Message |
jzhardy
Active User
Joined: 31 Oct 2006 Posts: 131 Location: brisbane
|
|
|
|
I have a requirment to map a data element to SPACES if it is 0, else show two decimal places of precision.
eg,
0 => SPACES
1.5 => 1.50
.15 => 0.15
so with WS-temp as PIC Z(6)9.99, WS-out as PIC X(10) I could do something like:
init ws-out to SPACES
if ws-myVar > 0
move ws-myVar to ws-temp
move ws-temp to ws-out
end-if
is there a better / more elegant way of doing this ? |
|
Back to top |
|
|
John Del
New User
Joined: 27 Apr 2012 Posts: 42 Location: NY
|
|
|
|
Editing clause BLANK WHEN ZERO |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
I don't see anything bad with what you are doing. You could do redefine instead of move if you think better |
|
Back to top |
|
|
|