Invalid Date issue bug
Moderators: chulett, rschirm, roy
Invalid Date issue bug
I have a date in the format YYYYMMDD which is tested by the following routine (stolen from Ray's IsValid)
Test1 = Iconv(fieldval, "DYMD[4,2,2]")
Status1 = Status()
When I pass the value 20080931, this passes as valid which is incorrect as September only has 30 days.
When I pass 20080932 this is correctly handled and fails
Bar hardcoding month checks i.e. writing my own routine, is there any other internal function that can be used ?
Test1 = Iconv(fieldval, "DYMD[4,2,2]")
Status1 = Status()
When I pass the value 20080931, this passes as valid which is incorrect as September only has 30 days.
When I pass 20080932 this is correctly handled and fails
Bar hardcoding month checks i.e. writing my own routine, is there any other internal function that can be used ?
Colin Larcombe
-------------------
Certified IBM Infosphere Datastage Developer
-------------------
Certified IBM Infosphere Datastage Developer
Hi,
In the DS Manager there is in build transform to check whether the input date is valid one or not.
Go to Transforms--> SDK-->Date-->Generic. In this you have transform name "DateGenericIsDate". Using this you can check whether the input date is recognised as valid or not. Returns 1 if a good date, 0 if a bad or unrecognised date.
Try this.
In the DS Manager there is in build transform to check whether the input date is valid one or not.
Go to Transforms--> SDK-->Date-->Generic. In this you have transform name "DateGenericIsDate". Using this you can check whether the input date is recognised as valid or not. Returns 1 if a good date, 0 if a bad or unrecognised date.
Try this.
Thanks for the suggestion.
I have tried calling this in a routine with the following [not all of the routine is shown below]
But I get the following error in Director
Can a SDK transform be used in a routine. If not, how can I access it ?
I have tried calling this in a routine with the following [not all of the routine is shown below]
Code: Select all
DEFFUN DateGenericToTimeStamp(InputDate) calling "DSU.DateGenericToTimeStamp"
Status1 = DateGenericToTimeStamp(fieldval)
Call DSLogInfo (Status1 ,"ValidLigne")
Code: Select all
Program "DSU.ValidLigne": Line 88, Unable to open the operating system file "DSU_BP.O/DSU.DateGenericToTimeStamp".
[ENOENT] No such file or directory
Program "DSU.ValidLigne": Line 88, Unable to load file "DSU.DateGenericToTimeStamp".
Program "DSU.ValidLigne": Line 88, Unable to load subroutine.
Attempting to Cleanup after ABORT raised in stage BI1_200_ENT016.PSN_BI_EXCEL___000033_000_BI1_200_ENT016.LectureDonneeDataStage Phantom Aborting with @ABORT.CODE = 3
Colin Larcombe
-------------------
Certified IBM Infosphere Datastage Developer
-------------------
Certified IBM Infosphere Datastage Developer
Thats the problem
The definition is DateGenericToTimeStamp(%InputDate%, 0). When I try to include this in my routine it fails with the error mentioned previously.
I have added hardcode which checks the number of days according to the month specified. I haven't included leapyears but too bad.
The definition is DateGenericToTimeStamp(%InputDate%, 0). When I try to include this in my routine it fails with the error mentioned previously.
I have added hardcode which checks the number of days according to the month specified. I haven't included leapyears but too bad.
Colin Larcombe
-------------------
Certified IBM Infosphere Datastage Developer
-------------------
Certified IBM Infosphere Datastage Developer
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hang on a minute. The DSU. prefix indicates that it's a Routine - you should be able to see it in your Repository. However the message suggests that it's not there. Can you see it in another project? If so you can export it from there (if read-only object export is enabled) and import it into the project from which it's missing.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.