I use unstring delimited by comma command and move the sell cost to SELL-COST. The first record has a value of 14.76. When i unstring into SELL-COST it has '14.76 ' but when i unstring into NEW-COST it has 4.76000
iam amazed to see '.' in a variable defined with pic 9(4)V9(3)
anyways.. my need is to move that 14.76 to NEW-COST and convert it as 0014760
SELL-COST wil have decimal numbers only.. it wont have any alphabets..
what should i do??? if i unstring to SELL-COST and move to NEW-COST then its showing the value '6 0000'
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
CSV files are character files, for decimal fields they may include the decimal character and for negative amounts they may include a negative sign. The position of both the decimal character and the sign may varying depending on the number of significant digits.
The 1st thing you have to do is analyse your IP and determine the various forms the data can take. As Steve said they may contain minus signs: they may even contain commas (I hope not, because that opens a nasty can of worms).
Keep track of each of the formats and note the details. Once you've done that, you s/b ready to code, then show us the results of the analyses.