Hi,
I am new to the SAS community and I am using the SAS On Demand for academics browser version and I want to know how can I define the input and output path and also set the working directory?
Thanks
On Demand runs on a UNIX cloud server where you have a home directory (/home/user-id). You upload to that location when you upload files with SAS Studio.
Don't rely on the concept of a working directory, always use an absolute path for files.
Since you get a "file does not exist" error, please post your code and log.
options nodate pageno=1;
title; footnote; libname _all_;
%Let infile= "~/home/u58836540/TRY-SAS/Base_Report_raw_data.xlsx";
%Let outpath=~/home/u58836540/TRY-SAS/Output;/
options validvarname=v7;
PROC IMPORT DATAFILE=&infile
OUT=Base
DBMS=XLSX REPLACE;
GETNAMES=YES;
SHEET='CLOC & IMS';
RUN;
You have included your home directory twice in the path. Once use the Unix trick of just use tilda character. And them as subdirectories of your home directory. Use one method or the other.
%let infile= "/home/u58836540/TRY-SAS/Base_Report_raw_data.xlsx";
%let infile= "~/TRY-SAS/Base_Report_raw_data.xlsx";
same error even when i used these options
options validvarname=v7;
PROC IMPORT DATAFILE="/home/u58836540/TRY-SAS/Base_Report_raw_data.xlsx"
OUT=myData
DBMS=XLSX REPLACE;
SHEET='CLOC & IMS';
RUN;
Please post the log from exactly the code above.
I did not create a library earlier which was the reason for the error.
On demand is a cloud based service. So you upload files to their storage area, work there and then download results. You can create folders in your work "area" but "path", if you are thinking your computer hard drive, is right out.
All files are stored on the cloud server.
You can set your working directory the same way as in desktop.
For file paths, it's usually under this main file path:
/home/fkhurshed/
If you go to the Servers Files and Folders pane you can see the folder structure. In that pane you can right click any file/folder and select properties. The full path will be there for you to use in your code.
@Veer1 wrote:
Hi,
I am new to the SAS community and I am using the SAS On Demand for academics browser version and I want to know how can I define the input and output path and also set the working directory?
Thanks
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.