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 » Subtraction computation

Post new topic  Reply to topic
 Subtraction computation « View previous topic :: View next topic » 
Author Message
ekurzum
PostPosted: Wed Sep 24, 2003 7:39 am    Post subject: Subtraction computation Reply with quote

Newbie

Joined: 24 Sep 2003
Posts: 2
Location: United States

In a Compute Node I have declared a field as character field parsed the necessary data and concatinated the new data in the declared field. I converted to integer for a subtraction computation. Usertrace came back with an error 'Ensure that the data types passed to this operator are compatible'. Here is some cuts from the code.

Declare Put_Date_Time CHAR
Declare Expiry_Time CHAR

SET Expiry_Time = HH||MI||SS||MS||DD||MM||CCYY;
SET Put_Date_Time = HS||M||S||ME||DA||MO||YR;

SET Expiry_Time = CAST(Expiry_Time AS INT);
SET Put_Date_Time = CAST(Put_Date_Time AS INT);


SET TSTAMP = Expiry_Time - Put_Date_Time
Back to top
View user's profile Send private message
EddieA
PostPosted: Wed Sep 24, 2003 8:43 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

You have 2 statements that both try and set Put_Date_Time and Expiry_Time. First:

Code:
SET Expiry_Time = HH||MI||SS||MS||DD||MM||CCYY;
SET Put_Date_Time = HS||M||S||ME||DA||MO||YR;


Which I'm assuming is in character format. Then you try:

Code:
SET Expiry_Time = CAST(Expiry_Time AS INT);
SET Put_Date_Time = CAST(Put_Date_Time AS INT);


Which tries to use the same variables, which were decalred as CHAR as INTs.

Also, even if you sort out your data types, this method of obtaining a difference between 2 times just won't work. Use the TIMESTAMP variables instead.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
ndgohel
PostPosted: Thu Sep 25, 2003 6:39 am    Post subject: declaration error Reply with quote

Newbie

Joined: 04 Oct 2002
Posts: 2

dear,
you have declared both variable as type CHAR.
after casting to INT you are assigning the same to an CHAR variable.

what I suggest, declare other two variables as INT and do something like :

SET Expiry_Time = HH||MI||SS||MS||DD||MM||CCYY;
SET Put_Date_Time = HS||M||S||ME||DA||MO||YR;

DECLARE int_Expiry_Time INTEGER;
DECLARE int_Put_Date_Time INTEGER;

SET int_Expiry_Time = CAST(Expiry_Time AS INT);
SET int_Put_Date_Time = CAST(Put_Date_Time AS INT);

This code will work.

Regards,
Nilesh D.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

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