08-30-2011 07:12 AM
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:
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;
08-31-2011 08:50 AM
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
09-01-2011 02:23 AM
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.