Chapter Contents

Previous

Next
SAS/ACCESS Software for Relational Databases: Reference

Using Librefs that Refer to DBMS Data

When you use the SAS/ACCESS LIBNAME statement to associate a libref with relational DBMS data, you might observe some behavior that differs from that of normal SAS librefs. Because these librefs refer to DBMS objects, such as DBMS tables and views, they are stored in the format of your DBMS, which differs from the format of normal SAS data sets. This is helpful to remember when you access and work with DBMS data.

For example, you can sort the observations in a normal SAS data set and store the output to another data set. However, in a relational DBMS, sorting data often has no effect on how it is stored. Because you cannot depend on your data to be sorted in the DBMS, you must sort the data at the time of query, by using an ORDER BY clause in PROC SQL, a BY statement in the DATA step, the SAS/ACCESS data set option DBCONDITION= described in this chapter, or by another method. When you sort DBMS data, the results might also vary, depending on whether your DBMS places data with NULL values (which are translated in SAS to missing values) at the beginning or end of the result set.

When you use librefs that refer to DBMS data with SAS functions, some functions might return a value that differs from what is returned when you use the functions with normal SAS data sets. For example, the PATHNAME function might return a blank value. For a normal SAS libref, a blank value means that the libref is not valid. However, for a libref associated with a DBMS object, a blank value means only that there no pathname associated with the libref.

Usage of some functions might also vary. For example, the LIBNAME function can accept an optional SAS-data-library argument. When you use the LIBNAME function to assign or deassign a libref that refers to DBMS data, you omit this argument. For full details on how to use these functions, see the SAS Language Reference: Dictionary.


Chapter Contents

Previous

Next

Top of Page

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