<?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 create sub-datasets based on a class variable? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108285#M291965</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aggreed, its not without limitation.&amp;nbsp; Let me relabel it Fairly generic. .. &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Aug 2013 08:09:13 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2013-08-13T08:09:13Z</dc:date>
    <item>
      <title>How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108264#M291944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Suppose an original data has a class variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;input CLASS VAR;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 1&lt;/P&gt;&lt;P&gt;1 2&lt;/P&gt;&lt;P&gt;1 .&lt;/P&gt;&lt;P&gt;2 3&lt;/P&gt;&lt;P&gt;2 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I create sub-datasets based on the CLASS variable in a rapid way? The above data should produce two sub-datasets that look like:&lt;/P&gt;&lt;P&gt;- Sub-dataset1:&lt;/P&gt;&lt;P&gt;CLASS VAR&lt;/P&gt;&lt;P&gt;1 1&lt;/P&gt;&lt;P&gt;1 2&lt;/P&gt;&lt;P&gt;1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Sub-dataset2:&lt;/P&gt;&lt;P&gt;CLASS VAR&lt;/P&gt;&lt;P&gt;2 3&lt;/P&gt;&lt;P&gt;2 6&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 00:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108264#M291944</guid>
      <dc:creator>NonSleeper</dc:creator>
      <dc:date>2013-08-12T00:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108265#M291945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of a dynamic options could be Hash(), if your data is sorted by class or at least clustered by class:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; CLASS VAR;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 .&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;2 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;2 6&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; _n_=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;declare&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; hash h();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; h.definekey(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'_n_'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; h.definedata(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'class'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'var'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h.definedone();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; class &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;notsorted&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; rc=h.replace();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; last.class &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; rc=h.output(dataset:cats(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'class_'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,class));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; rc=h.clear();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Haikuo&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 00:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108265#M291945</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-08-12T00:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108266#M291946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET HAVE END=EOF;&lt;/P&gt;&lt;P&gt;&amp;nbsp; BY CLASS;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF FIRST.CLASS;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CALL EXECUTE(COMPBL("DATA CLASS_" || COMPRESS(CLASS) || "; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET HAVE (WHERE = (CLASS =" || CLASS || ")); &lt;/P&gt;&lt;P&gt;&amp;nbsp; RUN;"));&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 03:35:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108266#M291946</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-08-12T03:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108267#M291947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Scott, Did I miss something?&amp;nbsp; Wa there a change in Call execute...&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Call_Execute_in_the_Data_Step" title="http://www.sascommunity.org/wiki/Call_Execute_in_the_Data_Step"&gt;http://www.sascommunity.org/wiki/Call_Execute_in_the_Data_Step&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 05:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108267#M291947</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-08-12T05:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108268#M291948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Jaap,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what you are querying.&amp;nbsp; If you run the previously attached code you will see the following in the log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GOPTIONS ACCESSIBLE;&lt;/P&gt;&lt;P&gt;15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATA WANT;&lt;/P&gt;&lt;P&gt;16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET HAVE END=EOF;&lt;/P&gt;&lt;P&gt;17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BY CLASS;&lt;/P&gt;&lt;P&gt;18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF FIRST.CLASS;&lt;/P&gt;&lt;P&gt;19&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL EXECUTE(COMPBL("DATA CLASS_" || COMPRESS(CLASS) || ";&lt;/P&gt;&lt;P&gt;20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET HAVE (WHERE = (CLASS =" || CLASS || "));&lt;/P&gt;&lt;P&gt;21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;"));&lt;/P&gt;&lt;P&gt;22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Numeric values have been converted to character values at the places given by: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Line):(Column).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 19:48&amp;nbsp;&amp;nbsp; 20:55&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;NOTE: There were 50 observations read from the data set WORK.HAVE.&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.WANT has 10 observations and 501 variables.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: CALL EXECUTE generated line.&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + DATA CLASS_1;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET HAVE (WHERE = (CLASS = 1));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: There were 5 observations read from the data set WORK.HAVE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE class="1";&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.CLASS_1 has 5 observations and 501 variables.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + DATA CLASS_2;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET HAVE (WHERE = (CLASS = 2));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: There were 5 observations read from the data set WORK.HAVE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE class="2";&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.CLASS_2 has 5 observations and 501 variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This suggests that each datastep created via CALL EXECUTE is executed following the completion of the _NULL_ datastep, which is what this article is pointing out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 07:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108268#M291948</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-08-12T07:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108269#M291949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@ Scott, Ok I see your approach.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;It is generating possible a lot of new data-step-s each selecting one part and creating one datastep each. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking of a lot of SAS-datasets being created while reading, in one pass!,&amp;nbsp; the input (performance reasons).&lt;/P&gt;&lt;P&gt;This feature of splitting data in sas-data step is rather unique.&amp;nbsp; &lt;/P&gt;&lt;P&gt;That is requiring:&lt;/P&gt;&lt;P&gt;- a list of the to be created datasets (defnition part)&lt;/P&gt;&lt;P&gt;- a list of the output statements in a selection&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 09:15:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108269#M291949</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-08-12T09:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108270#M291950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;Here is my try by using macro...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;STRONG&gt;&lt;EM&gt;test&lt;/EM&gt;&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp; proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct class into :list separated by &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;"?"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select count(distinct class) into :tot&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp; quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; i = &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%to&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal;"&gt;tot.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data data&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal;"&gt;i.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if class = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%scan&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;(&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal;"&gt;list.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;,&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal;"&gt;i.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple;"&gt;"?"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;%&lt;STRONG&gt;&lt;EM&gt;test&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;&lt;STRONG&gt;&lt;EM&gt;-Urvish&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 11:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108270#M291950</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-08-12T11:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108271#M291951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I see solutions that use MACROs, that use CALL EXECUTE, that use hash(), but I don't see a simple data step solution, such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data subdataset1 subdataset2;&lt;/P&gt;&lt;P&gt;input CLASS VAR;&lt;/P&gt;&lt;P&gt;if class=1 then output subdataset1;&lt;/P&gt;&lt;P&gt;else if class=2 then output subdataset2;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 1&lt;/P&gt;&lt;P&gt;1 2&lt;/P&gt;&lt;P&gt;1 .&lt;/P&gt;&lt;P&gt;2 3&lt;/P&gt;&lt;P&gt;2 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I missing? This works perfectly. Why resort to complicated SAS structures for what is obviously a beginner problem, when the most basic SAS structure (a data set) works fine?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 13:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108271#M291951</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2013-08-12T13:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108272#M291952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paigemiller, You are missing nothing, perhaps some minor requirements.&lt;BR /&gt;- Are the subclasses known? If No than is needed some addtional logic.&lt;/P&gt;&lt;P&gt;- Is the question about quick and easy coding or about a well performing behavior on bigger datasets.&lt;/P&gt;&lt;P&gt;- ... (minor)&lt;/P&gt;&lt;P&gt;Your approach is the most easy to understand that will deliver reliable and the best performance.&lt;/P&gt;&lt;P&gt;Indeed why should it made more complicated as needed. KISS.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 13:48:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108272#M291952</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-08-12T13:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108273#M291953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not very dynamic, is it...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A version of Urvish macro solution which should be slightly more efficient (fewer passes through the data):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro test;&lt;/P&gt;&lt;P&gt; proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select distinct catx('_','T',class), &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class &lt;BR /&gt;&amp;nbsp; into :table_list separated by ' ', :list separated by ' '&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from temp;&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select count(distinct class) into :tot&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from temp; &lt;BR /&gt; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data &amp;amp;table_list.;&lt;BR /&gt; set temp;&lt;BR /&gt;&amp;nbsp; select(class);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %do i = 1 %to &amp;amp;tot.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; when(%scan(&amp;amp;list.,&amp;amp;i.)) output %scan(&amp;amp;table_list.,&amp;amp;i); &lt;BR /&gt;&amp;nbsp; %end;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; otherwise;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt; run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%test&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 13:49:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108273#M291953</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-08-12T13:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108274#M291954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;It's not very dynamic, is it...?&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At no point did the original question ask for a dynamic solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;A version of Urvish macro solution which should be slightly more efficient (fewer passes through the data):&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;I'm not grasping why you say this. My solution requires one pass through the data. Your solution requires n passes through the data, if there are n different values of CLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree that all of the above solutions work. Since it appears to me that a beginner has asked a relative simple question, I cannot see the benefit of a complex answer when a simple answer suffices. I think that's called Occam's toothbrush.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 13:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108274#M291954</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2013-08-12T13:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108275#M291955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We often urge to have questions simplified so that they could be easily understood. The real life problem often has much more complex data. Therefore I suggested a more generic solution.&lt;/P&gt;&lt;P&gt;I did mean that my macro was slightly more efficient than Urvish (maybe I should put that in a separate post, sorry if I seemed rude). My code has 3 passes of the data, since Urvish had 2 + no distinct values of CLASS.&lt;/P&gt;&lt;P&gt;Razor :smileyconfused:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 14:36:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108275#M291955</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-08-12T14:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108276#M291956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="9481" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;It is not uncommon that the examples presented in original posts are highly simplified. Many, including me, do believe it is also the case for this one, even though OP did not explicitly spell it out. This will also involve how you define a practical "robustness". What if you don't know the value of "class"? what if "class" has 10,000 distinct values? These are legitimate&amp;nbsp; questions that deserver more consideration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 14:36:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108276#M291956</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-08-12T14:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108277#M291957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Valid points by &lt;A __default_attr="119192" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; and &lt;A __default_attr="5068" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;, however it seems to me you might want to explicitly state that this is a "generic" solution that will work in all examples, even if there are an unknown number of CLASS distinct values. If the question was from someone who truly is a beginner asking a beginner question, then I think you have confused this person.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 14:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108277#M291957</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2013-08-12T14:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108278#M291958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="119192" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In deed your approach is in general more efficient comparing to &lt;A __default_attr="2503" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;, one caveat though,&amp;nbsp;&amp;nbsp; 'table_list' has be shorter then 65k. &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 14:47:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108278#M291958</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-08-12T14:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108279#M291959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Agreed. Although I believe all of us volunteering on this forum are trying our best, but there always is room of improvement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 14:51:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108279#M291959</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-08-12T14:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108280#M291960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys, No need for a fire.&lt;BR /&gt;Many times it can also make fun just playing arround with the options and being inventive.&lt;BR /&gt;Learning from each other.&amp;nbsp; There are a lot hidden parts even if you think you knew all.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way... where is "nonsleeper" seems to be sleeping&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 14:51:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108280#M291960</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2013-08-12T14:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108281#M291961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOL. I see no fire, just some sparkles of thoughts. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 14:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108281#M291961</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-08-12T14:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108282#M291962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would at this point also ask, what is being done with the subsets? It may be that analysis could very well be done using the CLASS statement in an analysis procedure and no need for separate datasets.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Aug 2013 17:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108282#M291962</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-08-12T17:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sub-datasets based on a class variable?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108283#M291963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="9481" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it is important to understand that there is no possible way that we can understand every limitation imposed upon the OP.&amp;nbsp; I think we should provide as many solutions as possible so that the OP can test each scenario on their particular system in their particular workplace for their particular input dataset.&amp;nbsp; &lt;A __default_attr="4063" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt;'s solution is easily best combination of flexibility and efficiency - however I have worked in teams where the Manager refused to allow us to use HASH OBJECTS because he didn't understand them, a similar restriction was applied to SQL by another manager I worked for, therefore CALL EXECUTE, although less efficient in many instances - it can be slightly more efficient with smaller datasets - allowed me to work around these issues.&amp;nbsp; Furthermore, I have had a few issues with HASH OBJECTS and memory that I couldn't work around or that made the process less efficient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is now up to the OP to decide what method suits their particular circumstances.&amp;nbsp; Hopefully his request allows him to use a simple datastep as you have suggested, but in case it isn't, he has plenty to work with and test from the above contributors.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 01:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-sub-datasets-based-on-a-class-variable/m-p/108283#M291963</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-08-13T01:58:18Z</dc:date>
    </item>
  </channel>
</rss>

