BookmarkSubscribeRSS Feed
navinrraj
Calcite | Level 5

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

8 REPLIES 8
Kurt_Bremser
Super User

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.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;

 

navinrraj
Calcite | Level 5

proc import datafile="/home/naveence0/food2.xlsx"
out= indata
dbms=xlsx replace;
run;
proc print data = indata;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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

 

navinrraj
Calcite | Level 5
 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 proc import datafile='/home/naveence0/food3.csv'
72 out = datainput
73 dbms = excel
74 ;
ERROR: DBMS type EXCEL not valid for import.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
 
whic extension should i use excel sheet to sas on windows
system cpu time 0.00 seconds
memory 44.00k
OS Memory 26532.00k
Timestamp 08/10/2018 01:25:47 PM
Step Count 38 Switch Count 0
Page Faults 0
Page Reclaims 22
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
75 run;
 
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

navinrraj
Calcite | Level 5
So please tell me .
What the extension of excel file
How convert to sas
And dbms value

RW9
Diamond | Level 26 RW9
Diamond | Level 26

"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;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 2381 views
  • 0 likes
  • 3 in conversation