View previous topic :: View next topic
|
Author |
Message |
itzphaniz
New User
Joined: 02 Sep 2005 Posts: 39
|
|
|
|
Hi,
I've two variables VAR1 & VAR2 which are defined as 9(3), S9(1)V9(2) COMP-3 resprectively.
VAR1 has 999 as its value. When i move VAR1 to VAR2, its value is 9.00
Question1: Why is VAR2's value 9.00 instead of 9.99?
Question2: What should i do to make sure that 9.99 gets moved to VAR2?
Any help would be deeply Appreciated
Thanks!
DP |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
itzphaniz wrote: |
Question1: Why is VAR2's value 9.00 instead of 9.99? |
999 is seen as 999.00 and the recieving field causes the truncation of the high digits.
Quote: |
Question2: What should i do to make sure that 9.99 gets moved to VAR2? |
COMPUTE VAR2 = VAR1 / 100
or
VAR1 PIC 9(3).
VAR1A REDEFINES VAR1 PIC 9V99.
VAR2 PIC S9(1)V9(2) COMP-3.
MOVE VAR1A TO VAR2 |
|
Back to top |
|
|
itzphaniz
New User
Joined: 02 Sep 2005 Posts: 39
|
|
|
|
Thanks 'CICS Guy'. You're the best! |
|
Back to top |
|
|
|