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 » date subtraction

Post new topic  Reply to topic Goto page Previous  1, 2
 date subtraction « View previous topic :: View next topic » 
Author Message
bindu
PostPosted: Tue Oct 26, 2004 7:05 am    Post subject: date subtraction Reply with quote

Voyager

Joined: 07 May 2004
Posts: 97

Hi,
I got the most recent date by using select clause and max function. But i am unable to get the text for that particular date here i am posting code and also request message so advice me if i did any wrong or suggest some ..

request:

<Test><Field1><Value>2004-06-25</Value><Text>ma</Text></Field1><Field2><Value>2000-07-25</Value><Text>dh</Text></Field2><Field3><Value>2004-08-30</Value><Text>u</Text></Field3></Test>

Code:

DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.

DECLARE DT DATE;
DECLARE DT1 CHARACTER;
DECLARE DT2 CHARACTER;
DECLARE MSG CHARACTER;
DECLARE i INTEGER;
SET DT = (SELECT MAX(myRef."Value") FROM InputRoot.XML.Test.*[] AS myRef);

SET OutputRoot.XML."xml"."DATE"=DT;

SET i=1;
WHILE(i<= CARDINALITY(InputRoot.XML."Test"."Field"[])) DO
SET DT1 = CAST(InputRoot.XML."Test"."Field"[i]."Value" AS CHARACTER);

SET DT2= CAST(DT AS CHARACTER);
IF(DT1 = DT2) THEN
SET MSG=InputRoot.XML."Test"."Field"[i]."Text";
SET OutputRoot.XML."xml"."VALUE"=MSG;
END IF;
SET i=i+1;
END WHILE;



Any suggestions,

Thanx,
Bindu
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Oct 26, 2004 5:36 pm    Post subject: Reply with quote

Jedi Knight

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

I think you got the tag names wrong. In some places you are referring to it as Field1...Fieldn and in some places you are referring to it as Field[].
I think, once you fix the input message then it will work fine.
_________________
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
bindu
PostPosted: Wed Oct 27, 2004 7:04 am    Post subject: date subtraction resolved Reply with quote

Voyager

Joined: 07 May 2004
Posts: 97

Hi Kiran,
Thanq You very much ....its resoved i am able to getting data.

Thanx for ur time.

Thanx,
Bindu
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » date subtraction
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.