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 » Ignore delimiters in TDS

Post new topic  Reply to topic
 Ignore delimiters in TDS « View previous topic :: View next topic » 
Author Message
HarryHill
PostPosted: Wed May 25, 2011 12:03 am    Post subject: Ignore delimiters in TDS Reply with quote

Newbie

Joined: 01 Feb 2011
Posts: 5

I have a message from a legacy system that contains a header record which is a list of comma separated values followed by one or more 'printable pages' that are delimited by the form feed character like this:

Code:

Value1,Value2,....ValueN
<FF>
Page1
<FF>
Page2
<FF>
..
..
<FF>
<PageN>


The comma separated record contains information about the destination e.g. file name, location etc while the rest of themessage is the file contents.

What I need to do is parse the comma delimited bit to get my destination details and then put the rest into the output message.

I created my message definition as TDS with 'All element delimited' and thedelimiter set to <FF>. Then for the CSV bit I defined as 'All elements delimited' with the delimiter set to comma (,).

This works in that I can parse the message and pick up the values from the CSV part and I can access each page of the report.

But I want to move all the pages, including the <FF> characters i.e. the whole message apart from he CSV bit, to the output message.

What I've done thus far is to move through the pages one at a time appending each one along with a <FF> character to the output.

Is there a simpler way? Can I define my message set in any way so that I can access the whole of the message, apart from the CSV bit, including the <FF> characters?

TIA.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed May 25, 2011 4:11 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I would
- make the header record optional ( minOccurs=0 )
- in your flow, extract the header info and save it somewhere ( probably the local environment )
- copy input root to output root
- delete the header info from OutputRoot
- write the remainder using the TDS parser

That's the purist's approach. A higher-performing alternative would be:
- set the domain to BLOB
- use CAST to convert it to a character string
- extract the characters up to the first <FF> using ESQL SUBSTRING function
- use CREATE...PARSE to create a message tree from that string. You can create it directly in the environment tree.
- delete the header info from the string
- CAST the remainder of the string to BLOB and assign to OutputRoot.

Obviously, your message definition would be simpler in the second case, because you would not be parsing the pages.
Back to top
View user's profile Send private message
HarryHill
PostPosted: Thu May 26, 2011 5:23 am    Post subject: Reply with quote

Newbie

Joined: 01 Feb 2011
Posts: 5

Thanks Kimbert. The purist way works like a dream.
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 » Ignore delimiters in TDS
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.