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 » validating date format issue

Post new topic  Reply to topic
 validating date format issue « View previous topic :: View next topic » 
Author Message
ppraveen33
PostPosted: Wed Aug 13, 2014 1:26 am    Post subject: validating date format issue Reply with quote

Apprentice

Joined: 26 Jun 2013
Posts: 36

MY Toolkit is IIB 9.0.0.1
I have a requirement which is as follows
I am getting date field in the Input which I took it as a String and the format will be of different types may be (yyyy-dd-mm,mm-dd-yyyy). Now My requirement is if the date format is yyyy-dd-mm then It is a GOOD record otherwise it should be a BAD record and need to put in to a failure queue without throwing any exception at the node level. So How to validate the format of the date field.

Thanks in advance
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Aug 13, 2014 2:29 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

What type of data is the input? XML?
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
ppraveen33
PostPosted: Wed Aug 13, 2014 5:08 am    Post subject: Reply with quote

Apprentice

Joined: 26 Jun 2013
Posts: 36

CSV
Back to top
View user's profile Send private message
ppraveen33
PostPosted: Wed Aug 13, 2014 5:13 am    Post subject: Reply with quote

Apprentice

Joined: 26 Jun 2013
Posts: 36

My input is CSV. Currently am working in IIB and I created DFDL for CSV input.

As per my requirement in input if date format is yyyy-mm-dd then only it is good record and go to success queue. If it is not in that particular format then it need to go to another queue without giving exception.

Please do the needful..
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Aug 13, 2014 5:29 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I can think of two potential solutions:
a) change the type to xs:date and set the textCalendarPattern property to describe the format that you want
b) if a) is not strict enough, leave the type as xs:string and use a pattern facet to check the format ( add the facet in the Validation section of the DFDL properties ).
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
hotrock026
PostPosted: Tue Aug 26, 2014 7:33 am    Post subject: date format is yyyy-dd-mm Reply with quote

Apprentice

Joined: 23 Feb 2014
Posts: 38

Write Some Esql Procedure and call the procedure from the code so that it can be used easily and also u can provide Date Formats Patterns...etc...

Thats the easy way...
_________________
Think Better & Think Smart then others
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Aug 26, 2014 7:38 am    Post subject: Re: date format is yyyy-dd-mm Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

hotrock026 wrote:
Write Some Esql Procedure and call the procedure from the code so that it can be used easily and also u can provide Date Formats Patterns...etc...


Which, as @kimbert aludes to, can be done through the product.

hotrock026 wrote:
Thats the easy way...


So writing code (which takes time) which you then have to test (which takes time) and then maintain (which takes time and more testing) is easy?

It's certainly not Thining Better or Thinking Smart.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Aug 26, 2014 7:56 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Remember the original requirement:
If the date format is not right => route differently without raising an exception...
Don't know why you would want to specify this no exception in the requirement... would not route differently be enough?
_________________
MQ & Broker admin
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 » validating date format issue
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.