LIBNAME Statement Options

To associate a SAS libref with a Microsoft Excel workbook, use one of the following LIBNAME statements.
LIBNAME <libref><XLSX> <“physical-path-and-filename.xlsx”> <SAS/ACCESS LIBNAME-options>;
LIBNAME <libref> <CLEAR> | <_ALL_>;
LIBNAME <libref> <LIST> | <_ALL_>;
Note: The XLSX engine accepts either single or double quotation marks for physical-path-and-filename.xlsx.

<libref>

is any SAS name that associates SAS with the SAS library where the Microsoft Excel spreadsheet is stored. The association between a libref and a SAS library lasts only for the duration of the SAS session or until you change the libref or discontinue it with another LIBNAME statement.

XLSX

is the SAS LIBNAME engine name for an XLSX file format. The LIBNAME statement associates a libref with an XLSX engine that supports connections to Microsoft Excel 2007, 2010, and later files.

This engine name XLSX is required. Otherwise, SAS/ACCESS assumes the use of the LIBNAME engine for Microsoft Excel for XLSX files.
Note: The XLSX engine enables you to read and write XLSX data directly across UNIX, Linux, and Windows operating environments. If you have stored XLSX files on UNIX or Linux, you do not need to use the SAS PC Files Server (or the PCFILES LIBNAME engine) to access the Excel (.xlsx) files. If you have SAS running on UNIX or Linux and your XLSX files reside remotely in the Windows operating environment, use the PCFILES LIBNAME engine to access them.
The XLSX engine enables you to replace an existing worksheet or to add a new worksheet, but it cannot be used to update the values in individual worksheets.
When importing (reading) XLSX data, the XLSX engine reads mixed data (that is, columns containing numeric and character values) and converts it to character data values.
The XLSX engine allows the sequential reading of data only. That is, it does not support random access. It does not support certain tasks that require random access, such as the RANK procedure, which requires the reading of rows in a random order.
Example This LIBNAME statement specifies Wsinv as a reference (that is, libref) to a SAS library. The XLSX engine specifies an engine that supports the connection to the file type .XLSX.
LIBNAME wsinv XLSX 'c:WestSectorQ1_Invoices.xlsx';

<“physical-path-and-filename.xlsx”>

is the physical-path and filename of a Microsoft Excel 2007 or later workbook. Using the extension (.xlsx) is required. Enclose the path and workbook name in quotation marks.

<SAS/ACCESS LIBNAME-options>

define how SAS interacts with the external data source (in this case, XLSX files), providing enhanced control of how SAS processes data source objects.

Because the XLSX LIBNAME engine works on any version of Microsoft Excel 2007 or later, it has no engine-specific LIBNAME options, such as VERSION=.

<CLEAR>

clears one libref.

Specify libref to disassociate a single libref.

<_ALL_>

specifies that the CLEAR or LIST argument applies to all librefs.

<LIST>

writes the attributes of one or more SAS/ACCESS libraries or SAS libraries to the SAS log.

Specify libref to list the attributes of a single SAS/ACCESS library or SAS library. Specify _ALL_ to list the attributes of all librefs in your current session.
Examples List the attributes of a single library:
LIBNAME LIBREF LIST;
List the attributes of all the libraries:
LIBNAME _ALL_ LIST;
Last updated: January 10, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.131.47