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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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