How to remove double quotes ( " )

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
suresh.narasimha
Premium Member
Premium Member
Posts: 81
Joined: Mon Nov 21, 2005 4:17 am
Location: Sydney, Australia
Contact:

How to remove double quotes ( " )

Post by suresh.narasimha »

Hi
I have Source Sequential File , in one of the field while processing after 11,000 rows it encounters a double quote and throws an error

read_delimited() - invalid quotes, column STEXT = "Introduction to Enterprise Architecture| |TC |"

I need to remove the double quote in the transformer and pass the data.

i have searched in dsxchange regarding this ... but i could not make out.

any suggestion might be a great help .

Thanks in Advance
SURESH NARASIMHA
kcshankar
Charter Member
Charter Member
Posts: 91
Joined: Mon Jan 10, 2005 2:06 am

Post by kcshankar »

Hi suresh,
If u want to remove double quote in the Transformer and pass the data,use Ereplace function in the Transformer.

Ereplace (string, substring, replacement [ ,number [ ,begin] ] )


Regards
kcs
Bala R
Participant
Posts: 66
Joined: Mon May 30, 2005 9:52 pm

Post by Bala R »

In the sequential file stage you have option to define your quotes. If you have given single quotes change it to double quotes and request whoever that provides you the files to maintain consistent quote character. I suppose the quotes were provided in the file because of the embedded piping symbol in the string.
HTH.
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

kcshankar wrote:Hi suresh,
If u want to remove double quote in the Transformer and pass the data,use Ereplace function in the Transformer.

Ereplace (string, substring, replacement [ ,number [ ,begin] ] )


Regards
kcs
What you can do is read a single line of sequential file as one column
in the transformer use Ereplace as

Code: Select all

Ereplace(DSLinkname.columnname,'"',"")
write this to an intermediate Hashed file, from there write it to the original sequential file.
Success consists of getting up just one more time than you fall.
suresh.narasimha
Premium Member
Premium Member
Posts: 81
Joined: Mon Nov 21, 2005 4:17 am
Location: Sydney, Australia
Contact:

How to remove double quotes ( " )

Post by suresh.narasimha »

Hi guys

Thanks for ur suggestions .
But Ereplace i have tried but that was not accepting.

Experts please spend your valuable time

Thanks in advance
SURESH NARASIMHA
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please post the message that leads you to your assertion that "it was not accepting". Ereplace is an intrinsic function - it must be accepted by the Expression Editor. Perhaps someone has edited your DSParams file, but let's not leap to conclusions without your next post.

The best solution is to have the originators of the file to do quotes properly.

The next best solution is to change the quote character on your Sequential File stage's format tab. Then process the quotes yourself.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
suresh.narasimha
Premium Member
Premium Member
Posts: 81
Joined: Mon Nov 21, 2005 4:17 am
Location: Sydney, Australia
Contact:

How to remove double quotes ( " )

Post by suresh.narasimha »

Hey

i tried like this in the derivation part of transformer

Ereplace(Fieldname,""","")

The above derivation is not accepted

Provide me the solution please .....
SURESH NARASIMHA
ravij
Premium Member
Premium Member
Posts: 170
Joined: Mon Oct 10, 2005 7:04 am
Location: India

Post by ravij »

Hi Suresh,

Use this EReplace function.

EReplace(Iconv(Linkname.fieldname,"MCP"),'"', "")

RK
kcshankar
Charter Member
Charter Member
Posts: 91
Joined: Mon Jan 10, 2005 2:06 am

Post by kcshankar »

Hi suresh,


Use double quote within single quote(' ')
Ereplace(source.Field001,'"','')


regards
kcs
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Use convert() it is faster than ereplace(). It does not do as much but is very good for this type of thing.
Mamu Kim
Post Reply