hi all,
This is my requirement.
FieldA PIC S999V99 COMP-3.
FieldB PIC 999.99.
FieldC PIC 999.99.
I need integer part of FieldA in FieldB, decimal part of FieldA in FieldC.
The value in FieldA may or may not have decimal values in it.
ex: A = 234.45 then B=234.00 and C = 045.00
this is what i tried...
05 FIELDA PIC S999V99 COPM-3.
05 FIELDB PIC 9(5).
05 FILLER REDEFINES FIELDB.
10 FIELDP PIC 999.
10 FIELDQ PIC 99.
05 FIELDC PIC 999.99
05 FIELDD PIC 999.99
this is what i got...
MOVE 123.45 TO FIELDA
DISPLAY FIELDA ---- 12345
MOVE FIELDA TO FIELDB
DISPLAY FIELDB --- 00123
DISPLAY FIELDP --- 001
DISPLAY FIELDQ --- 23
MOVE FIELDP TO FIELDC
DISPLAY FIELDC --- 001.00
MOVE FIELDQ TO FIELDD
DISPLAY FIELDD --- 023.00
MOVE 123 TO FIELDA
DISPLAY FIELDA ----12300
MOVE FIELDA TO FIELDB
DISPLAY FIELDB ---- 00123
DISPLAY FIELDP ---- 001
DISPLAY FIELDQ ---- 23
MOVE FIELDP TO FIELDC
DISPLAY FIELDC ---- 001.00
MOVE FIELDQ TO FIELDD
DISPLAY FIELDD ---- 023.00
also i tried below code...
05 FIELDA PIC S999V99 COPM-3.
05 FIELDB PIC 9(3)v99.
05 FILLER REDEFINES FIELDB.
10 FIELDP PIC 999.
10 FIELDQ PIC V99.
05 FIELDC PIC 999.99
05 FIELDD PIC 999.99
this is what i got...
MOVE 123.45 TO FIELDA
DISPLAY FIELDA ---- 12345
MOVE FIELDA TO FIELDB
DISPLAY FIELDB --- 12345
DISPLAY FIELDP --- 123
DISPLAY FIELDQ --- 45
MOVE FIELDP TO FIELDC
DISPLAY FIELDC --- 123.00
MOVE FIELDQ TO FIELDD
DISPLAY FIELDD --- 000.45
FIELDC is 123.00 is correct
FIELDD shud be 045.00
kindly help.