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
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).
Thank you, but how can i write the file to my UNIX home directory?
Knew that one was coming
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)
Thnks, i fond it
Fadel, Please mark the question as answered. It helps the community run smoother.
Thanks,
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.