In the recent days, we have hit an issue related to the user including double-quotes in the data causing us issues. Data was shared by user as below:
Val: "Test, 123"
When the Datastage extracts the data from a table to a CSV file, the value gets converted as:
Val: ""Test, 123"" [Includes another double-quote as the data is extracted from a Text Column]
I can handle the above scenario by introducing a temporary change change using Oracle Replace command, which produces output as below:
Val: "Test, 123" [Stripping the double-quote shared by user]
We are looking for a permanent fix on the same and have got 2 questions:
1. Can DS handle control chars automatically ?
2. Can DS change the delim from ; to a non-printable character, as an example
Can you let us know your views.
Data Handling on DS 9.1 on RHEL 6.2
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 2
- Joined: Thu Apr 10, 2014 1:32 am
- Location: india
When reading from a sequential file source or writing to a sequential file, you have the option to specify whether strings are quoted. It would seem that you have this turned on but don't have quoted strings, so the solution would be to modify your sequential file stage where you are reading from the .csv file to tell it that strings are indeed quoted, and DataStage will automatically strip the outer quotes.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
I'm not sure I'm seeing a problem. Does the data in the table actually include the double-quotes as shown? If so, in Oracle's world the proper way to write that out is by adding a double-quote to each one as you are seeing. That's the only way they'll be preserved as part of the data on the way back in.
I'm also curious how your two questions relate to this quoting issue. What 'control characters' are you asking about? And you have full control over the delimiter used from what I recall. You would use the numeric equivalent when declaring it in that case.
I'm also curious how your two questions relate to this quoting issue. What 'control characters' are you asking about? And you have full control over the delimiter used from what I recall. You would use the numeric equivalent when declaring it in that case.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
How many times can I say double quotes in a sentence? It is normal to have double double quotes when data values already contain double quotes or are already surrounded by double quotes and you want to double quote the values. Go into Excel and enter some test data with double quotes, save it as a CSV file, then open the file using any text editor. It behaves in the same way.
Choose a job you love, and you will never have to work a day in your life. - Confucius
-
- Premium Member
- Posts: 2
- Joined: Thu Apr 10, 2014 1:32 am
- Location: india
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: