<?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 Re: How to move my current folder in SAS? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618357#M181397</link>
    <description>&lt;P&gt;Look at the&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p1cjn9slqm22q7n1exa9ba8ydjce.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;DLGCDIR&lt;/A&gt;&amp;nbsp;function.&lt;/P&gt;</description>
    <pubDate>Sun, 19 Jan 2020 11:43:50 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-01-19T11:43:50Z</dc:date>
    <item>
      <title>How to move my current folder in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618355#M181396</link>
      <description>&lt;P&gt;Can I change my current folder in SAS so that I don't need to type the folder path repeatedly? I have a couple of processes that I would like to run and save separately using ODS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But please keep in mind that I don't want to reset my "default folder". I have several projects, so I would like to know how to move a current folder in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I can do now:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html file ="c:\folder1\folder2\folder3\folder4\filename1.htm";
*first procedure;


ods html file ="c:\folder1\folder2\folder3\folder4\filename2.htm";
*second procedure;


ods html file ="c:\folder1\folder2\folder3\folder4\filename3.htm";
*third procedure;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;I would like to change the above code to the below.&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html file ="filename1.htm";
*first procedure;


ods html file ="filename2.htm";
*second procedure;


ods html file ="filename3.htm";
*third procedure;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jan 2020 11:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618355#M181396</guid>
      <dc:creator>braam</dc:creator>
      <dc:date>2020-01-19T11:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to move my current folder in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618357#M181397</link>
      <description>&lt;P&gt;Look at the&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p1cjn9slqm22q7n1exa9ba8ydjce.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;DLGCDIR&lt;/A&gt;&amp;nbsp;function.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jan 2020 11:43:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618357#M181397</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-19T11:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to move my current folder in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618358#M181398</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279507"&gt;@braam&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Can I change my current folder in SAS so that I don't need to type the folder path repeatedly? I have a couple of processes that I would like to run and save separately using ODS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But please keep in mind that I don't want to reset my "default folder". I have several projects, so I would like to know how to move a current folder in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I can do now:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html file ="c:\folder1\folder2\folder3\folder4\filename1.htm";
*first procedure;


ods html file ="c:\folder1\folder2\folder3\folder4\filename2.htm";
*second procedure;


ods html file ="c:\folder1\folder2\folder3\folder4\filename3.htm";
*third procedure;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;I would like to change the above code to the below.&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html file ="filename1.htm";
*first procedure;


ods html file ="filename2.htm";
*second procedure;


ods html file ="filename3.htm";
*third procedure;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm not sure why you need to move a folder to achieve anything. If you have a folder that you always use for a specific project, you can change the AUTOEXEC to set a macro variable taht contains the folder used for each project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in your autoexec file, if you have a project named "GAZELLE", you can set the macro variable like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let gazelle=c:\folder1\folder2\folder3\folder4;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then your program can access this folder as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html file ="&amp;amp;gazelle\filename1.htm";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The nice thing about this, is that if your servers or hard disks ever change (our server names change from time to time) you just have to change the autoexec; you don't have to change all of the locations in all of the programs that use this folder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you can combine this with &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; 's suggestion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rc=dlgcdir("&amp;amp;gazelle");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 Jan 2020 12:21:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618358#M181398</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-01-19T12:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to move my current folder in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618369#M181399</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your suggestions. Unfortunately, I encountered an error message when I executed DLGDIR. Perhaps there is a version issiue with my SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;3769    data _null_;
3770        rc=dlgcdir();
               -------
               68
ERROR 68-185: The function DLGCDIR is unknown, or cannot be accessed.

3771        put rc=;
3772     run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I happened to find a way to achieve what I wanted to do using x statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x 'cd C:\folder1\folder2';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I confirmed that things work as I expected after this x statement.&lt;/P&gt;
&lt;P&gt;Thanks again!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jan 2020 13:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618369#M181399</guid>
      <dc:creator>braam</dc:creator>
      <dc:date>2020-01-19T13:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to move my current folder in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618388#M181407</link>
      <description>I recommend PaigeMiller's solution. I always have a working path set in my main/control program and then all paths after are relative so if I move the whole project I'm not retyping paths manually in multiple places. Plus I also have a system for how my files are stored and this helps to enforce it.</description>
      <pubDate>Sun, 19 Jan 2020 19:53:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618388#M181407</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-01-19T19:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to move my current folder in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618395#M181409</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279507"&gt;@braam&lt;/a&gt;&amp;nbsp; - I would consider it best practice to follow &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; 's and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; 's recommendation of storing absolute folder paths in macro variables at the start of your SAS application/program. Set it once, then use it everywhere. Then you don't need to worry about current folders at all and whether you are in the 'right' one or not. Good practices like this become even more important when using SAS on remote servers where folder organisation is more complex.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jan 2020 20:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618395#M181409</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-01-19T20:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to move my current folder in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618398#M181410</link>
      <description>&lt;P&gt;Looks like you are running an older version of SAS.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A tabindex="0" title="“DLGCDIR Function”" href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p1cjn9slqm22q7n1exa9ba8ydjce.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" data-docset-id="lefunctionsref" data-docset-version="9.4" data-original-href="p1cjn9slqm22q7n1exa9ba8ydjce.htm"&gt;DLGCDIR&lt;/A&gt;&lt;/P&gt;
&lt;P class="xisDoc-paragraph"&gt;sets the working directory.&lt;/P&gt;
&lt;P class="xisDoc-paragraph"&gt;This function is available beginning with the December 2017 (9.4M5) release.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jan 2020 21:03:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-move-my-current-folder-in-SAS/m-p/618398#M181410</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-19T21:03:25Z</dc:date>
    </item>
  </channel>
</rss>

