Hi, I'm new to SAS and I'm trying to import local csv file to SAS Studio. But I got the following error.
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;
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;
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;
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!
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.
Also note that you should not clutter up the sasuser.v94 directory with data, as it is the directory for your SASUSER library.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.