Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Tue Aug 24, 2010 10:41 am Post subject:
batu544,
There are ways to do it in cobol but it depends on how you want interpret the data.
Remember that comp-3 fields doesn't have an exclusive decimal point. So using numval function you can convert 10.89 to PD format it will be like this
Code:
0001009
000008C
Now if you read that into a field defined as S9(8)V9(5) COMP-3 you will read it as 00000000.01089 which is wrong. You need to adjust the number of decimals before you convert it into PD.
You can parse and then convert it into PD format using Sort utility using the following control cards.
This will create a 127 byte output file. However there is a chance that you might truncate the values . for example if you have a 15 digit value without any decimal , then you would truncate the left most digits.
well.. sorry guys.. its really a late reply.. but just want to say thanks.. I used function NUMVAL to resolve this issue.. and everything working fine...
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum