Author |
Message
|
rgparks |
Posted: Wed Jan 14, 2004 1:24 pm Post subject: How do I pase Fixed length data(MRM) and XML in one message |
|
|
Newbie
Joined: 14 Jan 2004 Posts: 3 Location: Kansas City
|
I am trying to parse the following message as XML, bringing it in as a BLOB and then making it XML. I want to take the top(MRM like) data and add it to the bottom XML and parse it as one XML message . I've tried just taking the XML at the bottom and getting to parse as XML by using a RCD node, but no luck, it comes out as a hex field X'3c47..... Any help?
1234111111111111111111111111111111111111111111111111000015256789SCSCSLSL<Group>
<Policy_Num>888888</Policy_Num>
<Policy_Status>02</Policy_Status>
<Policy_Effct_Date>19671106</Policy_Effct_Date>
<Policy_Exprtn_Date>20690101</Policy_Exprtn_Date>
<Policy_Name>SGIS Test</Policy_Name>
<Policy_Addr_Line1>Address Line One</Policy_Addr_Line1>
<Policy_Addr_Line2>Second Address Line</Policy_Addr_Line2>
<Policy_Addr_Line3>A third address line</Policy_Addr_Line3>
<Policy_City>Talladega</Policy_City>
<Policy_State>AL</Policy_State>
<Policy_Postal_Code>35160</Policy_Postal_Code>
<Policy_Phone_Num>2563623979</Policy_Phone_Num>
<Claim_Contact_First_Name>John</Claim_Contact_First_Name>
<Claim_Contact_Last_Name>Galt</Claim_Contact_Last_Name>
<Claim_Contact_MI>M</Claim_Contact_MI>
<Client_ID>2345</Client_ID>
<Dental_Benefit_Type_List count='3'>
<Dental_Benefit_Type>TG</Dental_Benefit_Type>
<Dental_Benefit_Type>PPD</Dental_Benefit_Type>
<Dental_Benefit_Type>VOL</Dental_Benefit_Type>
</Dental_Benefit_Type_List>
<Issuing_Company>1</Issuing_Company>
<Install_Status>02</Install_Status>
</Group> |
|
Back to top |
|
 |
Missam |
Posted: Wed Jan 14, 2004 8:23 pm Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Hi
I think you can acheive this by using aggregate nodes or you can store one message in database and retrieve it to concatinate. |
|
Back to top |
|
 |
kspranava |
Posted: Thu Jan 15, 2004 1:01 am Post subject: Did u try this? |
|
|
 Centurion
Joined: 27 Apr 2003 Posts: 124
|
Hi,
u can do ur opearation as below,
InputNode(1) --> Compute Node(2) --> RCD (3) --> Output(4)
(1) --> get data as BLOB
(2) --> do operations in BLOB, since the data will be of fixed length u can extract the same using SUBSTRING applied to a BLOB and then add the same in place wherever u want. While operating wiht data in BLOB, all the characters should be referred in hex characters.
(3) --> Set the Msg Domain to XML and check the 'Reset Message Domain' check box.
(4) --> Dont forget to give the output queue name in output node...
Hope this solves ur problem.
Pranava. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 15, 2004 6:12 am Post subject: Re: How do I pase Fixed length data(MRM) and XML in one mess |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
rgparks wrote: |
it comes out as a hex field X'3c47..... |
This usually means that you are doing a CAST as character or blob without specifying a CCSID. Try adding "CCSID InputRoot.Properties.CodedCharSetId" to any of your casts. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
rgparks |
Posted: Wed Jan 21, 2004 10:51 am Post subject: |
|
|
Newbie
Joined: 14 Jan 2004 Posts: 3 Location: Kansas City
|
Its working! I used the input node- compute node- rcd combo. |
|
Back to top |
|
 |
Michael Dag |
Posted: Wed Jan 21, 2004 12:25 pm Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
rgparks wrote: |
Its working! I used the input node- compute node- rcd combo. |
Great! now help others who may have the same question in the future and post your code here
Michael |
|
Back to top |
|
 |
rgparks |
Posted: Mon Feb 09, 2004 7:46 am Post subject: Here is my code |
|
|
Newbie
Joined: 14 Jan 2004 Posts: 3 Location: Kansas City
|
-- LENGTH VARIABLES
DECLARE FWDONE INTEGER;
DECLARE FirstEndTagPos INTEGER;
-- BLOB VARIABLES
DECLARE XMLBLOB BLOB;
DECLARE FIXEDDATA BLOB;
DECLARE PARTXML BLOB;
DECLARE RESTXML BLOB;
DECLARE XMLENDTAG BLOB;
DECLARE XMLHEADERTAG BLOB;
DECLARE XMLHEADERENDTAG BLOB;
DECLARE XMLHEADERBEGTAG BLOB;
-- Get a Blob that contains the XML portion of the message
SET XMLBLOB = SUBSTRING("InputRoot"."BLOB"."BLOB" FROM 73);
-- Get a Blob of the fixed data header
SET FIXEDDATA = SUBSTRING("InputRoot"."BLOB"."BLOB" FROM 1 FOR 72);
-- set XMLENDTAG to hex of character '>'
SET XMLENDTAG = X'3E';
-- set XMLHEADERBEGTAG to hex of character '<HEADER>'
SET XMLHEADERBEGTAG = X'3C4845414445523E';
-- set XMLHEADERENDTAG to hex of character '</HEADER>'
SET XMLHEADERENDTAG = X'3C2F4845414445523E';
-- concatenate Blobs of header '<HEADER>', HEADER DATA, and '</HEADER>'
SET XMLHEADERTAG = XMLHEADERBEGTAG || FIXEDDATA ||XMLHEADERENDTAG;
-- Find the first postion in the XML Blob of '>' to insert the HEADER XML
SET FirstEndTagPos = POSITION(XMLENDTAG IN XMLBLOB);
SET FWDONE = FirstEndTagPos + 1;
-- Separate XML Blob into two parts
SET PARTXML = SUBSTRING(XMLBLOB FROM 1 FOR FirstEndTagPos);
SET RESTXML = SUBSTRING(XMLBLOB FROM FWDONE);
-- Concatenate the HEADER xml in with the other 2 separated parts of the original XML
SET "OutputRoot"."BLOB"."BLOB" = PARTXML || XMLHEADERTAG || RESTXML; |
|
Back to top |
|
 |
|