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 format

Post new topic  Reply to topic
 DATE format « View previous topic :: View next topic » 
Author Message
krustyelpayaso
PostPosted: Tue Mar 07, 2006 12:48 am    Post subject: DATE format Reply with quote

Apprentice

Joined: 24 Oct 2005
Posts: 26

Hi,

i have a Trace Node, and into this node i would like to make a CURRENT_DATE and CURRENT_TIMESTAMP format. The format type would be:

[DD/MM/YYYY HH:MM:SS]

My source code is like this:

[${CAST(EXTRACT (DAY FROM CURRENT_DATE) AS CHAR FORMAT '99') }/
${CAST(EXTRACT (MONTH FROM CURRENT_DATE) AS CHAR FORMAT '99')}/
${EXTRACT (YEAR FROM CURRENT_DATE)}
${CAST(EXTRACT (HOUR FROM CURRENT_TIMESTAMP) AS CHAR FORMAT '99')}:
${CAST(EXTRACT (MINUTE FROM CURRENT_TIMESTAMP) AS CHAR FORMAT '99')}:
${CAST(EXTRACT (SECOND FROM CURRENT_TIMESTAMP)AS CHAR
FORMAT '99')}]

With this code the result give [7/3/2006 9:30:1.090224E+1] and i would like a result as [07/3/2006 09:30:10] for example.
I've tried with '00' but the result i sthe same. How can i solve this?

A lot of thanks
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Tue Mar 07, 2006 1:45 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi krustyelpayaso,

What version of MB are you using ?

I tried your code and it gives me the below....i'm on MB6.

Code:
[997/ 993/ 2006 9915: 995: 9911]


I then changed the 99 to 00, it then gives me

Code:
[07/ 03/ 2006 15: 09: 50]


Regards.
Back to top
View user's profile Send private message Send e-mail
shalabh1976
PostPosted: Tue Mar 07, 2006 1:47 am    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

I am basically a V2.1 person, but I saw in the documentation that Second is extracted as a Float value. So a convert to an Integer might help.
You can try using SUBSTRING also. However I am not very sure of V6 syntax so I may be wrong.
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
krustyelpayaso
PostPosted: Tue Mar 07, 2006 1:52 am    Post subject: Reply with quote

Apprentice

Joined: 24 Oct 2005
Posts: 26

Hi elvis_gn,

I'm on MB5...... I'm almost sure than '00' should works, but doesn't it.

Back to top
View user's profile Send private message
krustyelpayaso
PostPosted: Tue Mar 07, 2006 1:59 am    Post subject: Reply with quote

Apprentice

Joined: 24 Oct 2005
Posts: 26

Hi shalabh1976,

I think like you about the seconds . I think there's no a funtion at the MB V5 wich make that simply.

Thanks
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Tue Mar 07, 2006 2:18 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi krustyelpayaso,

A few days back there was some code posted here, where a variable is declared with the format of timestamp that one required and then, the current timestamp is extracted based on it...

You could try and search and try that out, might work.

Regards.
Back to top
View user's profile Send private message Send e-mail
krustyelpayaso
PostPosted: Tue Mar 07, 2006 2:28 am    Post subject: Reply with quote

Apprentice

Joined: 24 Oct 2005
Posts: 26

Yes. You're right. . I knew this post

http://www.mqseries.net/phpBB2/viewtopic.php?t=27726&start=0&postdays=0&postorder=asc&highlight=datetime string

I've catch some lines from this post. Do you know if it's posible put for example DECLARE sentences into a node TRACE?. Which is the sintax?
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Tue Mar 07, 2006 2:51 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi krustyelpayaso,

I dont think it is possible....if it could be, people would start coding in the Trace node

Whatever you type in the space without the "${}" will be displayed as such
and you can only reference the Input message's parts...i.e Root, Body etc...

You could code what you want in a compute and make it display in the trace.....

Regards.
Back to top
View user's profile Send private message Send e-mail
krustyelpayaso
PostPosted: Tue Mar 07, 2006 3:07 am    Post subject: Reply with quote

Apprentice

Joined: 24 Oct 2005
Posts: 26

Thanks friends . I will try to create a Compute Node....follow by a Trace Node.

Thanks again. Good luck!
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 » DATE 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.