BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SebastianA
Fluorite | Level 6

Hi All,

 

I am new to SAS. I am trying to extract data from SQL Server and load into Teradata.

My source table has few columns which are converted to 'yyyy-mm-dd' format and loaded to Teradata in the PROC sql.

 

when I am trying to append the dataset to Teradata, it gives me a warning:

WARNING: Variable OPPORTUNITY_TCV not appended because of type mismatch.

 

From source I am extracting it as below:

FORMAT(CAST([Status Change Date] AS DATETIME),'yyyy-MM-dd') AS [STATUS_CHANGE_DATE],

 

In the destination DB (Teradata) the column is defined as:

STATUS_CHANGE_DATE DATE FORMAT 'YYYY-MM-DD' DEFAULT DATE '2000-01-01',

 

while executing the SAS program I am getting the below warning.

WARNING: Variable STATUS_CHANGE_DATE not appended because of type mismatch.

 

Please suggest how I can resolve the warning.

 

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

Looks like CASTing the date has converted it to character in the SAS load table. It needs to be a proper SAS date or datetime to load correctly. I suggest you remove the CAST, rerun the download then check the variable type with PROC CONTENTS.

View solution in original post

4 REPLIES 4
SASKiwi
PROC Star

How is STATUS_CHANGE_DATE defined in SAS? Run PROC CONTENTS on your SAS load table and post the output.

SebastianA
Fluorite | Level 6

Please find the PROC CONTENTS output:

 

VariableTypeLenFormatInformatLabel
STATUS_CHANGE_DATEChar4000$4,000.00$4,000.00STATUS_CHANGE_DATE
SASKiwi
PROC Star

Looks like CASTing the date has converted it to character in the SAS load table. It needs to be a proper SAS date or datetime to load correctly. I suggest you remove the CAST, rerun the download then check the variable type with PROC CONTENTS.

SebastianA
Fluorite | Level 6

Thank you @SASKiwi . The warnings are resolved after I removed CASTing during the data fetch.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 2388 views
  • 0 likes
  • 2 in conversation