Comma as a data in a input file

Formally known as "Mercator Inside Integrator 6.7", DataStage TX enables high-volume, complex transactions without the need for additional coding.

Moderators: chulett, rschirm

Post Reply
zaino22
Premium Member
Premium Member
Posts: 81
Joined: Thu Mar 22, 2007 7:10 pm

Comma as a data in a input file

Post by zaino22 »

I have two questions:
Q1 -
we have a CSV source file with 3 inputs. One of the input has comma embedded withing data i.e.: 002,xxxx,USA, United State's of America,USD

002: determines the body of the file.
USA, United State's of America (2nd field)
USD (3rd field)

How is it that I can keep comma in the second field [USA, United State's of America (2nd field)] as a part of data, and let TX treat other commas as a seperator between fields. Currently it treates 2nd field as two fields [USA, beign the 1st, and United State's of America, being the second). I have tried to find out a any option in property window of the field in TYPE DESIGNER/TYPE TREE that can allow me to do just that but I am unable to find.
Please elaborate, as I am new to the tool. If your suggestion is to ask source to put quotation with such fields i.e. ["USA, United State's of America" (2nd field)] then our process should strip quotations, please inform where should this be done, and just quick example.


Q2-
Also, is it possible to have apostrophe ' processesd thru TX as ' instead of &apos. i.e. currently it converts United State's of America TO United State&apos s of America. I want to keep United State's of America AS United State's of America. Please explain how, if it is possible?

I would appreciate.
zaino22
Premium Member
Premium Member
Posts: 81
Joined: Thu Mar 22, 2007 7:10 pm

SOLVED!

Post by zaino22 »

I have found the solution. field that has extra comma as part of data should be in double quotes. In Type Designer, select property of the field, and go to TYPE SYNTAX and use initiator/terminator and value to be " (quotes). I tried, and it kept the comma as part of data.
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

Post by janhess »

Q2 - Should only do the conversion if it is XML. Check the restrictions rules on the type tree.
rep
Participant
Posts: 82
Joined: Tue Jun 19, 2007 8:04 am
Location: New York City

Re: SOLVED!

Post by rep »

zaino22 wrote:I have found the solution. field that has extra comma as part of data should be in double quotes. In Type Designer, select property of the field, and go to TYPE SYNTAX and use initiator/terminator and value to be " (quotes). I tried, and it kept the comma as part of data.
Yeah, well if you're using Excel and saving it as a "csv", it will put quotes around the data field, but if some app is buidling the csv and doesn't, then my way works. It does...I swear. :(
Post Reply