Hi,
I am getting problems while converting PIC S9(9)V99 into Decimal (11,2).
I used DatatypePic S9 Transform but i am getting problems with decimal position.For example
For col1 value is 715.00 in source but i am getting 71500.00
Could you please help me on handling PIC S9(9)V99 fields into Decimal (11,2).
I appreciate your help.
Reddy
PIC S9(9)V99 to Decimal (11,2) Convertion problem
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
DataTypePicS9 handles zoned right signed decimal numbers but ignores the scale. The easiest approach is to divide the result by 100.
Code: Select all
DataTypePicS9(InLink.TheColumn) / 100
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi All
I wrote a routine called SwitchEBCDICSign to deal with EDBC Sign.
I'm trying to use DataTypePicS9 instead but the result is not exact.
With my routine i have
0000000014052.0L from the CFF ---> -14052,03 (Good Value)
With DataTypePicS9 i have
0000000014052.0L from the CFF ---> -1405,23 (because i have to divide by 100).
Can you help me ?
I wrote a routine called SwitchEBCDICSign to deal with EDBC Sign.
I'm trying to use DataTypePicS9 instead but the result is not exact.
With my routine i have
0000000014052.0L from the CFF ---> -14052,03 (Good Value)
With DataTypePicS9 i have
0000000014052.0L from the CFF ---> -1405,23 (because i have to divide by 100).
Can you help me ?
Hope This Helps
Regards
Regards
DataTypePicS9() expects values without a decimal as far as i remember. Havent used it for quite some time now. Try
That should take care of it.
Code: Select all
DataTypePicS9(EREPLACE(in.Col, ".", ""))/100
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Hi
I just want to warn the DataTypePicS9 users.
The syntax of DSguru2b is correct but you have to pay attention of the input format.
For example:
DataTypePicS9(EREPLACE('715.0{', ".", ""))/100 give you -715.00 and it's right
but DataTypePicS9(EREPLACE('71.5{', ".", ""))/100 give you -7.15 and it's not.
I just want to warn the DataTypePicS9 users.
The syntax of DSguru2b is correct but you have to pay attention of the input format.
For example:
DataTypePicS9(EREPLACE('715.0{', ".", ""))/100 give you -715.00 and it's right
but DataTypePicS9(EREPLACE('71.5{', ".", ""))/100 give you -7.15 and it's not.
Hope This Helps
Regards
Regards