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.
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=;
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:
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.
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.
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=;
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
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
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.