Help using Base SAS procedures

MSSQL LIBNAME

Accepted Solution Solved
Reply
Contributor
Posts: 36
Accepted Solution

MSSQL LIBNAME

Hi All,

Thanks in advance, I have been trying to connect to a database on MSSQL server and i am facing trouble with the libname statement that i have to use. I have the user name and password to access the server but i am not able to run the libname statement.

i am using the following libname statement.

libname mssql  user =  password =   database =    server =    schema =  ;

i am receiving that the libname statement is not assigned.

Thank you,

Harish.



Accepted Solutions
Solution
‎05-16-2012 07:54 PM
Trusted Advisor
Posts: 1,301

Re: MSSQL LIBNAME

Are you licensed for the SAS/ACCESS interface for the database type you are trying to connect to?

Do you know what type of database you are connecting to?

Can you access the database by other means on the same machine you are trying to connect to it with SAS?

It sounds to me like you should contact your companies SAS Admin staff or technical support.

Try running the libname statement again with the following before the libname statement.  Copy and paste your log here:

options msglevel=i sastrace=',,t,ds' sastraceloc=saslog;

libname etc mysql user= pass= database= server= port=;

View solution in original post


All Replies
Trusted Advisor
Posts: 1,301

Re: MSSQL LIBNAME

If MSSQL means MySQL:

libname mylib mysql user=user password=password database=mysqldb server=mysqlservr port=9876;

If MSSQL means Microsoft SQL Server then you need to use the sqlsrv engine:

libname mylib sqlsvr nopromt="uid=user; pwd=pass; dsn=sqlservr;";

Applicable documentation:

http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#acreldbwhatsnew902...

Go under the DBMS-Specific Reference Section and then select the SAS/ACCESS Interface you are trying to use, then LIBNAME Statement Specifics for that interface.

Contributor
Posts: 36

Re: MSSQL LIBNAME

Hi Fried Egg,

Thank you for the reply and i have tried with the second libname statement and i am still not able to assign the libname statement.

I have my server name MSSQL09, database name ,schema name, user name and password , i am trying to connect using the libname statement in SAS.

Thank you for that INFO, i will look into it.

Thank you,

Harish. 


Solution
‎05-16-2012 07:54 PM
Trusted Advisor
Posts: 1,301

Re: MSSQL LIBNAME

Are you licensed for the SAS/ACCESS interface for the database type you are trying to connect to?

Do you know what type of database you are connecting to?

Can you access the database by other means on the same machine you are trying to connect to it with SAS?

It sounds to me like you should contact your companies SAS Admin staff or technical support.

Try running the libname statement again with the following before the libname statement.  Copy and paste your log here:

options msglevel=i sastrace=',,t,ds' sastraceloc=saslog;

libname etc mysql user= pass= database= server= port=;

Super Contributor
Posts: 349

Re: MSSQL LIBNAME

Hi Harish,

Is it MSSQL or MYSQL?

syntax for MYSQL

LIBNAME xxx MYSQL  ESCAPE_BACKSLASH=YES  DATABASE=testn SERVER="xx.xx.xx.xxx"  MYSQL_PORT=3306  USER=dwh  PASSWORD="test" ;

Thanks,

Shiva

Super User
Posts: 10,041

Re: MSSQL LIBNAME

What is your LOG message ?

First of all, you should success to connect to MySQL by MySQL's client program.

SAS actually use MySQL's client software to talk to MySQL.

Ksharp

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 648 views
  • 6 likes
  • 4 in conversation