Hello
My SAS program uses Proc Export to write out a CSV file. I want to be able to write the file into a "Data" folder inside the same folder where I've stored my SAS program. If I copy my SAS program to a different folder and run it I want the CSV to automatically be written into data folder in the the new location. I don't want to have to keep manually altering the path in the program.
Does anyone know how I can do this? it must be possible!
Thanks.
I had look at it and coded this:
%let ipath = %sysget(SAS_EXECFILEPATH);
Which gets the current path where the SAS program is stored. Now I can easily add this into my Proc Export.
Thanks for your help!
Perhaps the macro variables SAS_EXECFILEPATH and SAS_EXECFILENAME will help? There are some more details here: http://support.sas.com/documentation/cdl/en/hostwin/63047/HTML/default/viewer.htm#editor_enhanced.ht... .
Sadly my setup doesn't allow me to create an example for you, but it sounds like they might help.
If they work for you, you should be able to parse the text of the full path to your program, and work out the full path of your desired folder.
I had look at it and coded this:
%let ipath = %sysget(SAS_EXECFILEPATH);
Which gets the current path where the SAS program is stored. Now I can easily add this into my Proc Export.
Thanks for your help!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.