Search code examples
sasteradatadata-integration

A SAS value cannot be converted to a Teradata date


I've got a temporary work table with a date variable source_datetime in SAS DIS. This variable is in the DATETIME22.6 format.

I have a teradata table with a date field target_date (type DATE), and using a table loader I am attempting to map source_datetime to target_date. When I run the transformation I get the error

ERROR: A SAS value cannot be converted to a Teradata date

The temporary work table is populated with good data. When I attempt the conversion from DATETIME22.6 to DATE9. the output looks like "*********".

Much gratitude.


Solution

  • I know very little about either DIS or Teradata, but I don't think either are related to your problem.

    Datetime values are the number of seconds since Jan 1, 1960 00:00:00. Date values are the number of days since Jan 1, 1960.

    It sounds like you are trying to apply the date9 format to a datetime value. If you do this, it will usually look like ********* because the number of seconds is way too high to be represented as a date. If you want to keep the datetime value but have it formatted like a date, use the dtdate9 format. Otherwise, you could convert the datetime value to a date value with the datepart() function and then use the date9 format.