I have a field defined as date, 8 characters long in an Sequential File Stage. I need to validate the value as a valid date, replacing the value with 19000101 if the date is invalid.
Is there a built-in function to do date validation?
In the Transformation Stage, double click the field in the result stage. Right click and select DS Transform. Select SDK > Date > Generic > DateGenericIsDate(%InputDate%). This routine returns 1 if the date is vaild or 2 if not. With this code an If Then Else statement to handle the assignment.
eg: If DateGenericIsDate(Fromsm0201dr.TOUCH_POINT_DATE) = 1 then Fromsm0201dr.TOUCH_POINT_DATE else '19000101'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.