BookmarkSubscribeRSS Feed

How to configure SAS/ACCESS Interface to SAP HANA on SAS Viya?

Started ‎09-10-2019 by
Modified ‎09-10-2019 by
Views 5,484


How to configure SAS/ACCESS Interface to SAP HANA on SAS Viya?


The process itself is described in SAS® Viya® 3.4 Administration -> Linux Deployment Guide -> Configure SAS/ACCESS Interface to SAP HAN..., but here is how I went through that.


First of all, you have to download SAP HANA Client from the SAP Support Portal. After you install/unpack the client, you should have something like that:



The next step will be installing unixODBC. You have to install that package on all of your nodes, so in order to simplify the installation process, run a command shown below from your Ansible playbook directory:


ansible all -m yum -a "name=unixODBC state=present" --become


After that create /usr/lib64/hdb directory on your primary controller. And move SAP HANA client libraries to that folder:


sudo mkdir /usr/lib64/hdb
sudo cp -r /path/to/your/client/folder/* /usr/lib64/hdb/


Synchronize that directory with each CAS server node:


ansible "sas-casserver-worker" -m copy -a "src=/usr/lib64/hdb dest=/usr/lib64" --become


Please note requires, by default this library isn’t installed on RHEL:




Let’s install the package on all machines:


ansible all -m yum -a "name=libaio state=present" --become


At this step the installation process is over, now we need to configure unixODBC as well as SAS Studio and the CAS server.


1. Create /etc/odbc.ini and add these lines to a file. Do not forget to update both server name and port:


DRIVER = /usr/lib64/hdb/


2. For each host that is specified in the [programming] host group, edit these files:


sudo vi /opt/sas/viya/config/etc/workspaceserver/default/
sudo vi /opt/sas/viya/config/etc/sysconfig/compsrv/default/sas-compsrv


and add the following lines to them:


export ODBCINI=/etc/odbc.ini
export ODBCINST=/etc/odbcinst.ini
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/hdb


3. On the CAS controller, edit the cas_usermods.settings file:


sudo vi /opt/sas/viya/config/etc/cas/default/cas_usermods.settings


add the following lines:


export ODBCINI=/etc/odbc.ini
export ODBCINST=/etc/odbcinst.ini
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/hdb


cas_usermods.settings needs to be syncronized with all CAS server worker nodes:


ansible "sas-casserver-worker" -m copy -a "src=/opt/sas/viya/config/etc/cas/default/cas_usermods.settings dest=/opt/sas/viya/config/etc/cas/default" --become


4. Test your connection to the SAP HANA server from the command line:




5. If you were able to connect from the command line, you should be able to connect to the SAP HANA from SAS session:


libname hanalib SASIOHNA server='' port=30015 user=username password=yourpassword;


I hope this information will be useful to you. Let me know if you have any questions about that.


Hi Alexal,

just wondering how SAS get through into schema level, i mean when querying using proc sql or register table the generated query include the schema name.

for example : select * from schema.table, not just select * from table.


Thank you

Version history
Last update:
‎09-10-2019 11:53 AM
Updated by:



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags