<?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: Segment dataset into separate dataset based on date extension in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Segment-dataset-into-separate-dataset-based-on-date-extension/m-p/212080#M39205</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Macros are not the answer here.&amp;nbsp; You need to be able to write a successful program without using macros first.&amp;nbsp; Once you have that part working correctly, writing the macro will be easy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jun 2015 13:18:43 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2015-06-23T13:18:43Z</dc:date>
    <item>
      <title>Segment dataset into separate dataset based on date extension</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Segment-dataset-into-separate-dataset-based-on-date-extension/m-p/212079#M39204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test as&lt;/P&gt;&lt;P&gt;select ln,monthyr&lt;/P&gt;&lt;P&gt;from test99;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;sample output&lt;/P&gt;&lt;P&gt;ln&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; monthyr&lt;/P&gt;&lt;P&gt;11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201502&lt;/P&gt;&lt;P&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201503&lt;/P&gt;&lt;P&gt;13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201504&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I performed a macro to segment each dataset into its own dataset&lt;/P&gt;&lt;P&gt;%macro (monthyr);&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test11_&amp;amp;monthyr as&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from test;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;The objective is to create something like this&lt;/P&gt;&lt;P&gt;test11_201502&lt;/P&gt;&lt;P&gt;test11_201503&amp;nbsp; etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code runs however no segmenting occurs.&amp;nbsp; What is the issue with my code.&amp;nbsp; I am somewhat new to macro building.&amp;nbsp; Note MonthYr is a date data type&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 13:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Segment-dataset-into-separate-dataset-based-on-date-extension/m-p/212079#M39204</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2015-06-23T13:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Segment dataset into separate dataset based on date extension</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Segment-dataset-into-separate-dataset-based-on-date-extension/m-p/212080#M39205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Macros are not the answer here.&amp;nbsp; You need to be able to write a successful program without using macros first.&amp;nbsp; Once you have that part working correctly, writing the macro will be easy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 13:18:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Segment-dataset-into-separate-dataset-based-on-date-extension/m-p/212080#M39205</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-06-23T13:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Segment dataset into separate dataset based on date extension</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Segment-dataset-into-separate-dataset-based-on-date-extension/m-p/212081#M39206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you looking to filter each of your data sets (test11_201502, test11_201503, etc..) only by the monthyr variable?&amp;nbsp; Otherwise I would agree, a macro is not what you're looking for.&amp;nbsp; You could loop through each individual monthyr variable one at a time to create the data set names you want, but with the code provided, you will just have the same data in each data set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jun 2015 13:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Segment-dataset-into-separate-dataset-based-on-date-extension/m-p/212081#M39206</guid>
      <dc:creator>dcruik</dc:creator>
      <dc:date>2015-06-23T13:21:18Z</dc:date>
    </item>
  </channel>
</rss>

