<?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: Automated creation of datasets in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Automated-creation-of-datasets/m-p/428192#M68510</link>
    <description>&lt;P&gt;Maybe rather than talk about automatic creation, let's talk about creating an Excel file with a Tab for each group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html#data" target="_blank"&gt;https://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html#data&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the example above - run it! And then you can use ODS EXCEL (SAS 9.4+) to create a native Excel file with a sheet for each BY group by default.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2018 22:13:44 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-01-16T22:13:44Z</dc:date>
    <item>
      <title>Automated creation of datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Automated-creation-of-datasets/m-p/428172#M68505</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; states;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; states1;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000" face="Courier New" size="3"&gt;sample&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; output&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;State id&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;AK &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;111&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;AL &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;122&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;CA &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;131&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data AK AL CA;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; states;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; state = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'AK'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; then output ala;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; state = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'AL'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; then output AL;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; state = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'CA'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; then output CA;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;etc.....to all 50 states&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;1.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; I want to create a&amp;nbsp;dataset for each &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;state and eventually create a separate output tab report for each.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; If the state pulls no record I want a blank dataset with the states name &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;STRONG&gt;2.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Is there a way to loop through this without manually creating &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;50&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; datasets as shown here&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 21:21:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Automated-creation-of-datasets/m-p/428172#M68505</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2018-01-16T21:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Automated creation of datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Automated-creation-of-datasets/m-p/428176#M68506</link>
      <description>&lt;P&gt;If you keep all the data in a single data set, and use the BY statement, you can do all of your analyses by state.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To create different tabs (do you mean Excel tabs?), I think you'd have to do some sort of looping in a macro. Even then, manual creation of datasets, or even a manual creation of the list of states, is not necessary.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 21:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Automated-creation-of-datasets/m-p/428176#M68506</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-01-16T21:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Automated creation of datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Automated-creation-of-datasets/m-p/428180#M68507</link>
      <description>&lt;P&gt;This topic is well covered in this post.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Split_Data_into_Subsets" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.sascommunity.org/wiki/Split_Data_into_Subsets&lt;/A&gt;&lt;/P&gt;&lt;P&gt;or here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Courtesy of&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;, I got those 2 links from this&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/A-better-way-to-create-subgroups/m-p/426628#M68366" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/A-better-way-to-create-subgroups/m-p/426628#M68366&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 21:33:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Automated-creation-of-datasets/m-p/428180#M68507</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-16T21:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Automated creation of datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Automated-creation-of-datasets/m-p/428182#M68508</link>
      <description>&lt;P&gt;Ooh, I like it, especially the section entitled&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Practice: Just Don't Do It&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 21:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Automated-creation-of-datasets/m-p/428182#M68508</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-01-16T21:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Automated creation of datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Automated-creation-of-datasets/m-p/428192#M68510</link>
      <description>&lt;P&gt;Maybe rather than talk about automatic creation, let's talk about creating an Excel file with a Tab for each group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html#data" target="_blank"&gt;https://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html#data&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the example above - run it! And then you can use ODS EXCEL (SAS 9.4+) to create a native Excel file with a sheet for each BY group by default.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 22:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Automated-creation-of-datasets/m-p/428192#M68510</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-16T22:13:44Z</dc:date>
    </item>
  </channel>
</rss>

