double code

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
times29
Premium Member
Premium Member
Posts: 202
Joined: Mon Sep 22, 2008 3:47 pm

double code

Post by times29 »

Hi,
I have record coming as below in txt file
"123", "T120 20" TFT Monitors" ,"KBC"
"234"," My name is sam","ABC"

i want to double code to be doubles something like below See double quote after "20":

"123", "T120 20"" TFT Monitors" ,"KBC"
"234"," My name is sam","ABC"

Thanks,
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The data cannot be read correctly as columns in DataStage as it isn't well-formed.

If you specify the string columns are not having quotes your one column will be read as

Code: Select all

"T120 20" TFT Monitors"
You can then strip the leading double-quote and trailing double-quote from the string.

If you were to write this string to a sequential file and specify that the columns are to be quoted, the output would change the internal occurrences of double-quotes to double them as you specified. Another option is to use the pxereplace function (search DSXChange for posts to this user-written function) to do make '"' into '""' in your string.
Post Reply