SAS ODBC Driver User's Guide and Programmer's Reference |
The information in this section may be important to
some users. You should skim through this section to determine whether any
of this information is relevant to you.
|
Using Data Sets That Have One-Level Names |
If you use an ODBC application such as Microsoft Access that
exports databases using one-level names, you should use the ODBC administrator
to define a USER library. The SAS System normally places any data set that
has a one-level name into the WORK library, which is deleted at the end of
the SAS session. But if a USER library has been defined, SAS places all one-level
name data sets into the USER library, which is saved at the end of the SAS
session. In a multi-user environment, multiple client connections to a SAS
System server can each have their own USER library defined.
Some Microsoft products that are based on the JET
engine (such
as Microsoft Access) have certain requirements in order to be able to update
database tables. This may be true of other ODBC applications as well. These
requirements may make it necessary for you to specify two SQL options when
you define your SAS data sources.
- The attached table must have a unique primary
key that is not a floating-point value. You can use the Data Source SQL Option
Infer INTEGER from FORMAT
to indicate that SAS numeric fields without
fractional parts (for example, FORMAT(n,0) where n
is less than 12) are actually integer values that can be used to index the
table.
- All of the values in a row may be used to uniquely
select the row for updating. This can be a problem in rows that contain floating-point
fields (SAS numerics). Insignificant differences in values can be caused
either by differences in floating-point representation on different machines
or by conversion between character and binary formats. By specifying the Data
Source SQL Option
Fuzz Numbers at 12 places
, you can cause WHERE clauses
to select values that are "acceptably close" rather than requiring exact comparisons.
See
Naming Your Data Source and Specifying SQL Options
and User-Specified SQL Options
for more information about these SQL options.
|
Using SQL Statements to Access SAS Data Sources |
All ODBC-compliant applications use a variety of the Structured
Query Language (SQL) to access and manipulate data. However, most of these
applications transform user actions into SQL statements so that users themselves
do not need to know anything about SQL.
If your application requires you to use SQL statements,
or if you use SQL out of personal preference, then you should refer to the
chapter "The SQL Procedure" in the SAS Procedures Guide. The elements of SQL grammar that are supported by the SAS ODBC driver
are the same as those described in that book.
|
Accessing the SAS Libraries MAPS, SASUSER, and SASHELP |
By default, every SAS
session
(including SAS server sessions) provides access to the SAS libraries MAPS,
SASUSER, and SASHELP. However, because these libraries contain sample data
sets and other files that are generally not of interest to ODBC users, the
SAS ODBC driver does not report the contents of these libraries when it invokes
a SAS ODBC server. (From a programming standpoint, when SQLTables, SQLStatistics,
or SQLColumns is called, the result set that is returned does not include
rows for the SAS libraries MAPS, SASUSER, or SASHELP.) If you want information
from these libraries, you can do either of the following:
- Use a LIBNAME statement to define the desired
SAS library to the server.
- Use the SAS ODBC Driver Configuration dialogs
to define the desired library to your ODBC applications.
In both cases you must use a different name (that is,
not MAPS, SASUSER, or SASHELP) as your libref or library name.
|
Return Codes and Associated Messages |
The SAS ODBC driver uses standard ODBC return codes to notify
you of any errors and to provide additional information or warnings. The
associated message texts may be generated by the driver itself, by the SAS
server, or by your communications access method. See the Microsoft
ODBC 2.0 Programmer's Reference and SDK Guide and the Appendix in this
book for explanations of these return codes and their associated texts.
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.