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 » Check InputBody Exists

Post new topic  Reply to topic
 Check InputBody Exists « View previous topic :: View next topic » 
Author Message
cvag
PostPosted: Tue Nov 17, 2009 10:51 pm    Post subject: Check InputBody Exists Reply with quote

Centurion

Joined: 17 Mar 2008
Posts: 127

Hi,
Need suggestion on how to check the inputbody exists or not, irrespective of domain..it may be any input format.

Code:
IF (InputBody IS NOT NULL) THEN
SET OutputRoot.XML.ErrorMessage.ActualMessage = CAST(OriginalMessage AS CHAR CCSID 1208);
ELSE
THROW USER EXCEPTION MESSAGE 2951 VALUES('Zero Length Data Found', OriginalMessage);
END IF;

I tested the flow with specifying the domain aswell as with not specifying the domain.

During debug(with Domain and message)
The code is working fine and the InputBody is refering to the domain which i give.

Without Domain and with empty message
InputBody is refering to the header 'MQMD'

Suggest pls.

Thanks 2 All.
Back to top
View user's profile Send private message
AkankshA
PostPosted: Wed Nov 18, 2009 12:49 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

alternatively...

you can create a reference to input body

by e.g. referring the next child of MQMD / MQRFH2 / whichever header is applicable

and then check for the reference.. if its NULL then no data
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
elvis_gn
PostPosted: Wed Nov 18, 2009 3:18 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

AkankshA wrote:
alternatively...

you can create a reference to input body

by e.g. referring the next child of MQMD / MQRFH2 / whichever header is applicable

and then check for the reference.. if its NULL then no data
It will not be null as the reference will move to InputRoot incase the body is missing...I think you meant LASTMOVE.

There is also something easier where you check the field to be of TYPE...

Regards.
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Wed Nov 18, 2009 3:40 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

When trying to write code like this, it is worth knowing that InputBody is actually defined to point to the "last child" of InputRoot. Therefore, if there is no actual "body" it will end up pointing to the last header (e.g. rfh2 or mqmd) or even properties if there are no headers either...

Kind Regards,


MGK
_________________
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
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 » Check InputBody Exists
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.