BookmarkSubscribeRSS Feed
Calcite | Level 5



I've SAS 9.4 in my personal windows PC and trying to connect to Postgres database (aws storage) to access tables/datasets in the database. I would like to perform some analysis in SAS with that data. I tried creating library with libname and have below message.


ERROR: The POSTGRES engine cannot be found.

ERROR: Error in the LIBNAME statement.


Also, I checked whether I have access to Postgres in SAS (PROC SETINIT; RUN;) and I see that I've access to Postgres, ODBC etc. And then I tried PROC PRODUCT_STATUS; RUN;  Here I don't see Postgres though. 


I found this in one of the community posts " It's possible that you have SAS/Access to Postgres licensed but it is not installed on the server". I think, I'm in same situation. Could someone suggest me how to install it?


I don't have any server though. Just trying to connect to database from simple PC SAS on a personal laptop. 




Meteorite | Level 14

From your question what I understand is that you have SAS installed on your Windows PC and PostgreSQL installed on a remote machine (AWS).
Under this scenario, you need to establish an odbc connection. One option is to use the Microsoft ODBC Data Source Administrator . You will need a PostgreSQL odbc driver installed.

On PC SAS this would be my preferred method.
If you want to use SAS Access Interface to PostgreSQL please see here

This later approach would be good for Server.

Calcite | Level 5

Thank you very much! I was able to establish connection using ODBC. Library is created and I see the data sets. But, data is not fetching. All datasets are showing zero observations. Any suggestions?

I've installed ODBC Data source administrator and CData ODBC driver for PostgreSQL. Any alternatives?

Super User
Did you try run a simple data step?

libname x odbc dsn=.............;
data have;
set x.PostgreSQL_table ;
SAS Employee

Looks like you are in a situation w here you have SAS/ACCESS Interface to PostgreSQL licensed but it is not installed. How to add products to an existing SAS 9.4 installation is documented here.

Meteorite | Level 14

Hello @hukesh 
Under your situation, i would try to install pgAdmin on the Desktop and try connecting to the PostgreSQL.
Then we can see if there is data in the database or not.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1 like
  • 4 in conversation