BookmarkSubscribeRSS Feed
fadel
Calcite | Level 5

Hi,

im working in SAS EG and want my programm to export excel files in local, but when i affect path to output statement in the proc export it display the following error:

ERROR: Physical file does not exist, /SAS92/config/Lev1/SASApp/C:\Documents and Settings\louzia\Bureau\12032015 projet TDB prepaid

       mustapha\echantillon_OTHMANE.xls.

This is what my server looks like:

Serveur

   user_folder

   sasuser

      personne1

     personne2

     .

     .

     .

     personne10 (Me)

          files

               excelfiles

                      myfile.xls

5 REPLIES 5
Kurt_Bremser
Super User

Your SAS (behind EG) is not local, it is installed on a remote UNIX server. Either use the EG export wizard (which can write to your local disk), or write the file to your UNIX home directory and copy it from there to your local disk (eg with WinSCP).

fadel
Calcite | Level 5

Thank you, but how can i write the file to my UNIX home directory?

Kurt_Bremser
Super User

Knew that one was coming Smiley Wink

Some things about the UNIX filesystem:

The character separating directories is the forward slash, not the backward slash as in Windows

(Usage of the backslash in Windows comes from the fact that its ancestor CP/M had no directory hierarchy, but used the forward slash for commandline parameters; when Gates&Allen grafted the hierarchical filesystem to DOS 2, they used the backslash, instead of making DOS compatible with existing systems that had a hierarchical FS)

There are no drive designators, all file resources are "mounted" into a single tree

The tree starts with root (/); everything else is in subdirectories

A path starting with / originates from root and is called an absolute path; a path not starting with a / is called relative and denotes a path starting in the current working directory of the process. This is the reason why you see your "C:\Documents and Settings\...." appended to the working directory of the SAS workspace server.

As a big help, an environment variable ($HOME) is provided which contains the absolute path to your home directory.

So, to create a file in your home directory, use (as an example)

data _null_;

set something;

file "$HOME/file.csv" file_options;

put ......;

run;

You will then find this file in the Files section of your SASApp server in the server list in EG (you may have to refresh). Some file types can be transferred in EG by adding to the project and then exporting to the local disk.

My preferred method is to use WinSCP to do file transfers, as I can transfer anything and have total control over the process.

Edit: directories instead of characters (see bold print)

fadel
Calcite | Level 5

Thnks, i fond it

Steelers_In_DC
Barite | Level 11

Fadel, Please mark the question as answered.  It helps the community run smoother.

Thanks,

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 5 replies
  • 4535 views
  • 6 likes
  • 3 in conversation