Author |
Message
|
mqbrk_newbie |
Posted: Thu Dec 23, 2004 8:05 am Post subject: cadata! |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
hi,
I am using WBIMB5.0 CSD02. I have a simple message flow which has input xml content. I have a CDATA part inside the xml which has a copybook content. I have to take that portion of copybook information from CDATA and map it to corresponding output which is in copybook format.
If my input is like this
<?xml version="1.0" encoding="UTF-8"?>
<message>
<version> </version>
<group> </group>
<information><![CDATA[name place city dob country ]]> </information>
</message>
output copybook definition
01 message
05 Name PIC X(50)
05 PLACE PIC X(30)
05 CITY PIC X(20)
05 DOB PIC X(10)
05 COUNTRY PIC X(20)
05 FILLER PIC X(1000)
Can anyone help me out with a piece of code how get the content from CDATA map tp copy book definition mentioned above.
thanks for your help in advance... |
|
Back to top |
|
 |
sieijish |
Posted: Thu Dec 23, 2004 8:27 am Post subject: |
|
|
Acolyte
Joined: 29 Nov 2004 Posts: 67 Location: London
|
The following expression will give you the content of the CDATA section
InputRoot.XML.message.information.(XML.CDataSection)* |
|
Back to top |
|
 |
mqbrk_newbie |
Posted: Thu Dec 23, 2004 8:54 am Post subject: cdata! |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
hi,
I know how to refer it , but i dont how to take that information and map it to corresponding copybook output. Can you help me with this please..
thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 23, 2004 9:18 am Post subject: Re: cdata! |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
mqbrk_newbie wrote: |
I know how to refer it , but i dont how to take that information and map it to corresponding copybook output. Can you help me with this please.. |
You use the SET statement to assign data from one field to another. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
mqbrk_newbie |
Posted: Thu Dec 23, 2004 9:48 am Post subject: cdata! |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
jeff i understood what you are saying,
i wrote a peice of code like this
CREATE COMPUTE MODULE sample1_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET OutputRoot.Properties = InputRoot.Properties;
SET OutputRoot.MQMD = InputRoot.MQMD;
DECLARE message BLOB;
SET message = CAST(BITSTREAM(InputRoot.XML.message.information.(XML.CDataSection)) AS BLOB);
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;
I dont know how to convert this blob message parse it using MRM to map with copybook output..
Can you help me with this please |
|
Back to top |
|
 |
sieijish |
Posted: Thu Dec 23, 2004 9:53 am Post subject: |
|
|
Acolyte
Joined: 29 Nov 2004 Posts: 67 Location: London
|
Did you create the message set & definitions for your message? |
|
Back to top |
|
 |
mqbrk_newbie |
Posted: Thu Dec 23, 2004 10:50 am Post subject: cadata! |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
yes I did , I created message set and message definition for the copybook. All I need is to take the blob message and map with the definition and message set. I though of using Bitstream function , But I did not get the exact syntax,
can you help me with this please..
thanks |
|
Back to top |
|
 |
mqbrk_newbie |
Posted: Thu Dec 23, 2004 1:20 pm Post subject: cdata! |
|
|
 Acolyte
Joined: 13 Sep 2004 Posts: 70
|
Any help regarding this issue is highy appreciated. I need to solve this bye the end of day..
thanks |
|
Back to top |
|
 |
mgk |
Posted: Thu Dec 23, 2004 2:44 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Look at the CREATE statement and use the PARSE and DOMAIN clauses...
Cheers, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 23, 2004 4:56 pm Post subject: Re: cdata! |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
mqbrk_newbie wrote: |
Any help regarding this issue is highy appreciated. I need to solve this bye the end of day.. |
Whose end of day?
Yours?
Mine?
Someone in India's? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|