Chapter Contents

Previous

Next
SAS ODBC Driver User's Guide and Programmer's Reference

What Do I Need to Know about the SAS System?

To use the SAS ODBC driver, you need to understand three components of the SAS System:

You also need to understand the correspondence between ODBC terminology and SAS terminology. These topics are explained in the following sections.


SAS Data Sets

A SAS data set is a file that the SAS System can access as if it were a physical object containing the following:

The physical locations of the data values and the descriptor are not necessarily contiguous.

SAS data sets have two forms: data files and data views. SAS data files are essentially relational tables with columns (or variables) and rows (or observations). The SAS data file structure can have many of the characteristics of a database management system, including indexing, compression, and password protection.

SAS data views are definitions or descriptions of data that resides elsewhere. They enable you to use the SAS System to access many different data sources, including flat files, VSAM files, and DBMS structures, as well as native SAS data files. They also eliminate the need for users to know anything about the structure of the data or the software that was used to create it.

Because they contain no data, views take up very little storage. And because they collect the actual data values only when called, they always access the most current data from their defined sources.

Views can be used to define subsets of larger structures, or supersets of data that have been enhanced with calculated values. You can also create SAS data views that combine views of dissimilar data sources. For example, a view of a relational DB2 table can be combined with a view of a SAS data file, a view of hierarchical IMS-DL/I data, or even a view from a PC-based dBASE file.

You can create SAS data views in three ways:

You can also use SAS/ACCESS software to work directly with DBMS tables, such as DB2 and ORACLE, as if they were SAS data sets and views by using the SAS/ACCESS LIBNAME statement. See SAS/ACCESS Software for Relational Databases: Reference for more information about using SAS/ACCESS software.

There is some variation among these types of views, as described in the following table.

Types of SAS Data Views
Type of View Description
DATA step views can describe data from one or more sources, including flat files, VSAM files, and SAS data sets (either files or other views). Because a DATA step view only reads other files, you cannot use it to update the view's underlying data.

For more information about creating and using DATA step views see the chapter "SAS Data Views" in the SAS Language Reference: Concepts.

PROC SQL views can define either a subset or a superset of data from one or more SAS data sets. These data sets can be files or views, and can include data sets composed of DBMS data that are created with the SAS/ACCESS LIBNAME statement, and views that are created with the PROC SQL Pass-Through Facility to access DBMS data. In Version 7, you can also construct PROC SQL views of DBMS data by using an embedded LIBNAME statement.

For example, the SQL procedure can combine data from PROC SQL views, DATA step views, and SAS/ACCESS views with data in a SAS data file. You cannot use PROC SQL views to update the data in the view's underlying files or tables. However, with some restrictions, you can use the UPDATE, DELETE, and INSERT statements in the SQL procedure to update data that is described by SAS/ACCESS views.

For information about the PROC SQL Pass-Through Facility, see the chapter "The SQL Procedure" in SAS Procedures Guide, or the SAS/ACCESS Software for Relational Databases: Reference.

SAS/ACCESS views are created with the ACCESS procedure in SAS/ACCESS software. They are generally called view descriptors to distinguish them from PROC SQL or DATA step views. You can use them to describe data from any DBMS for which you license a SAS/ACCESS interface (see the list in What Kinds of Data Can I Access with the SAS ODBC Driver?). Each view descriptor describes all or some of the data in one DBMS table or in one DBMS view. When the SAS servers that are used by the SAS ODBC driver are involved, some SAS/ACCESS interfaces do not permit you to use a view descriptor to update the underlying DBMS data.

For more information about view descriptors, see the SAS/ACCESS Software for Relational Databases: Reference.



SAS Data Libraries

SAS data sets are contained in data libraries. Each SAS data library has two names: a physical name and a logical name (libref). The physical name of the library fully identifies the directory, filetype or minidisk, or host system data structure that contains the data sets. It must therefore conform to the rules for naming files within your host system.

You use the libref to identify a group of data sets (files or views) to the SAS System. The libref is a temporary name that you associate with the physical name of the SAS data library during each SAS job or session. After the libref is assigned, you can read, create, or update files in the data library. A libref is valid only for the current SAS job or session and can be referenced repeatedly within that job or session.

You can also use SAS/ACCESS software to associate a SAS libref with a DBMS database, schema, server, or group of tables and views, such as a DB2 database or group of ORACLE tables and views. See SAS/ACCESS Software for Relational Databases: Reference for more information about using SAS/ACCESS software.

For more information about SAS data libraries, see the chapter "SAS Data Libraries" in the SAS Language Reference: Concepts.


SAS Servers

To access your SAS data sources, the SAS ODBC driver uses a SAS server. A SAS server is a SAS procedure (either PROC SERVER or PROC ODBCSERV) that runs in its own SAS session; it accepts input and output requests from other SAS sessions and from the SAS ODBC driver on behalf of the ODBC-compliant application. While the server is running, the SAS session does not accept input from the keyboard.

Note:    Beginning with Version 7 of the SAS System, the SAS ODBC driver uses the TCP/IP protocol to communicate both with local servers and with remote SAS/SHARE servers. Configuration of DDE to communicate with servers is no longer available and is not supported with the Version 7 (and later) driver. Therefore, it is recommended that you reconfigure your driver settings to change any DDE (local or network) servers to TCP/IP servers, as described in Converting DDE Servers to TCP Servers.   [cautionend]

The type of server that the driver uses depends on whether you are accessing local data or remote data:
local data The driver uses a SAS ODBC server to access your data. If you do not already have a SAS session running on your PC, the driver starts a SAS session and executes PROC ODBCSERV, thereby automatically starting the server for you when you connect to your local data source. See Accessing Local SAS Data Sources for more information. If you have a SAS session (but not a SAS ODBC server) running on your PC, then you must either start the SAS ODBC server manually or end the SAS session before connecting to your SAS data sources.(footnote 1) See Starting a SAS ODBC Server for details.
remote data The driver uses a SAS/SHARE server. This requires that you license the SAS/SHARE *NET facility and SAS/SHARE software on the remote host. The driver also requires TCP/IP software included with Windows 95 and Windows NT in order to communicate with the server. Your server administrator uses PROC SERVER to start the server on your remote host. See Accessing Remote (SAS/SHARE) Data Sources for more information.


Converting DDE Servers to TCP Servers

If you still have SAS servers configured to use DDE, you must convert them to TCP servers to use them with this version of the SAS ODBC Driver.

To convert a DDE (or Network DDE) server to a TCP server, take the following steps:

  1. Install the new SAS ODBC Driver.

  2. From the SAS ODBC Driver Configuration dialog, select the Servers tab.

  3. Select the existing DDE server that you want to convert to TCP in the list of servers to the left.

  4. Click [Configure] and verify that the options are correct.

    Note:   If you are converting from a local DDE server, you will need to remove the -comamid dde option from the SAS Startup Parameters text box.   [cautionend]

    Click [OK].

  5. Click [Update] and then [OK] to store your changes.

Note:   For local TCP servers you will also have to verify that your TCP/IP Services file has an appropriate entry for the server you are configuring. For more information, see The TCP/IP Services File.  [cautionend]


SAS Terminology

Different software products often include similar components or constructs that are known by different names. For the ODBC standard and the SAS System, the following correspondences exist:
ODBC term SAS term
owner library name (libref)
table data set
qualifier not used

Therefore, if your ODBC-compliant application asks you to specify the owner for a SAS data library, you should specify the libref. If the application asks for a table name, supply the name of the SAS data set. If a qualifier is requested, you can generally leave the field blank.


FOOTNOTE 1:  except under Windows NT, which supports multiple concurrent SAS sessions. [arrow]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.