تبليغاتX
stat - چگونه فایلهای اکسل را وارد SAS بکنیم ؟











 چگونه فایلهای اکسل را وارد SAS بکنیم ؟ سه شنبه یازدهم فروردین 1388 12:49

How to Import Excel files into SAS

Reading from Excel Spreadsheets:
Microsoft Excel spreadsheets can be read from SAS in several ways. Two of these will be demonstrated here. First, PROC IMPORT allows direct access to Excel files through SAS/Access to PC File Formats or access to Comma-Separated (CSV) files through Base SAS. The second method uses the Excel LIBNAME engine.

PROC IMPORT
The IMPORT procedure reads from external sources and creates a SAS data set. Two sources are Excel spreadsheets and CSV files. A particular SAS/Access product may be required for certain sources, however. In our example, SAS/Access to PC File Formats is required to read an Excel file, but a CSV file can be accessed with Base SAS.

General Syntax for PROC IMPORT:

PROC IMPORT
DATAFILE="filename" TABLE="tablename"
OUT=SAS-data-set <(SAS-data-set-options)>
;


For Excel you use the DATAFILE=”filename” option to specify the Excel file to be read. (The TABLE=”tablename” option would be applicable if you were reading from a database such as Microsoft Access.)

The OUT= option specifies the SAS data set to be created. The DBMS= option identifies the type of file to be read. In this case, you will use either EXCEL or CSV to read an Excel spreadsheet or CSV file, respectively. Finally, the REPLACE option determines whether to replace the data set that is created, if it already exists.

نوشته شده توسط mostafa | لينک ثابت | موضوع: |











کپي برداري از مطالب وبلاگ فقط با ذکر منبع مجاز ميباشد .

All Rights Reserved 2005-2006 © by stat84

Template Design by S T A T 84