TCP/IP Services File

Understanding the TCP/IP Services File

The TCP/IP services file contains information about the names of the available services on the machine, and the port number, protocol, and any aliases corresponding to each service. For the SAS ODBC Driver, each entry in this file associates a SAS server (service name) with the port number and protocol used by that service. The location of the services file varies on different platforms. To configure the SAS ODBC Driver correctly, you must locate the services file for your platform. Common locations for the services file are the following:
Windows
C:\WINDOWS\SYSTEM32\DRIVERS\ETC\SERVICES
UNIX
/etc/services
Entries in the services file have the following general form:
<official service name> <port number/protocol name> <aliases> # <comments>
Note: For a connection to a SAS/SHARE server, you must update the services file on both the server and client machines if the two-part name uses a service name, such as machine.shr2. If the SAS/SHARE administrator starts the SAS/SHARE server with the SERVER=__port-number syntax, then only the client machine requires an entry in the services file.

Editing the TCP/IP Services File

To configure your services file for use with the SAS ODBC Driver, you must add an entry to the services file for each SAS server (either local or remote) that you have configured using the ODBC Data Source Administrator.
The port number that you use should be an unused port number in this services file (for larger networks, contact your network administrator to obtain an available port number). The port number must be greater than 1024, because any port number equal to or less than 1024 is reserved. The protocol must always be TCP. The server name must be from one to eight characters long. The first character must be a letter or an underscore. Subsequent characters can be letters, numeric digits, underscores, the dollar ($) sign, or the at (@) sign.
For example, if in the ODBC Data Source Administrator you configured a local data source named local and a remote SAS/SHARE server named machine.shr2, you would add entries to the services file similar to the following entries (substituting the appropriate port numbers):
local   6000/tcp    # service name for local access to SAS data
shr2    5010/tcp    # service name for SAS/SHARE server
Note: In the case of shr2, the administrator of the remote system named machine should have already edited the services file on the remote system to include the same shr2 entry and should have started the SAS/SHARE server.