Understanding Access to Local Data Sources

Starting a SAS ODBC Server

If there isn't a SAS ODBC server running on your PC when you access a SAS data source from your ODBC application, then the SAS ODBC Driver starts a SAS ODBC server. The driver uses the information that you provided in the Local Options dialog box to automatically start one for you.
To access local data sources, the SAS ODBC Driver uses TCP/IP to communicate with a SAS ODBC server. 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 for you to access your SAS data sources. For information about editing the TCP/IP services file, see TCP/IP Services File. For more information about SAS servers, see SAS Servers.
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 comamid=tcp;
proc odbcserv id=servername authenticate=optional;
run;
The value for server name must be the same server name you specified on the Servers page when you defined your local data source, as explained in Setting Up a Connection to Local Data.
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.
Note: When the SAS ODBC server is running in a SAS session, the SAS session does not accept user input from the keyboard.
If the SAS session cannot be started before the timeout value that you specified in the Local Options dialog box is reached, a timeout error is returned to your ODBC client application. An error message is returned to the client if the SAS session was started, but PROC ODBCSERV could not execute.

Stopping a SAS ODBC Server

When you are finished using your ODBC client application to access your local data sources, the SAS ODBC server continues to execute in case you want to access additional SAS data sources. To terminate the SAS ODBC server, do either of the following:
  • Open the Windows Task Manager. Under the Applications tab, select SAS from the list of tasks, and then click End Task. Alternatively, under the Processes tab, select SAS.EXE in the Image Name column, and then click End Process.
  • Bring the SAS session into focus (make it the active window), and then press CTRL+BREAK. The Task Manager appears. Select ODBCSERV from the list of tasks, and then click OK. Click OK again to halt the procedure.