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 » CREATE LASTCHILD ISSUE

Post new topic  Reply to topic
 CREATE LASTCHILD ISSUE « View previous topic :: View next topic » 
Author Message
tanishka
PostPosted: Wed Oct 27, 2010 6:46 pm    Post subject: CREATE LASTCHILD ISSUE Reply with quote

Centurion

Joined: 24 Nov 2008
Posts: 144

Hi,

I need to store input message in env varibles like below format.
<Message>
<Header>
--
--
</Header>
<Data>
<No></No>
<Supplier></Supplier>
<Buyer></Buyer>
<Details> -- unbounded
--
---
--
</Details>
</Data>
</Message>

CREATE LASTCHILD OF Environment.Variables.Message.Data NAME 'Details';
DECLARE outdtlref REFERENCE TO Environment.Variables.Message.Data.Details;

SET outdtlref .BOL = '';
SET outdtlref .Address = '';

Here the problem is Details folder creating. But the fields in this folder not populating?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Oct 27, 2010 8:01 pm    Post subject: Re: CREATE LASTCHILD ISSUE Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

tanishka wrote:
Hi,

Code:
CREATE LASTCHILD OF Environment.Variables.Message.Data NAME 'Details';
DECLARE outdtlref REFERENCE TO Environment.Variables.Message.Data.Details;

SET outdtlref .BOL = '';
SET outdtlref .Address = '';


Here the problem is Details folder creating. But the fields in this folder not populating?


OK so your stuff hanging off the Environment.Variables has no parser defined... This is your first error. Read up in the infocenter and on the forum on how to assign a parser to your Environment tree.

Code:
DECLARE outdtlref REFERENCE TO Environment.Variables.Message.Data.Details;

SET outdtlref .BOL = '';

You do not check whether the reference is valid after creating it.
You should have
Code:
DECLARE outdtlref REFERENCE TO Environment.Variables.Message.Data.Details;

IF LASTMOVE(outdtlref) THEN
   SET outdtlref.BOL = '';
   ....
END IF;


If you do not want to check the validity of the reference you need to make it valid before declaring it
Code:

SET Environment.Variables.Message.Data.Details VALUE = NULL;
DECLARE outdtlref REFERENCE TO Environment.Variables.Message.Data.Details;


And finally there should be no space between outdtlref and the field separator ('.')

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
tanishka
PostPosted: Thu Oct 28, 2010 5:21 am    Post subject: Reply with quote

Centurion

Joined: 24 Nov 2008
Posts: 144

Please see complete code.. and not getting fields in Details

CREATE LASTCHILD OF Environment.Variables.Msg DOMAIN ('XMLNSC') Namespace ns NAME 'Message';
DECLARE InmsgRef TO Environment.Variables.Msg.ns:Message;

SET InmsgRef.Header.type = '';
SET InmsgRef.Header.source ='';
SET InmsgRef.Header.family = '';
SET InmsgRef.Data. NO= '';
SET InmsgRef.Data.supplier= '';
SET InmsgRef.Data.Buyer = '';

FOR InDtlRef AS InputRoot.MRM.Dtls[] DO
CREATE LASTCHILD OF Environment.Variables.Data NAME 'Details';
DECLARE outdtlref REFERENCE TO Environment.Variables.Message.Data.Details;

IF LASTMOVE(outdtlref ) THEN

SET outdtlref.BOL = '';
--
END IF;
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Oct 28, 2010 5:38 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

If you are taking a copy of the entire input message then you should be able to perform the copy using a single line of ESQL.
Back to top
View user's profile Send private message
tanishka
PostPosted: Thu Oct 28, 2010 5:51 am    Post subject: Reply with quote

Centurion

Joined: 24 Nov 2008
Posts: 144

I do not want complete input message. There are some changes.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Oct 28, 2010 5:55 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

After this line has been executed, which occurrence of 'Details' will outdtlref point at ?
Code:
DECLARE outdtlref REFERENCE TO Environment.Variables.Message.Data.Details;

Is there a way to copy the entire array of Details elements from InputRoot to the target without looping?
Back to top
View user's profile Send private message
inder
PostPosted: Thu Oct 28, 2010 6:25 am    Post subject: Reply with quote

Apprentice

Joined: 24 Mar 2003
Posts: 49
Location: USA

Hi,
Are you getting all the Details record or only one.

Quote:
FOR InDtlRef AS InputRoot.MRM.Dtls[] DO
CREATE LASTCHILD OF Environment.Variables.Data NAME 'Details';
DECLARE outdtlref REFERENCE TO Environment.Variables.Message.Data.Details;


with the above code,you end up creating reference to the first child of Environment.Variables.Message.Data i.e Environment.Variables.Message.Data[1]

You need to create refernce to the
DECLARE outdtlref REFERENCE TO Environment.Variables.Message.Data.Details[n] where n is the loop count

Hope this helps
Back to top
View user's profile Send private message
tanishka
PostPosted: Sat Oct 30, 2010 5:00 pm    Post subject: Reply with quote

Centurion

Joined: 24 Nov 2008
Posts: 144

Hi,

Thanks for all your suggestions.

finally this code worked.

DECLARE Msgref REFERENCE TO Environment.Variables.Message.Data;
CREATE LASTCHILD OF Environment.Variables.Message.Data AS Dtlref NAME 'Details';
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 » CREATE LASTCHILD ISSUE
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.