BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Gorzyne
Calcite | Level 5

Hi all

 

I have this first piece of code that works fine

 

 

proc import datafile="~/NAS/A/myfolder/myfile.csv"
   out=work.myfile
   dbms=csv
   replace;
   delimiter=";";
   getnames=no;
run;

 

 

and a roughly similar piec of code, just trying to import a xlsx instead of csv, in the same folder

 

 

proc import datafile="~/NAS/A/myfolder/anotherfile.xlsx"
   out=work.myfile
   dbms=xlsx
   replace;
   getnames=yes;
run;

 

 

 

that tells me stuff like

 

 

 

712       libname _XLSXIMP xlsx "/home/SXXXXXX/NAS/A/Myfolder
712     ! /anotherfile.xlsx
ERROR: Could not load excel spreadsheet "/home/SXXXXXX/NAS/A/Myfolder/anotherfile.xlsx": No such file o
       directory.
713       header=YES
714       ;
715       data work.anotherfile;
716       set _XLSXIMP.'_firstsheet_'n;
              ^
ERROR: Library "_XLSXIMP" is not known
717       ;
718       run;

NOTE: DATA step was not executed because of errors detected
NOTE: The data step took :
      real time : 0.000
      cpu time  : 0.001


719       libname _XLSXIMP clear;
WARNING: The library "_XLSXIMP" is not defined, so cannot be cleared
720       quit; run;
721       ODS _ALL_ CLOSE;

 

Anyhow I can stick with csv if I'm stuck but I thought you guys might get me out of that one

 

 

Best regards,

Gorz

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26
No such file or directory.

I am not sure what else we can say on the matter, it is telling you there is not file named that, in the location you have provided.  Only oyu have access to your systems to confirm this.

 

In terms of data import, CSV is far and away the better medium, being portable across systems, plain text, so readable without proprietary software etc.  I would hihgly recommend to use CSV, or XML/Json/Html or one of those types.  I would also highly recommend to avoid using proc import - this is a guessing procedure, which will guess what it thinks your data should look like.  As you are the best person to know what your data should look like (and of course you will have an import agreement stating formats/lengths etc. wont you), you should input this information into a datastep (you can take the one generated by the proc import from the log and use that as a basis).  That way every import of the data will conform to the same structure (or fail) and will be clean and repeatable.  

View solution in original post

1 REPLY 1
RW9
Diamond | Level 26 RW9
Diamond | Level 26
No such file or directory.

I am not sure what else we can say on the matter, it is telling you there is not file named that, in the location you have provided.  Only oyu have access to your systems to confirm this.

 

In terms of data import, CSV is far and away the better medium, being portable across systems, plain text, so readable without proprietary software etc.  I would hihgly recommend to use CSV, or XML/Json/Html or one of those types.  I would also highly recommend to avoid using proc import - this is a guessing procedure, which will guess what it thinks your data should look like.  As you are the best person to know what your data should look like (and of course you will have an import agreement stating formats/lengths etc. wont you), you should input this information into a datastep (you can take the one generated by the proc import from the log and use that as a basis).  That way every import of the data will conform to the same structure (or fail) and will be clean and repeatable.  

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 683 views
  • 0 likes
  • 2 in conversation