i try to run this file
this error was show up here *database missing
"proc import datafile="/home/naveence0/food2.xlsx"
out= indata
dbms=xlsx replace;
run;
proc print data = indata; ,,
please if tat code having nay changes please descriped that.
one main questions wat is file extension of xls file
When you need help with an ERROR, always post the whole log of the failing step.
Copy/paste the log into a window opened with the {i} button.
Why is the proc import statement in quotes?
"proc import datafile="/home/naveence0/food2.xlsx"
That is invalid. Run:
proc import datafile="/home/naveence0/food2.xlsx" out= indata dbms=xlsx replace; run;
proc import datafile="/home/naveence0/food2.xlsx"
out= indata
dbms=xlsx replace;
run;
proc print data = indata;
Yes, that is what I posted. Post your log, so we can see the error message and the code you run. Did you put the file in your shared directory?
https://communities.sas.com/t5/SAS-Analytics-U/Importing-Excel-file-to-SAS-Studio/m-p/216686#M2443
Well, you will see in the log you have given there, you have a CSV file -
'/home/naveence0/food3.csv'
And your telling SAS that its supposed to read that file using the Excel engine, hence you get an invalid DBMS error.
If the file is CSV, then your dbms should be csv. However I would recommend taking the code generated from proc import (when you change dbms=csv) and then using that to create a datastep import, fixing the formats and such like. When you run proc import, it will put the code it generates in the log.
"What the extension of excel file" - File extensions tell the operating system and other tools what the file is. It doesn't necessarily need to match the file type, however it really isn't very good if it doesn't. Excel has a few different file extensions, XLS is the old binary file format, XLSX is the new Open Office file format. CSV is not an Excel file format, it is plain text with data delimited by comma's, Excel can however read an parse this file type.
"How convert to sas" - this depends on several factors. What exactly is the file type you are trying to import, is it a CSV file?
"And dbms value" - DBMS value indicates to SAS what type of file you are trying to import. Again, I do not know what you have, is it a CSV file, is it an XLSX file?
If its a csv file then:
proc import datafile="/home/naveence0/food2.csv" out=indata dbms=csv replace; run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.