when i trying to connect to sql server through PC SAS , getting the below error.
"ERROR: CLI error trying to establish connection: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".
ERROR: Connection to the odbc DBMS does not exist.
This is the sample code for this error:
proc sql;
connect to odbc (dsn=rfdev user=Import pwd=***** );
create table industry.compid2sic_&asofdate
as select * from connection to odbc(
select distinct b.compid as borrower_id, b.wgt , c.[SIC CODE] as sic_code , c.[Industry Code Cross Reference] as Industry_c
FROM DBO.HBUS_SA_CUBE_&asofdate AS A
LEFT JOIN [REPORTING].DBO.NA_V_IndWgt_t() AS B ON A.Borrower_Id = B.[COMPID]
LEFT JOIN DBO.TEMP_SICIndMapForBoard AS C ON B.UNDY = C.[SIC CODE]
where a.report_mlob <> 'Retail'
);
disconnect from odbc;
quit;
Hi Cherry ,
There might be typo in connection string.
What does it mean? can you please explain ?
The error message means that no data source named "rfdev" exists.
Cherry wrote:
What does it mean? can you please explain ?
Did you set up a data source name (i.e. rfdev) in the control center before run this code?
Ksharp
Hi,
I didn't created this DSN, i don't know how check this. Could please advise me what is control center, where can find this, and how to check?
I don't know if you are using ODBC or the SAS/Access product. If it is the latter, you might want to take a look at: http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_91/access_sql_7364.pdf
If your OS were WinXP.
Start -> Set up -> Control Panel -> Manager Tools ->Data Source(ODBC) ->Add-> Select SQL server
to set up a data source name of SQL ,then use this new dsn in the code.
Good Luck.
Ksharp
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.