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.

Configuring the Server Service

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

Specifying TCP/IP as the Communications Access Method

TCP/IP is the default communications access method in the UNIX 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.

Accessing a Secured Server

Requiring clients to supply a valid user ID and password when attempting to access a server enforces server security. The values for a user ID and a password are provided in the USER= and PASSWORD= options in the LIBNAME statement and the PROC OPERATE statement. For details about supplying a user ID and a password, see LIBNAME Statement in SAS/SHARE User's Guide and and The OPERATE Procedure in SAS/SHARE User's Guide in the SAS/SHARE User's Guide.
Example:
libname sasdata 'edc/prog2/sasdata' server=rmtnode.share user=_prompt_
;
The value _PROMPT_ requires the client to provide a user ID and password when a client attempts to access the server.

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. For example:
options netencrypt netencryptalgorithm=ssl;
options sslcalistloc="/users/johndoe/certificates/cacerts.pem";
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. The SSLCALISTLOC= option specifies the name of a file that contains a list of CA certificates that are to be trusted. 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 or the PROC OPERATE statement by using a two-level server name as follows:
SERVER=node.server
The access method evaluates the node name, in this order of priority:
  1. a SAS macro variable
  2. an environment variable
  3. a valid node name
node can be either of the following:
  • valid TCP/IP node name
  • IP address
For more information, see About TCP/IP Internet Protocol (IP) Addressing.
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 /etc/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.
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 causes a macro variable to be resolved by the SAS parser before syntactic evaluation of the SERVER= option.
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 more information 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 The OPERATE Procedure 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 UNIX client to access a server by using the TCP/IP access method. The LIBNAME statement specifies the getnameinfo() that is accessed through the server. The value _PROMPT_ in the USER= option specifies that the client must provide a valid user ID and password to access the server. The SERVER= option specifies the two-level server name RMTNODE.SHARE1.
options comamid=tcp;
libname sasdata 'edc/prog2/sasdata' user=_prompt_ server=rmtnode.share1;