Author |
Message
|
ppraveen33 |
Posted: Wed Aug 13, 2014 1:26 am Post subject: validating date format issue |
|
|
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 |
|
 |
kimbert |
Posted: Wed Aug 13, 2014 2:29 am Post subject: |
|
|
 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 |
|
 |
ppraveen33 |
Posted: Wed Aug 13, 2014 5:08 am Post subject: |
|
|
Apprentice
Joined: 26 Jun 2013 Posts: 36
|
|
Back to top |
|
 |
ppraveen33 |
Posted: Wed Aug 13, 2014 5:13 am Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Wed Aug 13, 2014 5:29 am Post subject: |
|
|
 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 |
|
 |
hotrock026 |
Posted: Tue Aug 26, 2014 7:33 am Post subject: date format is yyyy-dd-mm |
|
|
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 |
|
 |
Vitor |
Posted: Tue Aug 26, 2014 7:38 am Post subject: Re: date format is yyyy-dd-mm |
|
|
 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 |
|
 |
fjb_saper |
Posted: Tue Aug 26, 2014 7:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 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 |
|
 |
|