Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Validation with Sequential File Stage

Status
Not open for further replies.

sstaubin

Programmer
Jun 10, 2002
14
US
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'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top