Help using Base SAS procedures

problem with proc import

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

problem with proc import

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


Accepted Solutions
Solution
‎11-14-2014 04:41 AM
Valued Guide
Posts: 3,208

Re: problem with proc import

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


All Replies
Solution
‎11-14-2014 04:41 AM
Valued Guide
Posts: 3,208

Re: problem with proc import

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 --<-----
New Contributor
Posts: 3

Re: problem with proc import

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.

Trusted Advisor
Posts: 1,141

Re: problem with proc import

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

New Contributor
Posts: 3

Re: problem with proc import

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 .

Trusted Advisor
Posts: 1,141

Re: problem with proc import

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.

Regular Contributor
Posts: 168

Re: problem with proc import

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

Valued Guide
Posts: 3,208

Re: problem with proc import

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 --<-----
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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