| The LIBNAME Statement for PC Files on Microsoft Windows |
The SAS/ACCESS LIBNAME statement extends the SAS global LIBNAME statement to support assigning a libref to Microsoft Excel and Microsoft Access files. This enables you to reference spreadsheets and databases directly in a DATA step or SAS procedure, and to read from and write to a Microsoft Access or Excel object as if it were a SAS data set. This section specifies the syntax for this statement and provides examples.
| Sorting PC Files Data |
When you use the LIBNAME statement to associate a libref with PC files data, you might observe some behavior that differs from that of normal SAS librefs. Because these librefs refer to database and workbook objects, such as tables, they are stored in a format that differs from the format of normal SAS data sets. This is helpful to remember when you access and work with PC files 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 Microsoft Access database, sorting data has no effect on how it is stored. Because your data might not be sorted in the external file, you must sort the data at the time of query. Furthermore, when you sort PC files data, the results might vary depending on whether the external spreadsheet or database places data with NULL values (which are translated in SAS to missing values) at the beginning or the end of the result set.
| Using SAS Functions with PC Files Data |
When you use librefs that refer to PC files 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 Microsoft Excel filename assigned for the libref. For a normal SAS libref, it returns the pathname for the assigned 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 PC files data, you omit this argument. For full details about how to use SAS functions, see the SAS Language Reference: Dictionary.
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.