Valid in: | Anywhere |
EXCEL | for Microsoft Excel 5, 95, 97, 2000, 2002, 2003, 2007, and 2010. |
ACCESS | for Microsoft Access 97, 2000, 2002, 2003, 2007, and 2010. |
LIBNAME libref ACCESS PATH='C:\PCFData\Demo.accdb';or
LIBNAME libref 'C:\PCFData\Demo.accdb';
This LIBNAME statement specifies xdb as a reference to a SAS library. The EXCEL engine specifies the engine that supports the connection to the file type .XLSX.
LIBNAME xdb EXCEL PATH='C:\PCFData\Demo.xlsx';
LIBNAME xdb 'C:\PCFData\Demo.xlsx';
LIBNAME adb 'C:\PCFData\Demo.accdb';
LIBNAME LIBREF LIST;
List the attributes of all the libraries.
LIBNAME _ALL_ LIST;
%PUT %SUPERQ (SYSDBMSG);
UDL='C:\WinNT\profiles\me\desktop\MyDBLink.UDL'; %PUT %SUPERQ(SYSDBMSG);
This option does not support SAS filerefs. The SYSDBMSG macro variable is set on successful completion. For more information, refer to Microsoft documentation about using data link.
The following options are for Access LIBNAME statements only.
You do not need to specify this option for an existing Excel file.
MyPCLib.Employees_Q2When you specify MyPCLib.Employees_Q2 in a DATA step or procedure, you dynamically access the external data object. SAS supports reading, updating, creating, and deleting external data objects dynamically.
LIBNAME mymdb 'c:\demo.mdb';
PROC SQL; SELECT idnum, lname FROM mymdb.staff WHERE state='NY' ORDER BY lname; QUIT;
DATA newds; SET mymdb.staff(KEEP=idnum lname fname); RUN;