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 » XML to copybook

Post new topic  Reply to topic
 XML to copybook « View previous topic :: View next topic » 
Author Message
wmqi_2
PostPosted: Sun Jun 02, 2002 3:50 pm    Post subject: XML to copybook Reply with quote

Novice

Joined: 04 May 2002
Posts: 12

i am workin with converting XML to cobol structure.
<mesg><name>AB</name><name>CD</name><name>EF</name></mesg>

Lets say, i know the count of the repeating fields before hand.
I created a mesgSet that has an element - "Name", type String & length 2.
And I set "Repeat Count" as 3.
I tried few things in message flow but did not meet success.
I am looking forward for your tips guyz.

thnX
Back to top
View user's profile Send private message
kirani
PostPosted: Sun Jun 02, 2002 5:16 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Can you explain more about the problem here? What is the exact error message you are getting? Posting your ESQL would be helpful.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
wmqi_2
PostPosted: Mon Jun 03, 2002 6:12 am    Post subject: Reply with quote

Novice

Joined: 04 May 2002
Posts: 12

<mesg>
<name>AB</name>
<name>CD</name>
<name>EF</name>
</mesg>

The ESQL would be (some kind of looping should be done here on the "name" field for 3 times):

SET OutputRoot.MRM.NAME = InputBody.mesg."name";

I set the repeat count for the element "NAME" as 3 times.

The expected output would look like : ABCDEF
Back to top
View user's profile Send private message
kirani
PostPosted: Mon Jun 03, 2002 8:14 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

1. Modify values for MessageFormat, MessageType and MessageSet in the following code as per your environment.
Select "Copy Message Headers Only" in a compute node.

DECLARE I INT;
SET I = 1;

WHILE (I<=3) DO
SET OutputRoot.MRM."NAME"[I] = InputBody.mesg."name"[I];
SET I = I + 1;
END WHILE;

SET OutputRoot.Properties.MessageSet = 'D0...';
SET OutputRoot.Properties.MessageDomain = 'MRM';
SET OutputRoot.Properties.MessageFormat = 'CWF';
SET OutputRoot.Properties.MessageType = m_....;


2. Assign this messageSet to the broker and do a broker level deploy.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
wmqi_2
PostPosted: Mon Jun 03, 2002 11:00 am    Post subject: Reply with quote

Novice

Joined: 04 May 2002
Posts: 12

hi kirani
thanks for ur reply....

i did tried what you suggested but i got this error
Invalid indexed assignment to NAME[2].
I did assigned the element properties as "Repeat" & set the count=3.
The length was set as 2.
what am I missing here ?
Back to top
View user's profile Send private message
wmqi_2
PostPosted: Mon Jun 03, 2002 6:28 pm    Post subject: Reply with quote

Novice

Joined: 04 May 2002
Posts: 12

I hope some one could help me on this problem ....

Looking forward for your suggestions..
Back to top
View user's profile Send private message
kirani
PostPosted: Mon Jun 03, 2002 6:56 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

I will try to test this on my machine and let you know about the results.
In the meantime if someone has already tested this can help.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
kirani
PostPosted: Mon Jun 03, 2002 9:05 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

I tried following code on my machine and it worked.

I created a new message set, type and element. In types folder, I had set Repeat to 'Yes' under Connection tab. In CWF tab, I had Set RepeatCountType to Count and RepeatCount to 3.

In compute node I have following ESQL code,

SET OutputRoot.MRM."NAME"[1] = 'AB';
SET OutputRoot.MRM."NAME"[2] = 'CD';
SET OutputRoot.MRM."NAME"[3] = 'EF';

SET OutputRoot.Properties.MessageDomain = 'MRM';
SET OutputRoot.Properties.MessageFormat = 'CWF';
SET OutputRoot.Properties.MessageType = m_..;
SET OutputRoot.Properties.MessageSet = 'D...';


This gives me ABCDEF output message and trace shows me it is is creating repeating NAME element.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
vanessa
PostPosted: Thu Jun 06, 2002 6:16 am    Post subject: Reply with quote

Novice

Joined: 24 Jan 2002
Posts: 22

I also tried this solution myself, but it did not work.
Got the same error. I hope same is the case with Kirani too.
Just wonderin if any one has had/used this kind of scenario.

Thannks in adv
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 » XML to copybook
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.