Previous Page | Next Page

LIBNAME Statement: PC Files on Linux, UNIX, and 64-Bit Microsoft Windows

LIBNAME Statement for PC Files on Linux, UNIX, and 64-Bit Microsoft Windows

For PC files, the SAS/ACCESS LIBNAME statement extends the SAS global LIBNAME statement to support assigning a libref to Microsoft Excel, Microsoft Access, and ODBC data sources. This enables you to reference spreadsheets, databases, and ODBC sources directly in a DATA step or SAS procedure. You can also read from and write to a Microsoft Access, Microsoft Excel, or ODBC table directly. This section specifies the Syntax for PC Files on Linux, UNIX, and 64-Bit Microsoft Windows for this statement and provides Examples.


Sorting PC Files Data

Because PC data librefs refer to database and workbook objects such as tables, they are stored in a different format than SAS data sets. This is important to remember when you access and work with PC files data.

You can sort the observations in a SAS data set and write the output to another data set. In a Microsoft Access database, sorting data has no effect on how it is stored. Because your data might not be sorted, sort the data at the time of query.

When you sort PC files data, the results might vary. The spreadsheet or database can place data with NULL values first or last in the result set.

Note:   NULL values are translated in SAS to missing values  [cautionend]


Using SAS Functions with PC Files Data

Using librefs that refer to PC files data with SAS functions, might return a different value than the value returned when you use the functions with a SAS data set.

For example, the PATHNAME= function returns the pathname for the assigned libref. When the libref refers to PC files data, the function might return the Microsoft Excel filename assigned for the libref.

Use 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 must omit this argument. For full details about how to use SAS functions, see the SAS Language Reference: Dictionary.

Previous Page | Next Page | Top of Page