View previous topic :: View next topic
|
Author |
Message |
sthirumalai
New User
Joined: 14 Aug 2007 Posts: 14 Location: Chennai
|
|
|
|
Hi
I have a field which is 9(8) COMP staring from the position 24 in a flat file.
I want to convert that into a packed decimal value S9(15)V9(03) COMP-3 and write the value staring from 73 rd position in my output file.
I used the following statemeny in my sortcard
73:24,4,BI,TO=PD,LENGTH=10,
But the values converted are incorrect.
For eg:
If the 9(8) COMP value is 400 then i received 0.400 in my output file after conversion. But the result must be 400.000 in my output.
Can any one help me to fix this issue?
Thanks & Regards
Santhosh |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
i received 0.400 in my output file after conversion. |
you lie, you lie, you lie!!!
BI,TO=PD will not generate a decimal point '.' in the output.
probably help if you were to provide:- example input with bbcode tags
- expected output with bbcode tags
- allllllllll the control cards you are currently using.
then someone can provide better guidance. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
sthirumalai,
comp fields does not have decimals. so if your intention is to take an absolute value and pad with 3 decimals then you need to multiply it with 1000 and convert it to pd format. Also use FI instead of BI so that you can account for negative numbers also.
Use the following control cards
Code: |
73:24,4,FI,MUL,+1000,PD,LENGTH=10, |
|
|
Back to top |
|
|
|