<?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 macro to subset one input dataset into many sub-datasets? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201673#M305956</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why does table one want to have four accounts when the other two only 2?&amp;nbsp; If it was standard logic then:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max(acct_num)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :tot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; have;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to &amp;amp;tot. by 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('data want'||strip(put(i,best.))||'; set have (where=(acct_num in ('||strip(put(i,best.))||','||strip(put(i+1,best.))||'))); run;');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The above will generate a datastep for each two acct_num's (note, I assume it to be even number, you may need a bit more code if its uneven).&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jun 2015 15:24:10 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-06-10T15:24:10Z</dc:date>
    <item>
      <title>Is it possible to use macro to subset one input dataset into many sub-datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201668#M305951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example, if we were to subset the following table into 3 datasets based on month_since_opened value, as in: table 1 contains account 1-4; table 2 contains account 5-6; table 3 contains account 7-8.&lt;/P&gt;&lt;P&gt;I understand that It is fairly easy to write out the data steps without using macro based on the example below. However, when there are hundreds of different values under the field, the code can become too long and not efficient. Not sure if macro can be used in this manner, as to create datasets in bundle?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 404px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="34" style="text-align: center;" width="106"&gt;Acct_num&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none;" width="106"&gt;month_since_opened&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none;" width="64"&gt;attribute1&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none;" width="64"&gt;attribute2&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="text-align: center; border-top: medium none;" width="106"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="106"&gt;8&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="text-align: center; border-top: medium none;" width="106"&gt;2&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="106"&gt;8&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="text-align: center; border-top: medium none;" width="106"&gt;3&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="106"&gt;8&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="text-align: center; border-top: medium none;" width="106"&gt;4&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="106"&gt;8&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="text-align: center; border-top: medium none;" width="106"&gt;5&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="106"&gt;7&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="text-align: center; border-top: medium none;" width="106"&gt;6&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="106"&gt;7&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="text-align: center; border-top: medium none;" width="106"&gt;7&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="106"&gt;6&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="text-align: center; border-top: medium none;" width="106"&gt;8&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="106"&gt;6&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;TD class="xl63" style="text-align: center; border-left: medium none; border-top: medium none;" width="64"&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 21:20:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201668#M305951</guid>
      <dc:creator>stlimpbizkit</dc:creator>
      <dc:date>2015-06-09T21:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use macro to subset one input dataset into many sub-datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201669#M305952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; This is certainly something you can do with Macro Language coding. You can also do it with Hash Tables.&lt;A href="http://www2.sas.com/proceedings/forum2008/029-2008.pdf" title="http://www2.sas.com/proceedings/forum2008/029-2008.pdf"&gt;http://www2.sas.com/proceedings/forum2008/029-2008.pdf&lt;/A&gt; See example 5. You might have to change the logic because her examples selects just distinct values.&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 03:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201669#M305952</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-06-10T03:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use macro to subset one input dataset into many sub-datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201670#M305953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%macro split_sets(dataset,splitvar);&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select distinct &amp;amp;splitvar into :value_list separated by " " from &amp;amp;dataset;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data&lt;/P&gt;&lt;P&gt;%let count=%sysfunc(countw(&amp;amp;value_list));&lt;/P&gt;&lt;P&gt;%do i = 1 %to &amp;amp;count;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let value=%qscan(&amp;amp;value_list,&amp;amp;i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; output_&amp;amp;value&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;set &amp;amp;dataset;&lt;/P&gt;&lt;P&gt;select(&amp;amp;splitvar);&lt;/P&gt;&lt;P&gt;%do i = 1 %to &amp;amp;count;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let value=%qscan(&amp;amp;value_list,&amp;amp;i);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; when (&amp;amp;value) output output_&amp;amp;value;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%split_sets(&lt;EM&gt;your_dataset_name,&lt;/EM&gt;month_since_opened);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want the macro to be able to also deal with character variables for the splitting, you either have to add the quotes manually in the "when" or provide additional code to do this automatically depending on the attributes of &amp;amp;splitvar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 06:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201670#M305953</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-06-10T06:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use macro to subset one input dataset into many sub-datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201671#M305954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are variable lists in the Sas language that can make the coding more comfortable.&lt;/P&gt;&lt;P&gt;Developing a macro can be countereffective by introducing more problems than it is solving.&lt;/P&gt;&lt;P&gt;All depends on your issue you are having&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 06:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201671#M305954</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-06-10T06:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use macro to subset one input dataset into many sub-datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201672#M305955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are lots of way to do that. But I prefer to Hash Table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 14:33:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201672#M305955</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-06-10T14:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use macro to subset one input dataset into many sub-datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201673#M305956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why does table one want to have four accounts when the other two only 2?&amp;nbsp; If it was standard logic then:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max(acct_num)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :tot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; have;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to &amp;amp;tot. by 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('data want'||strip(put(i,best.))||'; set have (where=(acct_num in ('||strip(put(i,best.))||','||strip(put(i+1,best.))||'))); run;');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The above will generate a datastep for each two acct_num's (note, I assume it to be even number, you may need a bit more code if its uneven).&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 15:24:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201673#M305956</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-06-10T15:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use macro to subset one input dataset into many sub-datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201674#M305957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hash table does it. Thanks for the article - one of the example cases included speak directly what I am trying to solve. I am keeping the rest for future reference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 15:54:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201674#M305957</guid>
      <dc:creator>stlimpbizkit</dc:creator>
      <dc:date>2015-06-10T15:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use macro to subset one input dataset into many sub-datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201675#M305958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope you like the simplicity of this approach.&amp;nbsp; The PROC SQL creates 2 macro variables that you can use in your datastep.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No Macro or Maco looping required.&amp;nbsp; Take out the INTO section of the PROC SQL to see what its creating in the macro variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data SAMPLE;&lt;BR /&gt;input month data;&amp;nbsp;&amp;nbsp; /* Stored a Number */&lt;BR /&gt;cards;&lt;BR /&gt;8 1111222233334444&lt;BR /&gt;2 2222333344445555&lt;BR /&gt;3 598758&lt;BR /&gt;5 598758321654&lt;BR /&gt;6 987654&lt;BR /&gt;8 598758&lt;BR /&gt;8 00005987581212&lt;BR /&gt;2 2371287598758222&lt;BR /&gt;;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;&amp;nbsp; select "DATASETNAME"!!put(TABLE,2.-L)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,"if MONTH = "!!put(MONTH,2.-L)!!" then output DATASETNAME"!!put(TABLE,2.-L)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; into :DATALINE separated by ' '&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,:SPLIT separated by ';'&lt;BR /&gt;&amp;nbsp; from ( select monotonic() as TABLE&lt;BR /&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; ,month&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from (select distinct month &lt;BR /&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; from SAMPLE))&lt;BR /&gt;;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data &amp;amp;DATALINE;&lt;BR /&gt;&amp;nbsp; set SAMPLE;&lt;BR /&gt;&amp;nbsp; &amp;amp;SPLIT;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 15:56:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201675#M305958</guid>
      <dc:creator>WUN</dc:creator>
      <dc:date>2015-06-10T15:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use macro to subset one input dataset into many sub-datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201676#M305959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks, I am keeping this for future reference. Am sure it will come in handy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2015 14:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-use-macro-to-subset-one-input-dataset-into/m-p/201676#M305959</guid>
      <dc:creator>stlimpbizkit</dc:creator>
      <dc:date>2015-06-16T14:08:39Z</dc:date>
    </item>
  </channel>
</rss>

