DATA Step, Macro, Functions and more

PC SAS,SQL Server error

Reply
Contributor
Posts: 31

PC SAS,SQL Server error

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;

Frequent Contributor
Posts: 138

PC SAS,SQL Server error

Hi Cherry ,

There might be typo in connection string.

Contributor
Posts: 31

PC SAS,SQL Server error

What does it mean? can you please explain ?

Super Contributor
Posts: 259

PC SAS,SQL Server error

The error message means that no data source named "rfdev" exists.

Cherry wrote:

What does it mean? can you please explain ?

Super User
Posts: 9,671

PC SAS,SQL Server error

Did you set up a data source name (i.e. rfdev) in the control center before run this code?

Ksharp

Contributor
Posts: 31

PC SAS,SQL Server error

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?

PROC Star
Posts: 7,360

PC SAS,SQL Server error

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

Super User
Posts: 9,671

PC SAS,SQL Server error

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

Ask a Question
Discussion stats
  • 7 replies
  • 576 views
  • 0 likes
  • 5 in conversation