BookmarkSubscribeRSS Feed
hukesh
Calcite | Level 5

Hi,

 

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. 

 

Thanks,

Hukesh

6 REPLIES 6
Sajid01
Meteorite | Level 14

Hello
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 https://documentation.sas.com/doc/en/calcdc/3.4/dplyml0phy0dkr/n0zpnn9s53x8m9n1m22gfkf8f6eu.htm.

This later approach would be good for Server.

hukesh
Calcite | Level 5
Hi,

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?

Regards,
Hukesh
Ksharp
Super User
Did you try run a simple data step?

libname x odbc dsn=.............;
data have;
set x.PostgreSQL_table ;
run;
SimonDawson
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.

Sajid01
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 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

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