Learning SAS? Welcome to the exclusive online community for all SAS learners.

cannot find files

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

cannot find files

Good Day! If I move my files, importexample.sas and example.xls, to C:/SASUniversityEdition/myfolders and reference them as

c:/myfolders/SASDATA/EXAMPLE.XLS they run. However, if I keep the two files in a subdirectory

C:/SASUniversityEdition/myfolders/sasdata then when I reference the files as

C:/folders/myfolders/SASDATA/EXAMPLE.XLS I get the message

ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/C:/myfolders/SASDATA/EXAMPLE.XLS

Most appreciative for any suggestions.

 

PS the code for importexample.sas is

PROC IMPORT OUT= WORK.FROMLX
            DATAFILE= "C:/folders/myfolders/SASDATA/EXAMPLE.XLS"
            DBMS=XLS REPLACE;

RUN;

 

I am using version 9.3 running on virtualbox and Windows 7Ulrtimate. The code comes from the book SAS Essentials by Elliot and Wood.ward

It s 7 PM and I won't be able to check again on post until tomorrow around 10 AM


Accepted Solutions
Solution
‎08-04-2016 06:26 PM
Super User
Posts: 6,962

Re: cannot find files

The ERROR message indicates a UNIX SAS host, which points to UE, so your first path could also never have worked there.

UNIX path names must start with a forward slash, or they are considered relative and start at the current working directory of the process.

Backward slashes are not used in UNIX path names, the backward slash has a special meaning in UNIX shells.

Also be consistent in writing file and path names. EXAMPLE.XLS is a different file than example.xls in UNIX. UNIX names are always case-sensitive. The same goes for the directory sasdata.

So make sure that your DOS path is

C:\SASUniversityEdition\myfolders\sasdata\example.xls

and then use

/folders/myfolders/sasdata/example.xls

in the SAS code.

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Super User
Posts: 17,870

Re: cannot find files


jmarroyo wrote:

 

I am using version 9.3 running on virtualbox and Windows 7Ulrtimate.


 

It sounds like you're using SAS University Edition, the free download, not SAS 9.3?

 

If so, then yes, your files need to be in a shared folder that is accessible to the VM. The VM is equivalent to a different computer and cannot see your computer UNLESS you create a link via a shared folder.

 

If you want to create other locations, then add them under shared folders in VirtualBox.

Then you'll be able to access them. Refer to the SAS UE FAQ for further details on how to accomplish this.

 

https://support.sas.com/software/products/university-edition/faq/main.htm

 

This for some reason references VM but the process is similar.

https://support.sas.com/software/products/university-edition/faq/shared_folder_access_existing.htm

Occasional Contributor
Posts: 6

Re: cannot find files

You are absolutely correct, I misspoke and do have AU. I would have followed your link but KurtBremser had already "held my hand" by the time I got time to return to SAS.
Most Appreciative.
Super User
Posts: 17,870

Re: cannot find files

And you should be using Unix paths, so if the C:/ works, then maybe you aren't using SAS UE?

Everything points to it though.

 

Solution
‎08-04-2016 06:26 PM
Super User
Posts: 6,962

Re: cannot find files

The ERROR message indicates a UNIX SAS host, which points to UE, so your first path could also never have worked there.

UNIX path names must start with a forward slash, or they are considered relative and start at the current working directory of the process.

Backward slashes are not used in UNIX path names, the backward slash has a special meaning in UNIX shells.

Also be consistent in writing file and path names. EXAMPLE.XLS is a different file than example.xls in UNIX. UNIX names are always case-sensitive. The same goes for the directory sasdata.

So make sure that your DOS path is

C:\SASUniversityEdition\myfolders\sasdata\example.xls

and then use

/folders/myfolders/sasdata/example.xls

in the SAS code.

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is SOLVED.

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

Discussion stats
  • 4 replies
  • 384 views
  • 4 likes
  • 3 in conversation