Connect to SPD Server with a LIBNAME Statement

Minimum Connection Parameters

Here is an example of the minimum information needed to establish a server connection with the LIBNAME statement. It establishes a connection to Domain C from the server configuration depicted in Name Server, SPD Server Hosts, and Server Domains.
libname mydomain sasspds 'domainC' server=host2.5400 
user="mySPDuserid" password="secret"; 
Here is the other information in the request:
mydomain
a local library reference (libref).
the name of the server LIBNAME engine.
‘DomainC’
the server domain.
host2.5400
the server host name and the port number of the name server. 5400 is the default port number for the name server. The port number might be different in your installation. You can also use a port name instead of a port number, if one has been configured. When a port name is used, SPD Server determines the network address for the named service in the /etc/services file. The default port name is spdsname.
"mySPDuserID"
the server user ID given to you by the server administrator.
"secret"
the password associated with the server user ID.
The password that you specify must be valid for the form of authentication that your server is using. For example, if your server is using LDAP authentication, then you must specify your LDAP password. If your server is performing native authentication, you will be given an initial password by the administrator. You must change this password by using the CHGPASS= or NEWPASSWORD= LIBNAME option. For more information, see Changing Server Passwords. Your administrator will tell you the form of user ID authentication that is configured and the requirements.

Alternatives to the Basic Connection Statement

The example above shows one way to specify server connection parameters. There are other ways to specify the host name for the SAS session. Instead of using the SERVER= argument, use one of the following:
  • Use the HOST= and SERVICE= arguments as follows:
    libname mydomain sasspds 'domainC' host="host2.company.com" 
    service="5400" user="mySPDuserid" password="secret"; 
    HOST= enables you to use the IP address or network node name to identify the server host. (SERVER= requires that the node name be used.) SERVICE= specifies the name server port number or port name. For more information, see HOST= LIBNAME Statement Option.
  • Create a SAS macro variable named SPDSHOST or an environment variable named SPDSHOST to identify the host server. Whenever a LIBNAME statement does not specify a server host machine, the server looks for the value of SPDSHOST to identify the host server. Here is an example:
     %let spdshost=host2; 
    libname mydomain sasspds 'domainC' user="myuserID" password="secret";
Instead of specifying USER= and PASSWORD= to authenticate to the server, you can do one of the following:
  • Specify USER= and PROMPT=YES as follows:
    libname mydomain sasspds 'domainC' server=host2.5400
    user="mySPDuserid" prompt=yes; 
    The server will prompt you for a password. For more information, see PROMPT= LIBNAME Statement Option.
  • If your installation is using SAS Metadata Server authentication, use the AUTHDOMAIN= argument. AUTHDOMAIN= allows authentication to the server by specifying the name of an authentication domain metadata object. Here is an example:
    libname mydomain sasspds 'domainC' server=host2.5400 
    authdomain=spds; 
    The AUTHDOMAIN= value is defined by the SAS Metadata Server administrator.For more information, see AUTHDOMAIN= LIBNAME Statement Option. Your server administrator will tell you if metadata server authentication is required.

Understanding User Validation and Authorization

ACL Security

When ACL security is enabled, the server uses a user’s SPD Server user ID and ACLs to determine user access to the domain and domain resources. A domain owner has full access to all resources in his or her domain. For other users, the server grants access in the following order:
  1. Uses the ACL permissions that belong to the server user ID.
  2. Uses the ACL permissions that belong to the server user ID’s default ACL group.
A server user ID can have from 5 to 32 ACL user groups defined, depending on how the server is configured. By default, the connection is validated against the permissions defined for the first group in your group list. To connect with the authorizations of a different group from your group list, you can use the ACLGRP= LIBNAME option. ACLGRP= enables you to specify a different group name. Here is an example:
libname mydomain sasspds 'domainC' server=host2.5400 
user="mySPDuserid" password="secret" aclgrp='prod'; 
For more information, see ACLGRP= LIBNAME Statement Option.

Invoking Special Server Privilege

Server user IDs are registered in a password database. The password database supports privilege levels that confer special privileges. For example, users can be given a privilege to perform tasks like creating ACLs for other users. All connections from the SASSPDS engine are made as a regular user, regardless of the privileges defined in the database. To invoke special privilege in the SAS session, you must specify the ACLSPECIAL= LIBNAME option in the LIBNAME statement as follows:
libname mydomain sasspds 'domainC' server=host2.5400 
user="mySPDuserid" password="secret" aclspecial=yes; 
For more information, see ACLSPECIAL= LIBNAME Statement Option.

UNIX File Security Only

ACLs are optional. When only UNIX file security is used, all resources within a domain are granted access through the UNIX ID of the server process.

Invoking Implicit Pass-Through

The default connection reads data from the server and brings the data to the client for processing. To invoke SPD Server implicit pass-through for your SQL requests, specify the IP=YES LIBNAME option in the statement as follows:
libname mydomain sasspds 'domainC' server=host2.5400 
user="mySPDuserid" password="secret" ip=yes; 
If you plan to create server tables, also specify the DBIDIRECTEXEC= system option in the SAS session. IP=YES optimizes SELECT queries for the server. DBIDIRECTEXEC= optimizes CREATE TABLE operations as well.
option dbidirectexec=yes;
For more information about IP=YES, see IP=YES LIBNAME Statement Option. For more information about the DBIDIRECTEXEC= system option, see SAS/ACCESS for Relational Databases: Reference. SPD Server does not support the DIRECT_SQL= LIBNAME option or the SQLGENERATION= system option discussed in the SAS/ACCESS documentation.

Manage Network Traffic

If your server installation uses the same physical machine to run your server client process and your server host services, you can use the NETCOMP= and UNIXDOMAIN= options in the LIBNAME statement to improve client/server communication.
  • NETCOMP= compresses the data stream in an SPD Server network packet.
  • UNIXDOMAIN= uses UNIX domain sockets for data transfers between the client and SPD Server.
For more information, see NETCOMP= and UNIXDOMAIN= LIBNAME Statement Option.

Temporary Domains

SPD Server enables you to create temporary server domains that exist only for the duration of the LIBNAME assignment. A temporary server domain creates a temporary space similar to the SAS Work library. To create a temporary server domain, specify a real domain as usual and specify the TEMP=YES LIBNAME statement option as follows:
libname tmp sasspds 'domain' server=host2.5400 
user="mySPDuserid" password="secret" temp=yes; 
When you end your server session, all of the data objects, including tables, catalogs, and utility files in the TEMP=YES temporary domain are automatically deleted. For more information, see TEMP= LIBNAME Statement Option.

Using the SAS DS2 and FedSQL Languages with SPD Server

SPD Server 5.3 contains a driver that enables you to use two new SAS programming languages to read and write SPD Server tables: the SAS DS2 language and the SAS FedSQL language.
The SAS DS2 language is a SAS proprietary programming language that was introduced in SAS 9.4 that is appropriate for advanced data manipulation and applications. It also includes additional data types, ANSI SQL types, programming structure elements, and user-defined methods and packages.
The SAS FedSQL language is a SAS proprietary implementation of the ANSI SQL:1999 core standard that was introduced in SAS 9.4. It provides support for new data types and other ANSI 1999 core compliance features and proprietary extensions. FedSQL brings a scalable, threaded, high-performance way to access, manage, and share relational data in multiple data sources. FedSQL is a vendor-neutral SQL dialect that accesses data from various data sources without submitting queries in the SQL dialect that is specific to the data source. In addition, a single FedSQL query can target data in several data sources and return a single result table.
Access to the server with these languages is enabled by specifying the LIBGEN=YES option in the SPD Server LIBNAME statement. The LIBGEN=YES option configures the SPD Server connection to generate additional domain connections. When these connections are configured, you can submit DS2 language statements from your Base SAS session by using the DS2 procedure. You can submit FedSQL language statements by using FEDSQL procedure.
When using PROC DS2 and PROC FEDSQL to read and write SPD Server tables, there is no need to specify IP=YES to invoke SQL implicit pass-through. These procedures submit the DS2 and FedSQL language statements directly to SPD Server.
The following LIBNAME options are supported for use with PROC DS2 and PROC FEDSQL: ACLGRP=, ACLSPECIAL=, and TEMP=.
For more information about the server connection, see LIBGEN= LIBNAME Statement Option.For more information about the languages, see SAS 9.4 DS2 Language: Reference, Sixth Edition, and SAS 9.4 FedSQL Language: Reference, Fifth Edition. For more information about the DS2 and FEDSQL procedures, see SAS 9.4 Procedures Guide, Sixth Edition.

Other LIBNAME Options

For a complete list of LIBNAME options that are supported in a SASSPDS LIBNAME statement, see SPD Server LIBNAME Statement.
Last updated: February 8, 2017