<?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: Is it possible to use sas to create a new folder in my own drive ? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54917#M15247</link>
    <description>Hey Cynthia, &lt;BR /&gt;
&lt;BR /&gt;
works amazingly. your awesome! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
cheers!!!</description>
    <pubDate>Thu, 11 Feb 2010 02:05:39 GMT</pubDate>
    <dc:creator>Yennie</dc:creator>
    <dc:date>2010-02-11T02:05:39Z</dc:date>
    <item>
      <title>Is it possible to use sas to create a new folder in my own drive ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54911#M15241</link>
      <description>Hi there, &lt;BR /&gt;
&lt;BR /&gt;
I am currently wanting to save a sas dataset into my own drive as a csv file. And I have to do this every month for my department. Therefore, wondering if there is any sas code that can help to create a new folder in my drive automatically??&lt;BR /&gt;
&lt;BR /&gt;
I have the below script... (part of it...)&lt;BR /&gt;
&lt;BR /&gt;
%Let dir = K:\\int\Collaborate\PI\;&lt;BR /&gt;
%Let folder_name = &lt;B&gt;abc_folder&lt;/B&gt;; ---&amp;gt; This is the extra folder that I am referring to. I am wanting to create this folder every month, however I am wanting to utilise sas to help me create this extra folder automatically instead of having to get someone (while i am away for annual leave) to go into our network drive to create this folder manually so that just by a press of button they can run the script and that's all it does.&lt;BR /&gt;
&lt;BR /&gt;
%Let csvname = abc.csv;&lt;BR /&gt;
&lt;BR /&gt;
Proc Export&lt;BR /&gt;
	Data 			= Criteria&lt;BR /&gt;
	Outfile 		= "&amp;amp;Dir&lt;B&gt;&amp;amp;folder_name&lt;/B&gt;&amp;amp;csvname"&lt;BR /&gt;
		DBMS = CSV Replace;&lt;BR /&gt;
Run;&lt;BR /&gt;
&lt;BR /&gt;
hoping someone can help. &lt;BR /&gt;
&lt;BR /&gt;
Cheers!&lt;BR /&gt;
Yennie</description>
      <pubDate>Wed, 10 Feb 2010 06:01:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54911#M15241</guid>
      <dc:creator>Yennie</dc:creator>
      <dc:date>2010-02-10T06:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use sas to create a new folder in my own drive ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54912#M15242</link>
      <description>Hi: &lt;BR /&gt;
  You can use the X command to create directories on your system (using operating system commands, such as MKDIR) or you can use the DCREATE function from within a SAS program. Either the SAS companion for your operating system (in the documentation) will have examples or you can open a track with Tech Support for more help about automatic directory creation using a program.&lt;BR /&gt;
 &lt;BR /&gt;
  Or you could create an operating system script or command file and execute your SAS program (your .SAS file) from within that script (such as a .BAT or .CMD file). Again, the SAS Companion for your operating system will have examples of how to submit a batch SAS program from within an operating system script or command file. &lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 10 Feb 2010 06:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54912#M15242</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-02-10T06:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use sas to create a new folder in my own drive ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54913#M15243</link>
      <description>Greetings.&lt;BR /&gt;
&lt;BR /&gt;
This macro creates a directory.&lt;BR /&gt;
&lt;BR /&gt;
  %MACRO MD(DIR=d:\bd_comp\data\2005\m6);&lt;BR /&gt;
  %LET COUNT=0;&lt;BR /&gt;
  %LET DLM=\;&lt;BR /&gt;
  %IF %SUBSTR(&amp;amp;DIR,%LENGTH(&amp;amp;DIR),1) NE &amp;amp;DLM %THEN %DO;&lt;BR /&gt;
  %LET DIR=&amp;amp;DIR&amp;amp;DLM;&lt;BR /&gt;
  %END;&lt;BR /&gt;
  %DO J=1 %TO %LENGTH(&amp;amp;DIR);&lt;BR /&gt;
  %IF %SUBSTR(&amp;amp;DIR,&amp;amp;J,1)=&amp;amp;DLM %THEN %DO;&lt;BR /&gt;
  %LET COUNT=%EVAL(&amp;amp;COUNT+1);&lt;BR /&gt;
  %END; %END;&lt;BR /&gt;
  %LET DRIVE=%SUBSTR(&amp;amp;DIR,1,3);&lt;BR /&gt;
  %LET LEVEL=&amp;amp;DRIVE;&lt;BR /&gt;
  %DO I=2 %TO &amp;amp;COUNT;&lt;BR /&gt;
  %LET WORD=%SCAN(&amp;amp;DIR,&amp;amp;I,&amp;amp;DLM);&lt;BR /&gt;
  %LET LNEW=&amp;amp;LEVEL&amp;amp;WORD&amp;amp;DLM;&lt;BR /&gt;
  data _null_;&lt;BR /&gt;
  rc=filename('newdir',"&amp;amp;lnew");&lt;BR /&gt;
  c=dopen('newdir');&lt;BR /&gt;
  if c=0 then new=dcreate("&amp;amp;word","&amp;amp;level");&lt;BR /&gt;
  run;&lt;BR /&gt;
  %LET LEVEL=&amp;amp;LNEW;&lt;BR /&gt;
  %END;&lt;BR /&gt;
  %MEND MD;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Oleg.</description>
      <pubDate>Wed, 10 Feb 2010 10:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54913#M15243</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2010-02-10T10:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use sas to create a new folder in my own drive ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54914#M15244</link>
      <description>You can also use MD Windows command.&lt;BR /&gt;
&lt;BR /&gt;
systask command&lt;BR /&gt;
   "md ""d:\work\cc 2009"""&lt;BR /&gt;
   wait taskname="md";&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Oleg.</description>
      <pubDate>Wed, 10 Feb 2010 10:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54914#M15244</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2010-02-10T10:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use sas to create a new folder in my own drive ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54915#M15245</link>
      <description>Hi cynthia, &lt;BR /&gt;
&lt;BR /&gt;
I used this command &lt;BR /&gt;
&lt;BR /&gt;
X mkdir 'K:\Monthly BackUp\2010\ABC\"'; where ABC is my extra folder ? &lt;BR /&gt;
&lt;BR /&gt;
However, I had this error on my SAS&lt;BR /&gt;
&lt;BR /&gt;
REMOTE(SASAP1): ..&lt;BR /&gt;
REMOTE(SASAP1): .: The file access permissions do not allow the specified action.&lt;BR /&gt;
&lt;BR /&gt;
Does this means i will have to speak to my sas support helpdesk guys?</description>
      <pubDate>Thu, 11 Feb 2010 00:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54915#M15245</guid>
      <dc:creator>Yennie</dc:creator>
      <dc:date>2010-02-11T00:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use sas to create a new folder in my own drive ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54916#M15246</link>
      <description>hi:&lt;BR /&gt;
  When I use the mkdir command on my Windows system, I use this syntax (note that the operating system command is INSIDE the quotes):&lt;BR /&gt;
[pre]&lt;BR /&gt;
options noxwait noxsync;&lt;BR /&gt;
x 'md c:\temp\outfile';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
However, you might still receive file access permission errors which would mean that you'd have to discuss the issue, and/or have permissions changed by your security/system/admin folks.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 11 Feb 2010 00:52:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54916#M15246</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-02-11T00:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use sas to create a new folder in my own drive ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54917#M15247</link>
      <description>Hey Cynthia, &lt;BR /&gt;
&lt;BR /&gt;
works amazingly. your awesome! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
cheers!!!</description>
      <pubDate>Thu, 11 Feb 2010 02:05:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/54917#M15247</guid>
      <dc:creator>Yennie</dc:creator>
      <dc:date>2010-02-11T02:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use sas to create a new folder in my own drive ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/548562#M74438</link>
      <description>&lt;P&gt;Thank you Oleg! It worked for me. Very helpful.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 17:00:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-it-possible-to-use-sas-to-create-a-new-folder-in-my-own-drive/m-p/548562#M74438</guid>
      <dc:creator>Olga3</dc:creator>
      <dc:date>2019-04-04T17:00:44Z</dc:date>
    </item>
  </channel>
</rss>

