BookmarkSubscribeRSS Feed
saipriya92
Calcite | Level 5

What is wrong in this statement ?

 

proc import datafile="C:\Users\manya\Documents\DATA\BRFFS_data.xls" 
	dbms = xls
	out = work.data1 
	replace ;
	getnames = YES ;
run ;

the log says this 

 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 70         
 71         proc import datafile="C:\Users\manya\Documents\DATA\BRFFS_data.xls"
 72         dbms = xls
 73         out = work.data1
 74         replace ;
 75         getnames = YES ;
 76         run ;
 
 ERROR: Physical file does not exist, /pbr/biconfig/940/Lev1/SASApp/C:\Users\manya\Documents\DATA\BRFFS_data.xls.
 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              685.90k
       OS Memory           27028.00k
       Timestamp           08/05/2019 08:04:30 PM
       Step Count                        70  Switch Count  0
       Page Faults                       0
       Page Reclaims                     146
       Page Swaps                        0
       Voluntary Context Switches        0
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           0
       
 77         
 78         
 79         
 80         
 81         
 82         
 83         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 95         
2 REPLIES 2
SASKiwi
PROC Star

There is nothing syntactically wrong with your program but it looks like you are making the classic mistake of trying to read a spreadsheet stored on your local PC drive, but SAS runs on a remote Unix server. The clue is here - /pbr/biconfig/940/Lev1/SASApp/ - this is the SAS installation folder on a Unix server.

 

You need to move the spreadsheet to a folder readable by your SAS server. I suggest you talk to your SAS administrator to identify where that is. If you are using SAS Enterprise Guide it contains a task for copying your spreadsheet (or files in general) to the SAS server.

Kurt_Bremser
Super User

Just to add:

This part

/pbr/biconfig/940/Lev1/SASApp/

is the Current Working Directory (CWD) of your SAS workspace server process on the UNIX server.

You do not have write permissions there (unless your SAS admin erred catastrophically during the installation), so you need to put your file somewhere where you have those permissions. One place is your home directory, where you MUST have write permission for anything to work, and where you automatically "land" when logging on to the server directly (ie with WinSCP) using your SAS credentials.

In your code, you can use $HOME to address this home directory:

proc import datafile="$HOME/BRFFS_data.xls" 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 2 replies
  • 431 views
  • 0 likes
  • 3 in conversation