Database Reference
In-Depth Information
Output 3.1: Listing of the PROC IMPORT Code generated and the PROC DATASETS Listing.
1
2
3 PROC IMPORT
4 DATAFILE='c:\My_Files\Shoes.xls'
5 DBMS=EXCEL
6 OUT=shoes
7 REPLACE;
8 GETNAMES=NO;
9 DBDSOPTS='RENAME=(F1=Subsidiary F2=Stores F3=Sales F4=Inventory)';
10 RANGE=small_range;
11 RUN;
NOTE: WORK.SHOES data set was successfully created.
NOTE: The data set WORK.SHOES has 7 observations and 4 variables.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.17 seconds
cpu time 0.06 seconds
12 PROC DATASETS LIBRARY=work NOLIST;
NOTE: Writing HTML Body file: sashtml.htm
13 MODIFY shoes;
14 LABEL Subsidiary = "Subsidiary"
15 Stores = "Stores"
16 Sales = "Sales"
17 Inventory = "Inventory";
18 QUIT;
NOTE: MODIFY was successful for WORK.SHOES.DATA.
NOTE: PROCEDURE DATASETS used (Total process time):
real time 0.25 seconds
cpu time 0.15 seconds
Figure 3.3: The SAS Dataset Created by the Code Above.
Example 3.4 PROC IMPORT Using the DBMS=EXCELCS Option
This example is similar to Example 3.2, but the code was executed on a Windows 64-bit configuration. The 64-
bit operating system requires the use of the PC Files Server to execute any PROC IMPORT code where
DBMS=EXCELCS. The SAS code for Part 1 reads the full Excel worksheet. The difference in the code is the
use of the DBMS=EXCELCS option. Note that in most cases the “named-constants” are used as part of the
 
Search WWH ::




Custom Search