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 » CURRENT_GMTTIMESTAMP format

Post new topic  Reply to topic
 CURRENT_GMTTIMESTAMP format « View previous topic :: View next topic » 
Author Message
vids
PostPosted: Fri Apr 08, 2005 4:00 pm    Post subject: CURRENT_GMTTIMESTAMP format Reply with quote

Acolyte

Joined: 24 Mar 2003
Posts: 68
Location: CA, USA

Hi,

We are sending the timestamp to the output message in the format 1999-12-31T23:59:59.999Z.
In the compute node we get the CURRENT_GMTTIMESTAMP and format it as below...

DECLARE strGMTTimeStamp CHARACTER;
DECLARE newstrGMTTimeStamp CHARACTER;

SET strGMTTimeStamp =CAST(CURRENT_GMTTIMESTAMP AS CHARACTER);
SET newstrGMTTimeStamp = SUBSTRING(strGMTTimeStamp FROM 15 FOR 10) || 'T' ||SUBSTRING(strGMTTimeStamp FROM 26 FOR 12) || 'Z';

NOTE: If you print the CURRENT_GMTTIMESTAMP, it will be in the format: GMTTIMESTAMP '2005-04-08 12:19:44.923'

Assuming it will be the same format always, the above string operation was done. It works fine but sometimes we see "'" in the timestamp in output message. Here is how it looks like "2005-03-02T19:44:14'Z".

I'm guessing if the CURRENT_GMTTIMESTAMP has zero milliseconds, instead of getting the date as "GMTTIMESTAMP '2005-04-08 12:19:44.000'" it gets the date in the format "GMTTIMESTAMP '2005-04-08 12:19:44'" i.e with no milliseconds. In this case our string operation fails. Since there is no milliseconds at all, the last apostope is added to our newstrGMTTimeStamp.

I don't see anywhere in the documents exact format of the CURRENT_GMTTIMESTAMP. I'm not sure if we are getting this "'" because of the zero milliseconds. But it looks like that.
We are using WBIMB 5.0.2.

Any ideas???

Thanks
Vids
Back to top
View user's profile Send private message
JT
PostPosted: Mon Apr 11, 2005 5:54 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Add some flexibility, rather than hard-coding the values:

Code:
DECLARE strGMTTimeStamp     CHARACTER;
   SET strGMTTimeStamp   =  CAST(CURRENT_GMTTIMESTAMP AS CHARACTER);
DECLARE startPos            INTEGER POSITION('''' IN strGMTTimeStamp) + 1;
DECLARE endPos              INTEGER POSITION('''' IN strGMTTimeStamp REPEAT 2);
DECLARE newstrGMTTimeStamp  CHARACTER;
   SET newstrGMTTimeStamp   =  SUBSTRING(strGMTTimeStamp FROM startPos FOR (endPos - startPos)) || 'Z';
   SET newstrGMTTimeStamp   =  REPLACE(newstrGMTTimeStamp, ' ', 'T');
Back to top
View user's profile Send private message
samgunddi
PostPosted: Mon Apr 11, 2005 5:59 am    Post subject: Reply with quote

Acolyte

Joined: 17 May 2004
Posts: 54

I presume ur using MB v5.
http://publib.boulder.ibm.com/infocenter/wbihelp/topic/com.ibm.etools.mft.doc/ac05940_.htm
Back to top
View user's profile Send private message
vids
PostPosted: Mon Apr 11, 2005 9:36 am    Post subject: Reply with quote

Acolyte

Joined: 24 Mar 2003
Posts: 68
Location: CA, USA

Thank you.

Vids
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 » CURRENT_GMTTIMESTAMP format
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.