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 » TDS Reserved Character

Post new topic  Reply to topic
 TDS Reserved Character « View previous topic :: View next topic » 
Author Message
dhireng
PostPosted: Thu Jun 16, 2011 12:18 pm    Post subject: TDS reserved Character Reply with quote

Apprentice

Joined: 13 Jun 2011
Posts: 45

A newbee question .... I have a fixed length file delimited by || (two pipes). And I have a release character !. If || is specified as reserved character, each | is released with a !. The question is how would I release only if || appears in the elements?
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jun 16, 2011 12:55 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I don't think the TDS parser can handle that scenario.

If you describe your data format in more detail I may be able to suggest a workaround.
Back to top
View user's profile Send private message
dhireng
PostPosted: Fri Jun 17, 2011 12:49 am    Post subject: Reply with quote

Apprentice

Joined: 13 Jun 2011
Posts: 45

Thanks for your quick reply... We are moving from our IBM WTX event server environment to WMB. Our TX maps receive header information as follows
HDR||aaaa||bbbb||xxxx||||||2||fdfdf||<CR><LF>
Rarely data can also have || in which case TX releases it with ! (|||||| because some elements are empty).

I'm defining a collection before I call TX.

So I defined my initiator as HDR|| , delimiter as || and release character ! but cant seem to figure out how to release ! with ||

This scenario will be extremely rare (may not have occurred even once until now) but I'm trying to do a like for like message set so that our current TX maps wont have to undergo a change.

Any pointers regarding this will help.
Cheers.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Jun 17, 2011 5:54 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

OK - the conclusions are:
- TDS only escapes single characters. There is no way to prevent the TDS parser adding that second ! to escape the second |.
- You cannot fix this up after TDS has written the output message. If you try, you will end up replacing a valid !|!| with !||.

So the solution is to perform the escaping before the message gets written.
- remove the escape character from the message set ( only for writing - it is still useful when parsing )
- write some ESQL ( or Java ) that performs the escaping before the message is written. The algorithm would be:
Code:
for each field
    replace every occurrence of '||' with '"!||'


ESQL has a handy function for replacing one substring with another throughout a string:
Code:
SET myFieldRef VALUE = REPLACE(FIELDVALUE(myFieldRef), '||','!||') ;
Back to top
View user's profile Send private message
dhireng
PostPosted: Fri Jun 17, 2011 1:55 pm    Post subject: Reply with quote

Apprentice

Joined: 13 Jun 2011
Posts: 45

Thanks for the confirmation that I cannot do anything with my message set definition.
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 » TDS Reserved Character
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.