Connect SAS to PostgreSQL:
http://help.nceas.ucsb.edu/Connect_SAS_to_PostgreSQL
SAS to PostgreSQL with ODBC
http://support.sas.com/kb/13/848.html
Using SAS/ACCESS Interface to ODBC may require slightly different
configurations depending on the data source you are accessing. Each
data source vendor may require different environment variable settings
than others.
Although, we try to document what is necessary to configure an ODBC
environment, there may be some settings that may be required in one
environment that is not with another. Therefore, you should always
contact the vendor of your data soruce to be sure you understand their
requirements as far as environment settings, ODBC.INI entries, etc.
Here at SAS we were able to access Postgres using SAS/ACCESS Interface
to ODBC using unixODBC 2.2.8, downloaded and built PostgreSQL 7.4.3 and
the 07.03.0200 version of .psqlodbc for our tests. All tests went fine.
Below are copies of our odbc.ini and odbcinst.ini files for reference.
odbc.ini:
[ODBC Data Sources]
test=PostgreSQL
[test]
Driver=/users/dbitest/psqlodbc/lib/psqlodbc.so
DSN=test
Trace=0
Debug=0
TraceFile=/users/dbitest/debug_build/sql.log
DebugFile=/users/dbitest/debug_build/debug.log
Database=test
Servername=localhost
Username=dbitest
Password=dbigrp1
Port=5432
Servertype=postgres
Readonly=no
CommLog=1
odbcinst.ini:
[ODBC Drivers]
PostgreSQL=Installed
[PostgreSQL]
Description=PostgreSQL driver included with PostgreSQL
Driver=/users/dbitest/psqlodbc/lib/psqlodbc.so
Setup=/users/dbitest/psqlodbc/lib/psqlodbc.so
FileUsage=1
Below is a sample of the code used to test the connect to access
Postgres
using SAS/ACCESS Interafce to ODBC.
proc sql;
connect to odbc (dsn=test);
select * from connection to odbc
(select * from test_table);
disconnect from odbc;
quit;
Here is a link that will also provide additional tips and guidelines if
further assistance is needed.
http://support.sas.com/techsup/technote/ts685.pdf
Operating System and Release Information
Product Family Product System SAS Release
Reported Fixed*
SAS System SAS/ACCESS Interface to ODBC 64-bit Enabled AIX 9.1 TS1M0
64-bit Enabled HP-UX 9.1 TS1M0
64-bit Enabled Solaris 9.1 TS1M0
Tru64 UNIX 9.1 TS1M0