This section describes the LIBNAME statement that SAS/ACCESS Interface to SAP HANA supports. For general information about this feature, see LIBNAME Statement for Relational Databases.
Here is the LIBNAME statement syntax for accessing SAP HANA.
For general information about the LIBNAME statement that is not specific to SAS/ACCESS, see LIBNAME Statement in SAS Global Statements: Reference.
specifies any SAS name that serves as an alias to associate SAS with a database, schema, server, or group of tables and views.
saphanaspecifies the SAS/ACCESS engine name for the SAP HANA interface.
provide connection information and control how SAS manages the timing and concurrence of the connection to the DBMS. When you use the LIBNAME statement, you can connect to the SAP HANA server in many different ways. Specify only one of these methods for each connection because they are mutually exclusive.
Here is how these options are defined.
specifies the server name or IP address of the SAP HANA server to which you want to connect. If the server name contains spaces or nonalphanumeric characters or if it is an IP address, you must enclose it in quotation marks. You can include the port when you specify a server. The port number is 3<instance-number>15 (for example, 30015 for the instance number 00). To support failover, you can specify a list of hostnames, separated by a semicolon. If a host is not available, the next host from the list is used.
Alias: HOST, SERVER, SERVERNODE
Example: SERVERNODE='saph1.mycompany.com'
specifies the port number that is used to connect to the specified SAP HANA server. The default is used if you do not specify a port or instance number or if you do not include the port number in the server specification. The port for the standard SQL communication for client access is 3<instance-number>15.
Restriction: Do not specify a value for both the PORT= and INSTANCE= options. If you specify a value for both PORT= and INSTANCE=, then the following error appears in the log:
ERROR: Invalid combination of connection errors. You cannot use the
PORT with the INSTANCE option.
Alias: PORT
Default: 30015
Example: server=’saph1.mycompany.com’
port=30215
specifies the instance number of the SAP HANA database engine. The port number is 3<instance-number>15 (for example, 30015 for the instance number 00). If you specify the port number explicitly in either PORT= or SERVER=, then INSTANCE= is ignored and a warning is written to the SAS log.
Restriction: Do not specify INSTANCE= if you also specify a port value for PORT= or SERVER=. If you specify a value for both PORT= and INSTANCE=, then the following error appears in the log:
ERROR: Invalid combination of connection errors. You cannot use the
PORT with the INSTANCE option.
Alias: INSTANCE
Example: server=’saph1.mycompany.com’
instance=02
specifies the SAP HANA user name (also called the user ID) that you use to connect to your database. If the user name contains spaces or nonalphanumeric characters, you must enclose it in quotation marks.
Alias: USER
Example: USER=HANAUSER1
specifies the password that is associated with your SAP HANA user name. If the password contains spaces or nonalphanumeric characters, you must enclose it in quotation marks.
Aliases: PASS, PASSWORD, PW, PWD
specifies the configured SAP HANA ODBC data source to which you want to connect. Use this option if you have existing SAP HANA ODBC data sources that are configured on your client. This method requires additional setup. You can perform setup either through the ODBC Administrator control panel on Windows platforms or through the odbc.ini file or a similarly named configuration file on UNIX platforms. It is recommended that you use this connection method only if you have existing, functioning data sources that have been specified.
Alias: DSN
Example: DSN=HANADSN1
Here is an example for an odbc.ini entry on UNIX:
[MYSAPHANA]
SERVERNODE=saph1.mycompany.com:30315
specifies connection options for your database. Separate multiple options with a semicolon. If you do not specify enough correct connection options, an error is returned. No dialog box is displayed to help you complete the connection string. Connection options are appended to the connection string that is used to connect to the SAP HANA database. You can use this option to specify special options by adding key-value pairs to the connection string.
specifies connection options for your database. Separate multiple options with a semicolon. When connection succeeds, the complete connection string is returned in the SYSDBMSG macro variable. PROMPT= does not immediately try to connect to the DBMS. A dialog box is displayed in SAS windowing environment instead that contains the values that you entered in the PROMPT= connection string. You can edit values or enter additional values in any field before you connect to the database.
Restriction: This option is not available on UNIX platforms.
specifies the ODBC driver to use to connect to your database.
specifies how communication is encrypted.
Alias: ENCRYPT
Default: NO
specifies the cryptographic library provider to use for SSL connectivity.
Alias: SSLCRYPTOPROVIDER, SSLPROVIDER
specifies the path to the keystore file.
Alias: SSLKEYSTORE
ODBC driver default: $HOME/.ssl/key.pem
specifies the path to the truststore file.
Alias: SSLTRUSTSTORE
ODBC driver default: $HOME/.ssl/trust.pem
indicates whether to validate the certificate of the communication partner.
Alias: SSLVALIDATECERTIFICATE
ODBC driver default: NO
specifies the host-name certificate of the keystore.
Alias: SSLHOSTNAMEINCERT, SSLHOSTNAMEINCERTIFICATE
specifies whether to create a self-signed certificate if the keystore cannot be found.
Alias: SSLCREATECERT, SSLCREATESELFSIGNEDCERTIFICATE
specify how SAS processes DBMS objects. Some LIBNAME options can enhance performance, and others determine locking or naming behavior. The following table describes the LIBNAME options for SAS/ACCESS Interface to SAP HANA with the applicable default values. This table also identifies LIBNAME options that are valid in the CONNECT statement in the SQL procedure. For details, see LIBNAME Options for Relational Databases.
|
Option |
Default Value |
Valid in CONNECT |
|---|---|---|
|
none |
|
|
|
none |
|
|
|
NO |
● |
|
|
NO |
|
|
|
SHAREDREAD |
● |
|
|
none |
● |
|
|
none |
● |
|
|
3 |
● |
|
|
1000 (when inserting rows), 0 (when updating rows) |
|
|
|
none |
● |
|
|
none |
● |
|
|
none |
|
|
|
DBMS |
● |
|
|
NO |
|
|
|
none |
|
|
|
none |
|
|
|
1024 |
● |
|
|
NO |
|
|
|
YES |
|
|
|
YES |
|
|
|
NO |
● |
|
|
COMPAT |
|
|
|
1 |
● |
|
|
THREADED_APPS,2 or THREADED_APPS,3 |
|
|
|
NO |
● |
|
|
NO |
|
|
|
none |
|
|
|
YES |
|
|
|
NO |
|
|
|
1 |
|
|
|
0 |
● |
|
|
NONE |
|
|
|
none |
|
|
|
none |
|
|
|
NO (see Naming Conventions for SAP HANA) |
|
|
|
NO (see Naming Conventions for SAP HANA) |
|
|
|
0 |
● |
|
|
none |
|
|
|
ROW |
● |
|
|
0 |
● |
|
|
NO |
● |
|
|
none |
|
|
|
YES |
|
|
|
none |
|
|
|
none |
|
|
|
none |
|
|
|
NO |
● |
|
|
none |
||
|
none |
|
|
|
NO |
● |
|
|
none |
● |
|
|
ROW |
● |
|
|
NO |
|
|
|
NO |
|
|
|
NO |
|
In this example, SERVER=, DATABASE=, USER=, and PASSWORD= are connection options. No DSN style is specified. This is the default method, which is recommended.
libname A1 saphana server=mysrv1
port=30015 user=myusr1 password='mypwd1';
This example requires that you specify a DSN style.
libname B1 saphana dsn=hnatest user=myusr1 password=mypwd1;
Here is an example of the LIBNAME statement using the PARMSTRING= option:
libname a saphana user=userid password=xxxx server=server-name
instance=02 preserve_tab_names=yes parmstring="parm_price=30"
preserve_col_names=yes;