<?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: Create Folder in Windows without using the X Command in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-Folder-in-Windows-without-using-the-X-Command/m-p/70976#M7094</link>
    <description>%macro createdirectory( directory= ) ;&lt;BR /&gt;
&lt;BR /&gt;
  data _null_ ;&lt;BR /&gt;
    length directory&lt;BR /&gt;
           path&lt;BR /&gt;
           folder&lt;BR /&gt;
           newdir     $128 ;&lt;BR /&gt;
&lt;BR /&gt;
    directory = "&amp;amp;directory" ;&lt;BR /&gt;
    if substr( directory, lengthn( directory ), 1 ) ne "\" then&lt;BR /&gt;
      directory = cats( directory, "\" ) ;&lt;BR /&gt;
&lt;BR /&gt;
    if substr( directory, 1, 2 ) = "\\" then do ;&lt;BR /&gt;
      path = substr( directory, 1, find( directory, "\", 3 ) ) ;&lt;BR /&gt;
      i = 2 ;&lt;BR /&gt;
    end ;&lt;BR /&gt;
    else do ;&lt;BR /&gt;
      i = 1 ;&lt;BR /&gt;
      path = '' ;&lt;BR /&gt;
    end ;&lt;BR /&gt;
    path = cats( path, scan( directory, i, "\" ), "\" ) ;&lt;BR /&gt;
&lt;BR /&gt;
    if fileexist( path ) then do ;&lt;BR /&gt;
      i + 1 ;&lt;BR /&gt;
      do while ( lengthn( scan( directory, i, "\" ) ) ) ;&lt;BR /&gt;
        folder = scan( directory, i, "\" ) ;&lt;BR /&gt;
        newdir = cats( path, folder ) ;&lt;BR /&gt;
        if not fileexist( newdir ) then newdir = dcreate( folder, path ) ;&lt;BR /&gt;
        path = cats( path, folder, "\" ) ;&lt;BR /&gt;
        i + 1 ;&lt;BR /&gt;
      end ;&lt;BR /&gt;
    end ;&lt;BR /&gt;
  run ;&lt;BR /&gt;
&lt;BR /&gt;
%mend ;&lt;BR /&gt;
&lt;BR /&gt;
/* EOF: createdirectory.sas */</description>
    <pubDate>Thu, 10 Feb 2011 15:37:30 GMT</pubDate>
    <dc:creator>tbellmer</dc:creator>
    <dc:date>2011-02-10T15:37:30Z</dc:date>
    <item>
      <title>Create Folder in Windows without using the X Command</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-Folder-in-Windows-without-using-the-X-Command/m-p/70975#M7093</link>
      <description>Help! Does anyone know how to create a folder in Windows using SAS without using the X Command (aka on SAS Server - EG)? Can it be done?</description>
      <pubDate>Thu, 10 Feb 2011 15:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-Folder-in-Windows-without-using-the-X-Command/m-p/70975#M7093</guid>
      <dc:creator>Idan</dc:creator>
      <dc:date>2011-02-10T15:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create Folder in Windows without using the X Command</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-Folder-in-Windows-without-using-the-X-Command/m-p/70976#M7094</link>
      <description>%macro createdirectory( directory= ) ;&lt;BR /&gt;
&lt;BR /&gt;
  data _null_ ;&lt;BR /&gt;
    length directory&lt;BR /&gt;
           path&lt;BR /&gt;
           folder&lt;BR /&gt;
           newdir     $128 ;&lt;BR /&gt;
&lt;BR /&gt;
    directory = "&amp;amp;directory" ;&lt;BR /&gt;
    if substr( directory, lengthn( directory ), 1 ) ne "\" then&lt;BR /&gt;
      directory = cats( directory, "\" ) ;&lt;BR /&gt;
&lt;BR /&gt;
    if substr( directory, 1, 2 ) = "\\" then do ;&lt;BR /&gt;
      path = substr( directory, 1, find( directory, "\", 3 ) ) ;&lt;BR /&gt;
      i = 2 ;&lt;BR /&gt;
    end ;&lt;BR /&gt;
    else do ;&lt;BR /&gt;
      i = 1 ;&lt;BR /&gt;
      path = '' ;&lt;BR /&gt;
    end ;&lt;BR /&gt;
    path = cats( path, scan( directory, i, "\" ), "\" ) ;&lt;BR /&gt;
&lt;BR /&gt;
    if fileexist( path ) then do ;&lt;BR /&gt;
      i + 1 ;&lt;BR /&gt;
      do while ( lengthn( scan( directory, i, "\" ) ) ) ;&lt;BR /&gt;
        folder = scan( directory, i, "\" ) ;&lt;BR /&gt;
        newdir = cats( path, folder ) ;&lt;BR /&gt;
        if not fileexist( newdir ) then newdir = dcreate( folder, path ) ;&lt;BR /&gt;
        path = cats( path, folder, "\" ) ;&lt;BR /&gt;
        i + 1 ;&lt;BR /&gt;
      end ;&lt;BR /&gt;
    end ;&lt;BR /&gt;
  run ;&lt;BR /&gt;
&lt;BR /&gt;
%mend ;&lt;BR /&gt;
&lt;BR /&gt;
/* EOF: createdirectory.sas */</description>
      <pubDate>Thu, 10 Feb 2011 15:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-Folder-in-Windows-without-using-the-X-Command/m-p/70976#M7094</guid>
      <dc:creator>tbellmer</dc:creator>
      <dc:date>2011-02-10T15:37:30Z</dc:date>
    </item>
  </channel>
</rss>

