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 » Translate Month

Post new topic  Reply to topic
 Translate Month « View previous topic :: View next topic » 
Author Message
Rockon
PostPosted: Tue Nov 29, 2005 1:08 pm    Post subject: Translate Month Reply with quote

Apprentice

Joined: 24 May 2004
Posts: 43

Hi All,
I was looking for a method to translate the month in the input value which is in MMM format to mm.i.e If i get it as FEB it should translate to '02'.
Currently I am using the IF....THEN...loop...but was wondering if there was any function calls that can do the same..

Input sample: 28-Nov-2005 11:30:57

Expected Output:28:11:2005 11:30:57

Thankyou,
Cheers
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 29, 2005 1:28 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Are you modeling your data?

Are you using v6?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JT
PostPosted: Tue Nov 29, 2005 2:02 pm    Post subject: Reply with quote

Padawan

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

You could do it like this through ESQL:

Code:
DECLARE dateSample CHARACTER '28-Nov-2005 11:30:57';

SET Environment.Variables.monthTranslation[] =
         LIST{ROW('JAN' AS MMM,'01' AS MM),
              ROW('FEB' AS MMM,'02' AS MM),      
              ROW('MAR' AS MMM,'03' AS MM),      
              ROW('APR' AS MMM,'04' AS MM),      
              ROW('MAY' AS MMM,'05' AS MM),      
              ROW('JUN' AS MMM,'06' AS MM),      
              ROW('JUL' AS MMM,'07' AS MM),      
              ROW('AUG' AS MMM,'08' AS MM),      
              ROW('SEP' AS MMM,'09' AS MM),      
              ROW('OCT' AS MMM,'10' AS MM),      
              ROW('NOV' AS MMM,'11' AS MM),      
              ROW('DEC' AS MMM,'12' AS MM)};
      
SET dateSample = TRANSLATE(dateSample, SUBSTRING(dateSample FROM 4 FOR 3), THE(SELECT ITEM T.MM FROM Environment.Variables.monthTranslation[] AS T WHERE T.MMM = SUBSTRING(dateSample FROM 4 FOR 3)));
Back to top
View user's profile Send private message
wooda
PostPosted: Thu Dec 01, 2005 2:23 am    Post subject: Reply with quote

Master

Joined: 21 Nov 2003
Posts: 265
Location: UK

If you using the MRM domain then this is v.easy.
You can model both datetime formats in your message set
and just parse one and write the other.

If you ARE using MRM then let me know and I'll give more info if you need it.
Back to top
View user's profile Send private message
Rockon
PostPosted: Thu Dec 01, 2005 9:00 am    Post subject: Reply with quote

Apprentice

Joined: 24 May 2004
Posts: 43

Hi All,
Thankyou for the all the inputs.I am still on V5 .The date modelling was basically to transform -- "DD-Mmm-YYYY hh:mm:ss" to 'YYYY-MM-DDThh:mm:ss'
So I used the code snippet and was able to achieve the objective.
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 » Translate Month
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.