I've got an example:
LIBNAME ADPT ODBC DSN='PSQLETSCDSAG01' SCHEMA=HMLN_MIS;
LIBNAME ADPT ODBC DSN='PSQLETSCDSAG01' SCHEMA=DBO;
ERROR: CLI error trying to establish connection: [DataDirect][ODBC lib] Data source name not found and no default driver specified
Looks like the connection to SQL server has not been set.
Your SAS administrator should be able to help.
Did you set up a DSN connection on your server/computer?
https://documentation.sas.com/doc/en/bicdc/9.4/bidsag/p1t9q2knb9tq5ln101dkrdsa9ymf.htm
LIBNAME is the second step in this process.
What OS does your SAS server run on? If you want to specify everything in the database connection string try something like this:
libname SQLSRVR odbc noprompt = "server=SQLServerName;DRIVER=SQL Server Native Client 11.0;Trusted Connection=yes" DATABASE = MyDatabase schema = dbo;
You will need to know the SQL Server server name, the ODBC driver name, the database and schema. Check with your SAS administrator who should know all the details. If you specify the DSN option then that has to be defined separately and how you do that depends on the SAS server OS.
Looks like the connection to SQL server has not been set.
Your SAS administrator should be able to help.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.