BookmarkSubscribeRSS Feed
Cherry
Obsidian | Level 7

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;

7 REPLIES 7
manojinpec
Obsidian | Level 7

Hi Cherry ,

There might be typo in connection string.

Cherry
Obsidian | Level 7

What does it mean? can you please explain ?

andreas_lds
Jade | Level 19

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

Cherry wrote:

What does it mean? can you please explain ?

Ksharp
Super User

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

Ksharp

Cherry
Obsidian | Level 7

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?

art297
Opal | Level 21

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

Ksharp
Super User

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

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 4573 views
  • 0 likes
  • 5 in conversation