BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tonderai
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
jakarman
Barite | Level 11

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)

---->-- ja karman --<-----

View solution in original post

7 REPLIES 7
jakarman
Barite | Level 11

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)

---->-- ja karman --<-----
tonderai
Calcite | Level 5

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.

JuanS_OCS
Amethyst | Level 16

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

tonderai
Calcite | Level 5

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 .

JuanS_OCS
Amethyst | Level 16

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.

RamKumar
Fluorite | Level 6

you should place the file in Linux server as Jaap mentioned instead placing it in windows folder.

jakarman
Barite | Level 11

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)

---->-- ja karman --<-----

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 7893 views
  • 7 likes
  • 4 in conversation