Chapter Contents |
Previous |
Next |
SAS ODBC Driver User's Guide and Programmer's Reference |
Accessing Local SAS Data Sources |
To access local SAS data sources, the SAS ODBC driver uses a SAS ODBC server in conjunction with TCP/IP. You must edit your TCP/IP Services file to define your servers before starting the SAS ODBC Server. It is not necessary for the server to be running when you define your data sources. However, the server must be running on your PC in order for you to access your SAS data sources. For information about editing the TCP/IP Services file, see The TCP/IP Services File. For more information about SAS servers, see SAS Servers.
If there isn't already a SAS ODBC server running on your PC, the SAS ODBC driver uses the information that you supplied in the Local Options dialog (described in Local Options Dialog) to automatically start one for you. That is, you do not need to take any action to start the server.
If you already have a SAS session running on your PC, then you can start the SAS ODBC server in that session by submitting the following statements:
options com amid=tcp; proc odbcserv id=server-name authenticate=optional; run;
The server-name must be the same as the name you specified in the Servers page when you defined your local data source, as explained in Defining Servers.
Alternatively, you can terminate your SAS session so that the SAS ODBC driver can start a SAS ODBC server for you in a new SAS session.(footnote 1)
Note: When the server is running in the SAS
session, the SAS session does not accept user input from the keyboard.
If the SAS session cannot be started before the
SAS Timeout
value that you specified in the Local Options dialog is
reached, a timeout error is returned to your ODBC client application. An
error message is also returned to the client if the SAS session was started
but PROC ODBCSERV could not execute.
SAS
from the list of tasks, and then select [End Task].
ODBCSERV
from the list of tasks and click [OK]. Click [OK] again to halt the procedure.
Accessing Remote (SAS/SHARE) Data Sources |
To access remote data sources, the SAS ODBC driver uses a SAS/SHARE server. (See SAS Servers for more information. See SAS/SHARE User's Guide for complete information about SAS/SHARE .) It is not necessary for the server to be running when you define your data sources. However, the server must be running on your remote host in order for you to access your data sources.
Because a SAS/SHARE server is used by multiple users, it is usually invoked on the remote host at system startup time. Therefore, end users generally do not need to take any local action to invoke the server.
Whoever is responsible for starting the SAS/SHARE server (you or your server administrator) must do the following:
COMAMID=TCP
in an OPTIONS
statement when you invoke PROC SERVER, as in the following example:
options comamid=tcp; proc server id=server-name authenticate=optional; run;
The TCP/IP Services File |
Windows 95 | C:\WINDOWS\SERVICES |
Windows NT | C:\WINNT\SYSTEM32\DRIVERS\ETC\SERVICES |
Unix | /etc/services |
Entries in the services file take the following general form:
<official service name> <port number/protocol name> <aliases> # <comments>
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 Administrator.
The port number that you use should be an unused port
number in this file (for larger networks, contact your network administrator
to obtain an available port number). The port number must be above 1024,
as any port number equal to or less than 1024 is reserved. The protocol must
always be
tcp
. The server name must be one to eight characters
long, and it is generally case-sensitive. The first character must be a letter
or an underscore; the remaining seven characters can include letters, digits,
underscores, the dollar ($) sign, or the at (@) sign. You specify the same
server name in the Servers page when you define your data source as explained
in Defining Servers.
For example, if, in the ODBC Administrator, you have
configured a local ODBC server named
shr1
and a remote SAS/SHARE server
named
machine.shr2
you would add entries to the Services
file similar to the following (substituting the appropriate port numbers):
shr1 5010/tcp #Local ODBC Server shr2 5011/tcp #Remote 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 that system to include the same
shr2
entry and should have started the SAS/SHARE server.
FOOTNOTE 2: Refer to the documentation for your TCP/IP software to find the path name for the Services file.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.