Thank's for the suggestion, this would work but please let me know how do i achieve this as the position of '.' is variable, how do i search my third column of the below Input file and then overlay '.00' if '.' is not present at the end.
I'm looking at a manual. Searching for "Middle=Quincy" gets you to an example which might help. Application Guide "book" for DFSORT, following link from STICKY at top of forum.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Rajat,
The problem you actually have with your field is that it can contain two different types of data. One type is a numeric type, an integer with no decimal places. The other is an alphanumeric representation of a number with two decimal places. Although this can obviously happen on files, and has many millions of times, to my mind there should be something external to this actual piece of data which tells you which is which. Otherwise, you have a self-referential validation/use of the data, which is asking for trouble.
The easiest way for you to get around this is to get your input file changed (corrected) by whoever produced it. However, the very existence of the file like this shows that whoever produced it is either: lazy; lacks technical skills; has no pride in their own work/system. Or some combination thereof.
If the file is external to your group, there should have been some "sign-off" of the format of the data. So, maybe you have already accepted that it is like that. But, worth a try at getting it changed. Might depend on whose manager has the most clout.
I am sure that on Monday you will get solutions for the existing data. It will be worth understanding those solutions in their own right. I'd try first, though, for your actual solution, to get the data changed so that it is consistent.
Also, is there no possibility of any negative values on your file? Possible. Just wondering.
Thank You Bill, Yes it should be FIXLEN=09, i corrected it.
Quote:
Also, is there no possibility of any negative values on your file?
Nope, the data will not have negative values.
And the CSV file is produced from the process which runs in a UNIX system , i have notified them, but not sure if they can do something
on formating the data in CSV file.