<?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 multiple folders in a folder in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907628#M358270</link>
    <description>&lt;P&gt;Why do you want to split your SAS data into separate folders based on fruit and vegetable type? It would be a whole lot easier just to have one folder and have one type per dataset, or even better just have multi-type datasets with a column identifying the fruit or vegetable type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All you are doing is making your programming a lot harder than it needs to be.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2023 19:08:58 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2023-12-12T19:08:58Z</dc:date>
    <item>
      <title>Create multiple folders in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907514#M358225</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;I wanna create multiples folders within tow other folders like:&lt;BR /&gt;Path = C:\store\&lt;/P&gt;&lt;P&gt;PathFruits: '&amp;amp;Path.\fruit\&amp;lt;all kinds&amp;gt;&lt;/P&gt;&lt;P&gt;PathVegetables: '&amp;amp;Path\veg\&amp;lt;all kind&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where &amp;lt;all kinds fruits&amp;gt; goes from |apples , |orange, |pinapple|&lt;/P&gt;&lt;P&gt;and&amp;nbsp;where &amp;lt;all kinds veggies&amp;gt; goes from | cucumber , | salad , | tomato |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;intestead of doing the per row, repeating it?&amp;nbsp;&lt;BR /&gt;PathFruits: '&amp;amp;Path.\fruit\apples&lt;/P&gt;&lt;P&gt;'&amp;amp;Path.\fruit\orang&lt;/P&gt;&lt;P&gt;,.....,&lt;/P&gt;&lt;P&gt;'&amp;amp;Path.\fruit\veggies\tomato&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have like,, 10*2 =&amp;gt; 20 rows of this, and I think it is just ugly xD&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 12:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907514#M358225</guid>
      <dc:creator>melhaf</dc:creator>
      <dc:date>2023-12-12T12:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple folders in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907517#M358227</link>
      <description>&lt;P&gt;It's really unclear to me what you are doing, its unclear to me what your question is, and its also unclear to me where your data is that you are working from.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;In addition to writing a much more clear problem statement, could you please show us the data you are working from? Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 12:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907517#M358227</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-12-12T12:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple folders in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907520#M358228</link>
      <description>&lt;P&gt;I would go with the &lt;A title="https://github.com/SASPAC/macroarray" href="https://github.com/SASPAC/macroarray" target="_self"&gt;macroArray&lt;/A&gt; package:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename packages "C:\SAS_WORK\SAS_PACKAGES";
%include packages(SPFINIT.sas);

%loadPackage(macroArray)


/* set macro arrays */
%array(store[*] fruits veggies, vnames=Y, macarray=Y)
%array(fruits[*] apples orange pinapple, vnames=Y, macarray=Y)
%array(veggies[*] cucumber salad tomato, vnames=Y, macarray=Y)


options DLcreateDIR;
%let path = R:\store\;
libname _ "&amp;amp;path.";
libname _ list;

/* make store level dirs */
%do_over(store, phrase=%nrstr(
 libname _ "&amp;amp;path.\%store(&amp;amp;_i_)";
 libname _ list;
))

/* make fruits */
%do_over(fruits, phrase=%nrstr(
 libname _ "&amp;amp;path.\%store(1)\%fruits(&amp;amp;_i_)";
 libname _ list;
))

/* make veggies */
%do_over(veggies, phrase=%nrstr(
 libname _ "&amp;amp;path.\%store(2)\%veggies(&amp;amp;_i_)";
 libname _ list;
))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S. To install and use macroArray package do:&lt;/P&gt;
&lt;UL dir="auto"&gt;
&lt;LI&gt;Enable the framework [first time only]:&lt;/LI&gt;
&lt;LI&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;filename SPFinit url "https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.sas";
%include SPFinit; /* enable the framework */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;Install the framework and the package on your machine in the folder you created:&lt;/LI&gt;
&lt;LI&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;filename packages "&amp;lt;/your/directory/for/packages/&amp;gt;"; 
%installPackage(SPFinit macroArray) &lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;From now on, in your SAS session just run it like this:&lt;/LI&gt;
&lt;LI&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;filename packages "&amp;lt;/your/directory/for/packages/&amp;gt;";
%include packages(SPFinit.sas);

%loadPackage(packageName)  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;A title="https://github.com/yabwon/SAS_PACKAGES?tab=readme-ov-file#the-user" href="https://github.com/yabwon/SAS_PACKAGES?tab=readme-ov-file#the-user" target="_self" rel="nofollow noopener noreferrer"&gt;Link to details&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 12:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907520#M358228</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-12T12:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple folders in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907563#M358245</link>
      <description>&lt;P&gt;If your aim is creating multiple directories (including subfolders) to store datasets, use LIBNAME statement with sas system option&amp;nbsp;&lt;CODE class=" language-sas"&gt;dlcreatedir:&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options dlcreatedir;
	*multiple statements; 
	libname fruits "C:\store\fruit";
	libname fruits "C:\store\fruit\apples";
	libname fruits "C:\store\fruit\orange";

	libname veggies "C:\store\veg";
	libname veggies "C:\store\veg\tomato";
	libname veggies "C:\store\veg\cucumber";

	*single statement; 
	libname folders ("&amp;amp;path.\fruit", "&amp;amp;path.\fruit\apples", "&amp;amp;path.\fruit\orange", "&amp;amp;path.\fruit\bananas"); 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Dec 2023 14:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907563#M358245</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2023-12-12T14:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple folders in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907570#M358247</link>
      <description>&lt;P&gt;Good point to make it with 1 LIBNAME statement!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Version with macro arrays:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options DLcreateDIR;
%let path = R:\store\;
libname _ 
(
"&amp;amp;path."

/* make store level dirs */
%do_over(store, phrase=%nrstr(
"&amp;amp;path.\%store(&amp;amp;_i_)"
))

/* make fruits */
%do_over(fruits, phrase=%nrstr(
"&amp;amp;path.\%store(1)\%fruits(&amp;amp;_i_)"
))

/* make veggies */
%do_over(veggies, phrase=%nrstr(
"&amp;amp;path.\%store(2)\%veggies(&amp;amp;_i_)"
))

);
libname _ list;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 15:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907570#M358247</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-12T15:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple folders in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907575#M358250</link>
      <description>Sorry, konfidential. Was trying to do it more 'univarsal'</description>
      <pubDate>Tue, 12 Dec 2023 15:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907575#M358250</guid>
      <dc:creator>melhaf</dc:creator>
      <dc:date>2023-12-12T15:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple folders in a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907628#M358270</link>
      <description>&lt;P&gt;Why do you want to split your SAS data into separate folders based on fruit and vegetable type? It would be a whole lot easier just to have one folder and have one type per dataset, or even better just have multi-type datasets with a column identifying the fruit or vegetable type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All you are doing is making your programming a lot harder than it needs to be.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 19:08:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-folders-in-a-folder/m-p/907628#M358270</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-12-12T19:08:58Z</dc:date>
    </item>
  </channel>
</rss>

