Data Handling on DS 9.1 on RHEL 6.2

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
cbs_bas_ccit
Premium Member
Premium Member
Posts: 2
Joined: Thu Apr 10, 2014 1:32 am
Location: india

Data Handling on DS 9.1 on RHEL 6.2

Post by cbs_bas_ccit »

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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Exactly exactly. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
cbs_bas_ccit
Premium Member
Premium Member
Posts: 2
Joined: Thu Apr 10, 2014 1:32 am
Location: india

Post by cbs_bas_ccit »

Thanks everyone... we have managed to fix it in server jobs.. but while migrating server to PX this is still a issue? Any suggestions on PX?
hAVE a gOOD dAY!! :)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use a server Sequential File stage in a server Shared Container in a parallel job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply