Convert Excel to SAS Dataset


/ Published in: SAS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. PROC IMPORT DATAFILE="C:\folder\project\file.xls"
  2. OUT=mydata
  3. DBMS=excel2002 REPLACE;
  4. SHEET="MySheetName";
  5. GETNAMES=yes; * variable names are in row 1 ;
  6. RANGE="MySheetName$A1:P2582"; * omit if you want to read the entire worksheet;
  7. MIXED=YES; * V. 9: converts numerical values mixed in with character data into a variable with all character values;
  8. SCANTEXT=yes; * V. 9 only;
  9. USEDATE=no; * V. 9 only - read with date format only (note date-time);
  10. SCANTIME=no; * V. 9 only;
  11. DBSASLABEL= none; * V. 9 only;
  12. RUN;

URL: http://jaredprins.squarespace.com/blog/2008/4/1/convert-excel-to-sas-dataset.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.