BookmarkSubscribeRSS Feed
Veer1
Fluorite | Level 6

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

11 REPLIES 11
Kurt_Bremser
Super User

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.

Veer1
Fluorite | Level 6

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;

Reeza
Super User
Please include the log as well.
Veer1
Fluorite | Level 6
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73
74 %Let infile= "~/home/u58836540/TRY-SAS/Base_Report_raw_data.xlsx";/* Change the file path */
75 %Let outpath=~/home/Output;/* Change the file path */
76
77
78 ****************************************
79 READ IN DEVELOPMENT DATA
80 ***************************************;
81 options validvarname=v7;
82 PROC IMPORT DATAFILE=&infile
83 OUT=Base
84 DBMS=XLSX REPLACE;
85 GETNAMES=YES;
86 SHEET='CLOC & IMS';
87 RUN;
 
ERROR: Physical file does not exist, /home/u58836540/home/u58836540/CTE-SAS//Baseline_Report_raw_data.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 2054.21k
OS Memory 33700.00k
Timestamp 22/06/2021 09:51:38 PM
Step Count 145 Switch Count 0
Page Faults 0
Page Reclaims 462
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
88
89
90 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
102
Tom
Super User Tom
Super User

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";
Veer1
Fluorite | Level 6

same error even when i used these options

Reeza
Super User
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.

Veer1
Fluorite | Level 6

I did not create a library earlier which was the reason for the error.

ballardw
Super User

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.

Reeza
Super User

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


 

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


Register now!

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
  • 11 replies
  • 1714 views
  • 3 likes
  • 5 in conversation