I have CSV data coming from an external system which mainly puts quotes for those data which has comma(,) within it mainly to mask the commas as separate data columns.
For e.g.
Data has a layout as below
Emp id, Name , address Line 1 , Address Line 2 , Country, Pincode
So quotes occur dynamically based on occurrence of comma as data and not as a delimiter. Can I use any JCL utility to create a data in formatted fashion without quotes?
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
vina2010,
It would have been nice if you showed the desired output. I assumed that lengths for each field. You can change that the real lengths by changing the values in the FIXLEN field in the parse statement. Use the following DFSORT JCL
We get data from an external partner, and they are not very consistent in the way the "pack" the data... Sometimes we get numeric fields wrapped in quotes - other times they are not.
The OUTREC FINDREP is ingenious, as it can get rid of those unwanted quotes! BUT when I ran some tests, it seems you need to be aware of it, because the columns are shifted, and thus the data may not be where you expected, anymore.
How can you cater for that? Using positions in BUILD of the INREC PARSE won't do the trick.