ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Comma separated values

Post new topic  Reply to topic
 Comma separated values « View previous topic :: View next topic » 
Author Message
prasannanb
PostPosted: Tue Oct 28, 2014 1:08 am    Post subject: Comma separated values Reply with quote

Apprentice

Joined: 17 Apr 2009
Posts: 35

Hi,

I have a comma separated message like below

Empname,number,address
Values are :
John,123,US

In message set how should I specify if I want to eccept comma's in address field when they send in double quotes.
Ex: I should be able to parse below message

Values are:
John,123,"US,Boston"

Please help me
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Oct 28, 2014 4:15 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

If you are on WMB v8 or IIB then you would be better off using the DFDL CSV wizard.
If on WMB v7 then there is a setting on the message set that allows exactly that style of escaping.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
chauhan_samir
PostPosted: Mon Apr 20, 2015 5:59 am    Post subject: Comma separated values : IIB 9 Reply with quote

Novice

Joined: 25 Aug 2005
Posts: 14
Location: USA

Hi,

I am having same issue of parsing data with comma in the value. I used CSV wizard to create Message Model. But

Error:
CTDP3062E: An unexpected non-postfix separator ',' occurs in a postfix position at offset '115' in 'sequence' group contained within element 'Address', xpath: '/Company[1]/Employee[1]/Address[1]'.
ParsedDataRegion[SimpleContent, startOffset = 110, length = 5, scd = #xscd(/schemaElement::Company/type::0/model::sequence/schemaElement::Employee/type::0/model::sequence/schemaElement::Address/type::0/model::sequence/schemaElement::ZipCode)]


Input:
Company[compName=My Company
Employee(empNum=111111|dept=500|empName=Alice Wong|Addr:8200 Warden Ave,"Markham, Ont",L3G 1H7|tel=905-347-5649|sal=135599.95)
Employee(empNum=222222|dept=500|empName=James May|Addr:23 The Cuttings,Chatham,CH2 2PR|tel=208-203-1332|sal=189599.95)
Employee(empNum=333333|dept=310|empName=Richard Hammond|Addr:16 Great Windmill,London,W2 3RJ|tel=207-445-2955|sal=599.95)
Employee(empNum=444444|dept=230|empName=Jeremy Clarkeson|Addr:"Rose Cottage, Pea Dr",Gloucester,GL01 2NM|tel=743-123-4567|sal=75599.95)
Employee(empNum=555555|dept=650|empName=Humphrey Littleton|Addr:416 Regent Street,London,NW1 1QT|tel=207-883-1238|sal=99999.95)
]

Please suggest the solution.

Thanks.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
shanson
PostPosted: Tue Apr 21, 2015 4:31 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

Firstly, your input is not CSV, so you should use the Record-Oriented Text wizard to create the model and not the CSV wizard.

Secondly, I think this is the problem data:

Quote:
Addr:8200 Warden Ave,"Markham, Ont",L3G 1H7


You need to makes sure that the child elements within Address have a DFDL escape scheme specified, so for each of those elements change the Escape Scheme property to point at a suitable escape scheme (ie, one that uses escape block and uses double quote as the start and end characters).
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Apr 21, 2015 7:57 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I am having same issue of parsing data with comma in the value.
Not really - your data format is not CSV, and your error message is not the same. Your problem is a new problem, and it should really be in a separate discussion thread.

shanson said:
Quote:
your input is not CSV, so you should use the Record-Oriented Text wizard to create the model and not the CSV wizard.
You may find that the Record Oriented Text wizard does not do the job either.

DFDL is well able to handle your data format, but you need to be aware that it is a custom data format and the wizard may not give you a ready-made solution. If the wizard does not work then you will need to develop your DFDL model as follows:
- Create an XML Schema (xsd ) that represents the logical structure of your data.
- Open the xsd using the DFDL editor
- Add initiators/terminators/separators to the elements and types to get the data parsed correctly.
- When the data does not parse correctly use the DFDL Trace to debug the problem

We are here to help if you get stuck. But please read the DFDL trace before asking for help.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Comma separated values
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.