|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Message comprised of smaller messages |
« View previous topic :: View next topic » |
Author |
Message
|
chetty |
Posted: Fri Jun 09, 2006 11:48 am Post subject: Message comprised of smaller messages |
|
|
Newbie
Joined: 22 Mar 2006 Posts: 1
|
Hello All,
I am new to this forum and have experience with WBI for only 2 moths. So if I ask any dumb questions, please bear with me.
Overview of Problem
I am receiving a message from queue or another flow in this format
<Message>
<NwHeader>
</NwHeader>
<Payload>
HD01...........CB01............CB02.............CB03.............CB04............CB05
</Payload
</Message>
(Note: the dots "........." here represent data, I am just keeping it simple)
I am extracting the contents of the payload (Inputroot.XML.Message.NwHeader.Payload) and storing it in a CHARACTER variable.
Code:
DECLARE inputData CHARACTER
SET inputData = Inputroot.XML.Message.NwHeader.Payload;
So this is what I have in inputData
HD01...........CB01............CB02.............CB03.............CB04............CB05
To get HD01 recordtype, I would issue the following command
DECLARE hd01_val CHARACTER
hd01_val = SUBSTRING(inputData FROM 1 FOR 500)
To get CB01 recordtype, I would issue the following command
DECLARE cb01_val CHARACTER
cb01_val = SUBSTRING(inputData FROM 501 FOR 600)
Problem Specifics
Each of these HD01, CB01, CB02, CB03, CB04, CB05 are record types and each adhere to a separate message set. The occurrence of the records can be in any order and hence I cannot associate the entire incoming message to a message set. I have to parse out each record type and associate to a message set. The reason I would like to tie each to a message set and use a MRM parser is so that I can easily navigate the tree and get to my data without having to manually extract each piece of data from within a record set using SUBSTRING.
For example. The CBO1 record consists of FirstName, LastName, SSN, DOB and Address. each of these fields have a definite start and stop position which are defined in the copybook. I've imported the copybook and created a messageset.
And the question...
The problem I am having is that I am not able associate a message set and the parser to a variable - in the above case "cb01_val". Looks like the parser and message set are associated only to an incoming message or outgoing message. How do you handle such situations, where you have to parse out an incoming message and associate only a part of the incoming message to a message set? Any ideas would be greatly welcome |
|
Back to top |
|
 |
JT |
Posted: Fri Jun 09, 2006 11:55 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Use the CREATE statement with the DOMAIN and PARSE clauses.
For examples search for those keywords on this site. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|