Database Reference
In-Depth Information
Example 4.3 Using the Engine Connection PATH Option
This example shows a simple application of the PATH= option. The SAS code shown also uses the SAS
Excel engine.
NOTE: Starting with SAS 9.2 TS Level 2M3, varying levels of support for reading the newer versions of
Excel have become available with each new release of SAS. Of course, the issues of hardware, software,
and bit configurations may affect each computer differently.
LIBNAME xls_data EXCEL path='C:\My_excel_files\my_excel_file.xls' ;
DATA xls_data.'sheet1'n;
Set sashelp.shoes;
Run;
LIBNAME xls_data EXCEL path='C:\My_excel_files\my_excel_file.xlsb' ;
DATA xls_data.'sheet1'n;
Set sashelp.shoes;
Run;
Example 4.4 Using the Engine Connection VERSION Option
The following example outputs three files, and each file will be written in a different Excel format. This
example shows how the VERSION= option is used to write the output files. These examples run on 32-bit
SAS 9.2 on a 32-bit operating system and 32-bit SAS 9.3 on a 32-bit operating system. The SAS code
shown also uses the SAS Excel engine.
NOTE: Starting with SAS 9.2 TS Level 2M3, varying levels of support for reading the newer versions of
Excel have become available with each new release of SAS. Of course, the issues of hardware, software,
and bit configurations may impact each computer differently. Workbooks with the Excel extension *.xlsm
may not be valid for this type of processing.
LIBNAME xls_V95 EXCEL 'C:\My_excel_files\my_excel_file_V95.xls'
version=95;
LIBNAME xls_V97 EXCEL 'C:\My_excel_files\my_excel_file_V97.xls' version=97;
LIBNAME xls_V07 EXCEL 'C:\My_excel_files\my_excel_file_V07.xlsb'
version=2007;
DATA xls_V95.'shoes'n
xls_V97.'shoes'n
xls_V07.'shoes'n;
Set sashelp.shoes;
Run;
36 LIBNAME xls_V95 EXCEL 'C:\My_excel_files\my_excel_file_V95.xls'
version=95;
NOTE: Libref XLS_V95 was successfully assigned as follows:
Engine: EXCEL
Physical Name: C:\My_excel_files\my_excel_file_V95.xls
37 LIBNAME xls_V97 EXCEL 'C:\My_excel_files\my_excel_file_V97.xls'
version=97;
NOTE: Libref XLS_V97 was successfully assigned as follows:
Engine: EXCEL
Physical Name: C:\My_excel_files\my_excel_file_V97.xls
38 LIBNAME xls_V07 EXCEL 'C:\My_excel_files\my_excel_file_V07.xlsb'
version=2007;
NOTE: Libref XLS_V07 was successfully assigned as follows:
Engine: EXCEL
Physical Name: C:\My_excel_files\my_excel_file_V07.xlsb
39 DATA xls_V95.'shoes'n
40 xls_V97.'shoes'n
41 xls_V07.'shoes'n;
 
Search WWH ::




Custom Search