Hi Everyone,
Please can you suggest 4-5 ways of importing excel file into SAS 9.3
Note:
1. When i use proc import, SAS gives error related invalid dbms= option.
Please help.
Thanks
Note: - Use a valid dbms option? I.e. do you have SAS Access installed, are you using the correct dbms for you file type, here is the list of them:
http://support.sas.com/documentation/cdl/en/acpcref/63184/HTML/default/viewer.htm#a003102096.htm
That aside, I wouldn't recommend using:
a) Excel - this is not a good data transfer format. Use CSV, XML or any of the other proper structured data transfer formats
b) Proc import/export - these are guessing procedures. They guess what data you want to import. Use a proper data transfer format and write and explicit datastep import to import the data as you know it to be.
Options:
1) Datastep infile and inputs with CSV file. Most robust method.
2) libname xml
3) libname excel - limited to accessible data
4) proc import - guesswork
1) proc import
2) libname
3) ODBC
4) DDE <-- old school
5) filename + clipboard
Please can you provide the exact code for importing using datastep and importing using proc import.
I will definitely look into the list of dbms types from the link you provided.
If you have to do it use XLSX file format and DBMS=XLSX.
To just get the first sheet use:
proc import file='myfile.xlsx' out=MYSAS dbms=xlsx;
run;
my SAS shows, it is dbms= type is INVALID.
Upgrade.
Try changing to XLS and see if it works.
Other trick from the bad old days was to use
SHEET="'A B'$"
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.