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 » Regarding Date Format conversion

Post new topic  Reply to topic
 Regarding Date Format conversion « View previous topic :: View next topic » 
Author Message
anilmekala
PostPosted: Thu Oct 08, 2015 2:17 am    Post subject: Regarding Date Format conversion Reply with quote

Acolyte

Joined: 19 Oct 2012
Posts: 63

Hi All,

As for my requirement i am receiving following dateformat :'dd/mm/yyyy hh:mm:ss' and i want to convert into the following format 'YYYY-MM-DDThh:mm:ss '

I have developed code as follows [DECLARE inpattern CHARACTER 'yyyy-MM-dd HH:mm:ss';
DECLARE outpattern CHARACTER 'YYYY-MM-DDThh:mm:ss';
DECLARE queryDate CHARACTER;

SET queryDate = CAST(OutputRoot.XMLNSC.Response.OutputData.DATA.Query.QueryDate AS TIMESTAMP FORMAT inpattern);SET OutputRoot.XMLNSC.namespace:GetInboxQueryListRes.namespace:ResBody.namespace:QueryDetails.namespace:Query.namespace:QueryDate = CAST(queryDate AS CHARACTER FORMAT outpattern);]


I am gelling below exceptions:

<EsbErrCode>3204</EsbErrCode>
<EsbErrLongDesc>28/05/2015 23:15:59.yyyy-MM-dd HH:mm:ss.28/05/2015 23:15:59.yyyy.Caught exception and rethrowing. Caught exception and rethrowing. Error detected, rethrowing. Error while casting. subParse failed.</EsbErrLongDesc>
<EsbErrShortDesc>RecoverableException</EsbErrShortDesc>


Please help to to resolve this issue.

Regards,

Anil.[/code]
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Oct 08, 2015 3:52 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Code:

DECLARE inpattern CHARACTER 'yyyy-MM-dd HH:mm:ss';
DECLARE outpattern CHARACTER 'YYYY-MM-DDThh:mm:ss';
DECLARE queryDate CHARACTER;

SET queryDate = CAST(OutputRoot.XMLNSC.Response.OutputData.DATA.Query.QueryDate AS TIMESTAMP FORMAT inpattern);
SET OutputRoot.XMLNSC.namespace:GetInboxQueryListRes.namespace:ResBody.namespace:QueryDetails.namespace:Query.namespace:QueryDate = CAST(queryDate AS CHARACTER FORMAT outpattern);


How does this
28/05/2015 23:15:59
in anyway shape or form match the inpattern format?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Simbu
PostPosted: Thu Oct 08, 2015 3:53 am    Post subject: Reply with quote

Master

Joined: 17 Jun 2011
Posts: 289
Location: Tamil Nadu, India

When you are converting String format to esql timestamp, the pattern must be of String format. Please refer http://www-01.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak05616_.htm?lang=en
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 » Regarding Date Format conversion
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.