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

Hi, I'm new to SAS and I'm trying to import local csv file to SAS Studio. But I got the following error. 

Screen Shot 2020-11-10 at 11.51.53 AM.png

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

You are not.
1. Place the file in the myfolders folder you created.
2. Create a library reference to that file folder
3. Import that file referring to it using the /folders/myfolders notation as the Virtual Machine

Your code should look like below with the correct path and folder name. Note that your file and folder names are case sensitive.

libname myFIles '/folders/myfolders/';

proc import datafile = '/folders/myfolders/demo.csv' out=myFiles.demo dbms=csv replace; run;

View solution in original post

7 REPLIES 7
Reeza
Super User

You called your library LIBREF, a bad name overall as that should be a SAS keyword.
You refer to it in the IMPORT proc as CHO though.

Change them to be the same name. Note that your file path is also incorrect, files need to be in myfolders to be imported.

libname CHO '/folders/myfodlers/sasuser.v94';

proc import datafile = '/folders/myfolders/....path to file'
out=cho.data dbms=csv;run;
cclm529
Calcite | Level 5
Thank you! I'm actually trying to import from my local file. I don't know if I'm doing it correctly.
Reeza
Super User

You are not.
1. Place the file in the myfolders folder you created.
2. Create a library reference to that file folder
3. Import that file referring to it using the /folders/myfolders notation as the Virtual Machine

Your code should look like below with the correct path and folder name. Note that your file and folder names are case sensitive.

libname myFIles '/folders/myfolders/';

proc import datafile = '/folders/myfolders/demo.csv' out=myFiles.demo dbms=csv replace; run;

Aziegbemi
Calcite | Level 5

This is what I did in the following steps:

1) using the import icon, import the file from your local drive to the "Server Files and Folders" 

2) Under the "Server Files and Folders", click on NEW, click IMPORT DATA, click SELECT FILE

3) You will see a drop-down that contains the file you locally imported, select that file and click OPEN

4) Copy the file path 

 

 

FILENAME REFFILE '/home/u63000000/newfile.xlsx';

 

 

from the import data output

5) Paste this file path to your

datafile = '/home/u63000000/newfile.xlsx'

 -you should be all set!

Reeza
Super User
The original question references SAS University Edition which no longer exists.

The answer posted is for SAS On Demand (cloud) which does not support direct access to your local files, where as SAS University Edition did.
PaigeMiller
Diamond | Level 26

You are trying to use library named CHO, but you have not assigned a libref (which can be done using a LIBNAME statement) for CHO.

--
Paige Miller

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 7 replies
  • 9983 views
  • 0 likes
  • 5 in conversation