i'm trying to import data either a tab delimited or excel file still get the same error that physical file does not exist. here is the code and error
OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
42 ;
43 /** Import an XLS file. **/
44
45 PROC IMPORT DATAFILE="C:/Users/RChiruka/Documents/software/SASUniversityEdition/Myfolders/mandeya/nur.xlsx"
46 OUT=WORK.MYEXCEL
47 DBMS=XLSX
48 REPLACE;
49 RUN;
ERROR: Physical file does not exist,
/opt/sasinside/SASConfig/Lev1/SASApp/C:/Users/RChiruka/Documents/software/SASUniversityEdition
the excel file is saved in the shared folder myfolders. i also tried to change the forward slash to back slash with the same result.
thanks
UE is running at Linux you CANNOT use windows filenames with that. Use the Unix names for that.
The unix shared name of My folder is: /folders/myfolders/ .... (instead of ... your datasetname)
Ask the properties of folders/datasets in the right panel.
="C:/Users/RChiruka/Documents/software/SASUniversityEdition/Myfolders/mandeya/nur.xlsx" (windows)
="/folders/myfolders/mandeya/nur.xlsx" (unix)
UE is running at Linux you CANNOT use windows filenames with that. Use the Unix names for that.
The unix shared name of My folder is: /folders/myfolders/ .... (instead of ... your datasetname)
Ask the properties of folders/datasets in the right panel.
="C:/Users/RChiruka/Documents/software/SASUniversityEdition/Myfolders/mandeya/nur.xlsx" (windows)
="/folders/myfolders/mandeya/nur.xlsx" (unix)
my sas is running on windows so I tried with the back slash istill get the same error
OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
42 ;
43 /** Import an XLS file. **/
44
45 PROC IMPORT DATAFILE="C:\Users\RChiruka\Documents\software\SASUniversityEdition\Myfolder\/mandeya\nur.xlsx"
46 OUT=WORK.MYEXCEL
47 DBMS=XLSX
48 REPLACE;
49 RUN;
ERROR: Physical file does not exist,
/opt/sasinside/SASConfig/Lev1/SASApp/C:/Users/RChiruka/Documents/software/SASUniversityEdition
the excel file is saved in the shared folder myfolders.
i also tried to change the forward slash to back slash with the same result.
Hi,
Ram and Jaap are right, but maybe the problem here is the understanding.
What you pretend is to make an import of a local file (on your windows pc), when running your code in your server, that is a Linux server. So the server is trying to read a Windows path (and reach a file that is not on the server), and of course the server can not do that.
Unless that you have a local Base SAS and SAS Connect (probably not), you should upload your file to the server, and then the proc import should reflect the path where the Xls file is placed (Linux path).
Some suggested readings:
http://blogs.sas.com/content/sasdummy/2012/12/06/copy-files-in-sas-eg/
http://support.sas.com/resources/papers/proceedings12/300-2012.pdf
enterprise guide - SAS EG: including local file while running on server - Stack Overflow
thank you
i uploaded the file i wanted to import to myfolder in sas and ra n the proc import and it seems to work fine so i think for now i will just have to upload my files first.
final question
why do we create a shared myfolder when installing sas u if it does not seem to be used .
Good to read
The share still makes sense, because you can put your files on the share. But the share needs to be mounted on a Linux path. Then, if you put your files on a windows share like \\server\folder\file.ext, and if \\server\folder is mounted on the linux server as /media/win_share/ , then you should be ably to reach that file with a Linux path as /media/win_share/file.ext from the server.
you should place the file in Linux server as Jaap mentioned instead placing it in windows folder.
Your sas may be running on your desktop windows in a VIRTUALIZED LINUX environment (CENTOS).
This message: " /opt/sasinside/SASConfig/Lev1/SASApp " is the proof of that no sas-windows but a Unix-SAS that is coming with UE.
When you run the sas-code: % put _automatic_ ; it will show:
AUTOMATIC SYSHOSTINFOLONG Linux LIN X64 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64 CentOS release 6.5 (Final)
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.