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,855

Question

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

Answer

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:

 

hdb_dir_list.png

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 libodbcHDB.so requires libaio.so.1, by default this library isn’t installed on RHEL:

 

libaio.png

 

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:

 

[SAPHANADSN]
DRIVER = /usr/lib64/hdb/libodbcHDB.so
SERVERNODE=server.example.com:30015

 

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

 

sudo vi /opt/sas/viya/config/etc/workspaceserver/default/workspaceserver_usermods.sh
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:

 

isql SAPHANADSN USERNAME PASSWORD -v

 

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='server.example.com' 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.

Comments

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:
Contributors

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!

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