Hi,
Same SQL table field shows different data types in SAS PC & EG.
I ran same PROC CONTENTS in PC & EG environment and here is the output. Check for DATADATE field:
PROC CONTENTS DATA=DB_NAME.TABLE_NAME;RUN;
SAS PC output:
SAS EG output:
Actual SQL table definition:
Because of this data type mismatch I'm not able to append data to this table from SAS PC.
WARNING: Variable DataDate not appended because of type mismatch.
Show us the libname statements creating library DB_NAME for both environments (EG and proper SAS).
Hi @ChrisNZ,
I have same library statement in both environment:
libname DB_NAME odbc dsn='PC_ODBC_DSN_FOR_THIS_DATABASE' uid= "&UID." pwd="&PWD." schema="dbo";
libname DB_NAME odbc dsn='UNIX_ODBC_DSN_FOR_THIS_DATABASE' uid= "&UID." pwd="&PWD." schema="dbo";
It looks like the ODBC driver differs in both environments.
SAS will use whatever ODBC gives it. You can use another ODBC client to confirm this.
You can use the cat() or vvalue() function to avoid reading errors when the type is uncertain:
data T1; D='01jan2016'd; format D date9.; run;
data WANT1; set T1; DATE=input(vvalue(D),date9.); run;
data T2; D='01jan2016'; run;
data WANT2; set T2; DATE=input(vvalue(D),date9.); run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.