<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Exporting files to a relative path in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Exporting-files-to-a-relative-path/m-p/33907#M8221</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how I can do this? it must be possible!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jul 2011 08:37:37 GMT</pubDate>
    <dc:creator>JamesNewcombe</dc:creator>
    <dc:date>2011-07-20T08:37:37Z</dc:date>
    <item>
      <title>Exporting files to a relative path</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Exporting-files-to-a-relative-path/m-p/33907#M8221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how I can do this? it must be possible!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 08:37:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Exporting-files-to-a-relative-path/m-p/33907#M8221</guid>
      <dc:creator>JamesNewcombe</dc:creator>
      <dc:date>2011-07-20T08:37:37Z</dc:date>
    </item>
    <item>
      <title>Exporting files to a relative path</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Exporting-files-to-a-relative-path/m-p/33908#M8222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Perhaps the macro variables SAS_EXECFILEPATH and SAS_EXECFILENAME will help?&amp;nbsp; There are some more details here: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://support.sas.com/documentation/cdl/en/hostwin/63047/HTML/default/viewer.htm#editor_enhanced.htm"&gt;http://support.sas.com/documentation/cdl/en/hostwin/63047/HTML/default/viewer.htm#editor_enhanced.htm&lt;/A&gt;&lt;SPAN&gt; .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sadly my setup doesn't allow me to create an example for you, but it sounds like they might help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 10:06:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Exporting-files-to-a-relative-path/m-p/33908#M8222</guid>
      <dc:creator>DF</dc:creator>
      <dc:date>2011-07-20T10:06:46Z</dc:date>
    </item>
    <item>
      <title>Exporting files to a relative path</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Exporting-files-to-a-relative-path/m-p/33909#M8223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had look at it and coded this:&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;P&gt;﻿%let ipath = %sysget(SAS_EXECFILEPATH);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which gets the current path where the SAS program is stored. Now I can easily add this into my Proc Export.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!﻿﻿&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 10:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Exporting-files-to-a-relative-path/m-p/33909#M8223</guid>
      <dc:creator>JamesNewcombe</dc:creator>
      <dc:date>2011-07-20T10:16:41Z</dc:date>
    </item>
  </channel>
</rss>

