- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm new to SAS and I'm trying to import local csv file to SAS Studio. But I got the following error.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Also note that you should not clutter up the sasuser.v94 directory with data, as it is the directory for your SASUSER library.