I am trying to connect SAS EG to our new database through ODBC. I am using the following code:
libname odbc1 odbc noprompt= " driver={PostgreSQL Unicode(x64)};user=XXXX;
password=XXXXX ;database=D_GFC19_UA5;ds=PostgreSQL35W";
and getting the following error:
ERROR: CLI error trying to establish connection: connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection
refused (0x0000274D/10061) Is the server running on that host and accepting TCP/IP connections?connection to server at
"localhost" (::1), port 5432 failed: Connection refused (0x0000274D/10061) Is the server running on that host and accepting
TCP/IP connections?”
Is this the first time connecting to this server? Is SAS running on a server? What OS is SAS running on? If this is a first time connection then most likely firewall rules may need to be configured especially since you are getting connection refused messages. Talk to your SAS administrator as IT security will need to get involved.
Also if your SAS Compute server runs on Windows, then you can remote into it and create a test data source in the ODBC Administrator then use the Test Connection button. That way you are taking SAS out of the loop and can demonstrate that failures are purely a data connection problem.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.