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 » Parent's delimiter in child element's group indicator

Post new topic  Reply to topic
 Parent's delimiter in child element's group indicator « View previous topic :: View next topic » 
Author Message
dino
PostPosted: Wed Sep 29, 2004 6:47 am    Post subject: Parent's delimiter in child element's group indicator Reply with quote

Newbie

Joined: 26 Sep 2004
Posts: 6

Hi

Is it possible to create a TDS message where the parent group's delimiter ( , ) is enclosed within child element's group indicator and TDS parser will treat comma as a normal character if it is within the group indicator.

Message (DES ="All Element Delimited", Delimiter=",")
group1 (Group Ind=" Group Terminator=" Delimiter="<NUL>")
element1
group2 (Group Ind=" Group Terminator=" Delimiter="<NUL>")
element2
element3
element4

Test Data
"There is a comma , in this field","Another comma , here",1234,5678

Result
Message
element1 = "There is a comma , in this field"
element2 = "Another comma , here"
element3 = 1234
element4 = 5678

I tried it in WBIMBv5 CSD03 but the TDS parser will truncate at the first occurance of comma. Any idea???
Back to top
View user's profile Send private message
shanson
PostPosted: Wed Sep 29, 2004 8:51 am    Post subject: Reply with quote

Partisan

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

See http://www.mqseries.net/phpBB2/viewtopic.php?t=16510 - it's a discussion of exactly this.
Back to top
View user's profile Send private message
dino
PostPosted: Thu Sep 30, 2004 7:56 am    Post subject: Reply with quote

Newbie

Joined: 26 Sep 2004
Posts: 6

Hi shanson, thanks for replying. yes i did read that discussion. However, i was not able to replicate it in WBIMBv5 CSD03 successfully. This is what i did:

msg (msgType) DES=All Elements Delimited Delimiter=, Suppress=Never
|--char1grp (complexType)
|-----**ANONYMOUS** DES=Tagged Delimited Delimiter=", Length of Tag=1
|---------char1 (xsd:string) Tag="
|--dec2 (xsd:decimal)
|--int3 (xsd:int)

TestData = "A String,BString",1234.45,1234

When I run the msgflow in debug mode, I got the following error:

Message
|--Properties
|--MQMD
|--MRM
|----char1grp
|-------char1=A String
|--ImbRecoverableException caught from worker->parserNext.

For character field (element with xsd:string), i can only input the Tag field but not the delimiter field. The delimiter has to be set in a group.

I did not try using Data Pattern method as i dont know at which level (element or group) to set the Data Pattern.


Did I set up the TDS message wrongly?? or is the TDS parser in WMQI v2.1 different from v5?
Back to top
View user's profile Send private message
shanson
PostPosted: Fri Oct 01, 2004 4:34 am    Post subject: Reply with quote

Partisan

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

You need to use 'Use Data Pattern' as the separation. You only need (one) complex type msgtyp - you don't need char1grp.
Back to top
View user's profile Send private message
dino
PostPosted: Wed Oct 06, 2004 8:15 am    Post subject: Reply with quote

Newbie

Joined: 26 Sep 2004
Posts: 6

Hi,
I have been trying on the Data Pattern for the past few days. However, i still encounter exception error. I have modify my TDS msg as follows.

msg (msgType) DES=All Elements Delimited Delimiter=, Suppress=Never
|--char1 (xsd:string) Data Pattern=([A-Z]*)|([A-Z]*,[A-Z]*)|([A-Z]*"[A-Z]*)
|--dec2 (xsd:decimal)
|--int3 (xsd:int)

when the parser reads "AB,CDE",1234.56,789, there is a ImbRecoverable Exception caught from worker->parseNext error.

Is the Data Pattern correct??
Back to top
View user's profile Send private message
wooda
PostPosted: Thu Oct 07, 2004 1:47 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

This can be modelled using data pattern at the top level.

Exactly what you do depends on the exact nature of the message.

Q. Are the double quotes optional ? I assume they appear when they are needed (ie when the data contains comma.)
Q. Could any of the fields have the double quotes ?
Q. Can you have escaped quotes in the data as well as around the data ?

Assuming that the quotes are optional and can appear around any field. Which is the most complicated scenario then try somthing like the following :

msg (msgType) DES =Use Data Pattern
|--field1Choice(field1ChoiceType) Data Pattern = (("([^"])*")|([^,])*)
DES=Tagged Delimited Delimiter=N/A
|--sequence DES=All Elements Delimited GI=" GT=" Delimeter=N/A
|--field1(xsd:string)
|--sequence DES=All Elements Delimited Delimeter=N/A
|--field1(xsd:string)

|--field2Choice(field2ChoiceType) Data Pattern = ,(("([^"])*")|([^,])*)
DES=Tagged Delimited Delimiter=N/A
GI=,
|--sequence DES=All Elements Delimited GI=" GT=" Delimeter=N/A
|--field2(xsd:string)
|--sequence DES=All Elements Delimited Delimeter=N/A
|--field2(xsd:string)

etc. Further fields to be included follow the same template as field2.

I have successfully used something very similar to model a CSV type message before.
Back to top
View user's profile Send private message
wooda
PostPosted: Thu Oct 07, 2004 1:51 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

The formatting went a bit awry on my last post.

Here's what it should have looked like:

Code:
msg (msgType) DES =Use Data Pattern
|--field1Choice(field1ChoiceType) Data Pattern = (("([^"])*")|([^,])*)
                                  DES=Tagged Delimited Delimiter=N/A
|----sequence DES=All Elements Delimited GI=" GT=" Delimeter=N/A
|------field1(xsd:string)
|----sequence DES=All Elements Delimited Delimeter=N/A
|------field1(xsd:string)

|--field2Choice(field2ChoiceType) Data Pattern = ,(("([^"])*")|([^,])*)
                                  DES=Tagged Delimited Delimiter=N/A
                                  GI=,
|----sequence DES=All Elements Delimited GI=" GT=" Delimeter=N/A
|------field2(xsd:string)
|----sequence DES=All Elements Delimited Delimeter=N/A
|------field2(xsd:string)
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 » Parent's delimiter in child element's group indicator
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.