SAS/SHARE Client Tasks

Task List

  1. Configure the server service.
  2. Specify TCP/IP as the communications access method.
  3. Access a secured server.
  4. Specify encryption of client/server data transfers (optional).
  5. Specify the server name.

Configuring the Server Service

Each server must be defined as a service in the SERVICES file on each machine that a client will access the server from. The SERVICES file is usually located in the directory where the TCP/IP software is installed. For details about editing the SERVICES file, see Configuring the SERVICES File.

Specifying TCP/IP as the Communications Access Method

TCP/IP is the default communications access method that is used in the Windows operating environment. You can omit specifying the access method in the COMAMID= option and the TCP/IP access method is assumed, by default.
If you choose to specify TCP/IP to connect to a server, you can use the COMAMID= option in an OPTIONS statement.
options comamid=tcp;
The COMAMID= option specifies the communications access method. TCP specifies the TCP/IP access method.
Alternatively, you can specify the COMAMID= option in a configuration file or in a SAS start-up command.

Encrypting Data in Client/Server Transfers

If an encryption service is configured at the client, you can specify SAS options to encrypt data that a client transfers to a server. Here is an example:
options netencrypt netencryptalgorithm=ssl;
The NETENCRYPT option specifies that all data transfers between a client and a server will be encrypted. SSL is the encryption service that is specified in the NETENCRYPTALGORITHM= option. For details about encryption, see Encryption in SAS, located in the Base SAS Help and Documentation.

Specifying the Server

If the client and server sessions are running on different network nodes, you must include the TCP/IP node in the server ID in the LIBNAME and PROC OPERATE statements by using a two-level server name as follows:
SERVER=node.server
The access method evaluates the node name in this order of precedence:
  1. SAS macro variable
  2. environment variable
  3. acceptable node name
node is specified as the fully qualified domain name (FQDN). Here is an example:
mktserver.acme.com
If the server and the client sessions are running on the same node, you can omit the node name.
server can be either of the following:
  • server-ID
  • port
The server-ID must be identical to the service name that is specified in the SERVICES file. For details, see Configuring the SERVICES File.
Example 1:
A port is the unique number that is associated with the service that is used for passing data to and receiving data from the server.
Precede the port number with two consecutive underscores.
Note: Do not space after the first underscore or the second underscore.
Note: Specifying a server by using a port number is not supported for ODBC clients.
libname mylib '.' server=srvnode._ _5000;
Example 2:
If the TCP/IP node name is not a valid eight-character SAS name, assign the name of the server node to a SAS macro variable, and then use the name of that macro variable for node in the two-level server name.
%let srvnode=mktserver.acme.com;
libname sales server=srvnode.server1;
Note: Do not use an ampersand (&) in a two-level name. An ampersand would cause the macro variable to be resolved by the SAS parser before syntactic evaluation of the SERVER= option. The access method evaluates the node name in a two-level server name.
Example 3:
You might assign the node name and the server ID to a macro variable.
%let srvnode=mktserver.acme.com 5000;
libname sales server=srvnode;
For details about creating valid SAS names, see Rules for Words and Names in the SAS Language in SAS Language Reference: Concepts. For details about LIBNAME and PROC OPERATE, see LIBNAME Statement in SAS/SHARE User's Guide and The OPERATE Procedure in SAS/SHARE User's Guide.

SAS/SHARE Client Example

The following example shows the statements that are specified at a Windows client that accesses a server by using a different user context. The LIBNAME statement specifies the SAS library that is accessed through the server, which is specified by the two-level server name RMTNODE.SHARE1.
options comamid=tcp;
libname sasdata 'c:edc\prog2\sasdata' server=rmtnode.share1;