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 » Dynamic access InputBody fields / structures to remove "

Post new topic  Reply to topic
 Dynamic access InputBody fields / structures to remove " « View previous topic :: View next topic » 
Author Message
Ramphart
PostPosted: Thu Aug 05, 2004 5:52 am    Post subject: Dynamic access InputBody fields / structures to remove " Reply with quote

Disciple

Joined: 21 Jul 2004
Posts: 150
Location: South Africa, JHB

- I'm using WMQI 2.1 CSD 07 on Windows 2000.

Problem
- Some of the fields has double quotes around it as part of the data i.e. '"value"' instead of 'value'
- I'm trying to remove double qoutes from a message structure in one go

Message after parsing
(0x1000021)MRM = (
(0x1000013)Msg = (
(0x300000B)Action = '"B"'
(0x300000B)ProductCode = '"0605021"'
(0x300000B)Facility = '"01"'
(0x300000B)Warehouse = '"01"'
(0x300000B)Description = '"MAGEU NO 1 R/BOW SAC 24x250ml"'
(0x300000B)CaseProductCode = '"0605021"'
(0x300000B)CaseBarCode = '"6001260340060"'
(0x300000B)CaseQuantity = '1.000'
(0x300000B)PackProductCode = '""'
(0x300000B)PackBarcode = '""'
(0x300000B)PackQuantity = '0.000'
(0x300000B)UnitProductCode = '"0605021"'
(0x1000013)FileStuff = (
(0x300000B)FileDesc = '"PRO"'
(0x300000B)FileID = '"ITEM_MASTR"'
(0x300000B)FileName = '"PRO01_0083"'
)
(0x300000B)PackBarcode = '""'
(0x300000B)PackQuantity = '0.000'
(0x300000B)UnitProductCode = '"0605021"'
(0x300000B)UnitBarcode = '"NOBCCU0605021"'
)


My current solution
/*********************************************************************
** FUNCTION RemoveDblQuotes
** Remove Double Quotes ("") around a field
**********************************************************************/
CREATE FUNCTION RemoveDblQuotes (value CHAR) RETURNS CHAR
BEGIN
Set value = TRIM(value);
Set value = TRIM('"' FROM value);
RETURN value;
END;

- I wrote the above function and use it as follows:
---> SET "OutputRoot"."MRM"."Product"."Action" = RemoveDblQuotes("InputBody"."Msg"."Action");
---> I'd need to do this for every element that I map to the OutputRoot individually


Ideal solution
- id like to be able the take the "InputBody"."Msg".*[] in some way and apply the RemoveDblQuotes function to each field (and fields within sub-structures) in a loop or something

- Something along the lines of
declare numFields INTEGER;
declare cnt INTEGER;
Set numFields = CARDINALITY("InputBody"."Msg".*[]);
Set cnt = 1;

While cnt <= numFields Do
Set "InputBody"."Msg".*[cnt] = RemoveDblQuotes("InputBody"."Msg".*[cnt]);
Set cnt = cnt + 1;
End While;


Help
- I know i'm on the wrong track with the way i access the fields and my cardinality (for the TOTAL fields) will be wrong anyway if there are substructres with its own child elements
- Any ideas on how I can achieve this in eSQL (I dont want to do it on the Message Set Level)
- Thx in advance for any assistance

_________________
Applications Architect
Back to top
View user's profile Send private message
wooda
PostPosted: Mon Aug 09, 2004 3:45 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

Hi,
If your message only contains double quotes in this context. (ie. not other ones you want to keep.) then you could probably remove them much more efficiently in the BLOB domain treating you message as a single string of bytes and removing all the double quotes.
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 » Dynamic access InputBody fields / structures to remove "
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.