TCP/IP Services File

Understanding the TCP/IP Services File

The TCP/IP services file contains information about available services on the machine, including the name, port number, protocol, and any aliases for each service. For the SAS 9.3 release of the drivers, you do not need to create entries in the TCP/IP services file as long as you define local servers with the double-underscore syntax. For example, a local server can be defined with the name __5001 to start a local SAS ODBC server on port 5001. A SAS/SHARE server can be defined with the name machine.__5010 to connect with a SAS/SHARE server running on port 5010 of a host that is named machine.
For releases of the SAS Drivers for ODBC before SAS 9.3, an entry in the TCP/IP services file is necessary to associate a SAS server (service name) with a port number and protocol used by that service. For the SAS 9.3 release of the drivers, creating an entry in the TCP/IP services file is necessary only if you prefer not to use the double-underscore syntax.
The location of the TCP/IP services file varies on different platforms. Common locations for the TCP/IP services file are the following:
Windows
C:\WINDOWS\SYSTEM32\DRIVERS\ETC\SERVICES
UNIX
/etc/services
Entries in the TCP/IP 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 TCP/IP services file on both the server and client machine 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 must define the SAS server with the same __port-number value, or the client machine can add an entry to the TCP/IP services file.

Editing the TCP/IP Services File

To configure your TCP/IP services file for use with the drivers, 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 dialog box.
The port number that you use should be an unused port number in the TCP/IP 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 can be up to eight characters. 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, in the ODBC Data Source Administrator dialog box, if you configured a local data source named local, and a remote SAS/SHARE server named machine.shr2, then you should add entries to the TCP/IP 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 network 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 he should have started the SAS/SHARE server.