BookmarkSubscribeRSS Feed
rieckl
Calcite | Level 5

I have just started using SAS and tried to use the "Import XLSX" snippet to import my XLSX datafile.  I have created a folder within "myfolders" called "CH2" and have uploaded my xlsx file there.  I then filled in the relevant information using the tutorial on the SAS help website and then read a bunch of posts on here about similar problems.  However, no matter what I do, I continue to get the same error.  I'm including a screenshot of how I had the code set up and a PDF of the log after running the code.  Any ideas how to fix this and get my data into SAS?  Thank you in advance!


Screenshot (41).png
4 REPLIES 4
ballardw
Super User

It is best to just post the log information in a code box using the {i} forum menu icon that attaching a file (unless it very long)

 

PROC IMPORT DATAFILE="<folders/myfolders/CH2/overtimesas.xlsx>"

where did the < and > characters come from? I would expect

 

PROC IMPORT DATAFILE="/folders/myfolders/CH2/overtimesas.xlsx"

 

Note the full error message

ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/<folders/myfolders/CH2//overtimesas.xlsx>.

If you use windows explorer to go to that location do you see anything named with <folders???

 

I would suggest exploring the TASKS for import data and see the code generated for comparison

Reeza
Super User

You can right click a file in the Files/Folders Section, select properties and the exact path you will need to use is in that menu. 

You can copy and use that. 

 

 

Kurt_Bremser
Super User

You will VERY rarely find a '<' or '>' in a UNIX filename, as these characters have special meaning in the shell as in/output recdirectors.

So they were used to mean 'insert your path here' in the documentation.

Also keep in mind that any pathname that doesn't start with a forward slash is considered relative to the current working directory and will usually lead into the great nowhere.

jennifert
SAS Employee

Hi @rieckl,

 

There is a topic about importing data in the FAQ here: How do I import data from a raw data file, a Microsoft Excel worksheet, or a DBMS file? 

Click on Snippets at the top to view instructions for using the Import XLSX File snippet.  In Step 2 of the instructions, there is an explanation for Line 3 of the snippet that shows examples of how to specify the XLSX filename.

 

Hope that helps!

thanks,

Jennifer

 


Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1844 views
  • 0 likes
  • 5 in conversation