<?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 fill in the missing rows? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126168#M34663</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What would be your best guess if you had to discover it by yourself?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Nov 2012 14:22:18 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2012-11-14T14:22:18Z</dc:date>
    <item>
      <title>how to fill in the missing rows?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126164#M34659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have data below, customer id and the mth from 201201 to 201210 but some customers got missing mth.&lt;/P&gt;&lt;P&gt;I want the output to be each customer have 10 rows from 201201 to 201210.&lt;/P&gt;&lt;P&gt;Any advices how to handle this please? Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input id $ yymm $;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;aaaaa 201201&lt;/P&gt;&lt;P&gt;aaaaa 201202&lt;/P&gt;&lt;P&gt;aaaaa 201204&lt;/P&gt;&lt;P&gt;aaaaa 201205&lt;/P&gt;&lt;P&gt;aaaaa 201207&lt;/P&gt;&lt;P&gt;bbbbb 201201&lt;/P&gt;&lt;P&gt;bbbbb 201203&lt;/P&gt;&lt;P&gt;bbbbb 201206&lt;/P&gt;&lt;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t;&lt;TD&gt;201208&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ccccc&lt;/TD&gt;&lt;TD&gt;201209&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ccccc&lt;/TD&gt;&lt;TD&gt;201210&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 13:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126164#M34659</guid>
      <dc:creator>pravin</dc:creator>
      <dc:date>2012-11-14T13:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to fill in the missing rows?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126165#M34660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There will be many fancy ways to do the same job, if your request is just as simple as being presented, the simplest approach I can think of is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input id $ yymm $;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;aaaaa 201201&lt;/P&gt;&lt;P&gt;aaaaa 201202&lt;/P&gt;&lt;P&gt;aaaaa 201204&lt;/P&gt;&lt;P&gt;aaaaa 201205&lt;/P&gt;&lt;P&gt;aaaaa 201207&lt;/P&gt;&lt;P&gt;bbbbb 201201&lt;/P&gt;&lt;P&gt;bbbbb 201203&lt;/P&gt;&lt;P&gt;bbbbb 201206&lt;/P&gt;&lt;P&gt;ccccc .&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;data h1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have(keep=id);&lt;/P&gt;&lt;P&gt;&amp;nbsp; by id notsorted;&lt;/P&gt;&lt;P&gt;if first.id;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set h1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do _yymm=201201 to 201210;&lt;/P&gt;&lt;P&gt;yymm=put(_yymm,6.);&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;drop _:;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 13:53:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126165#M34660</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-11-14T13:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to fill in the missing rows?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126166#M34661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select distinct customer_id&lt;/P&gt;&lt;P&gt;The data step with a do-loop, that outputs one row per year and Customer_id.&lt;/P&gt;&lt;P&gt;And then outer join back with original data (if it has some more columns you needed).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 13:53:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126166#M34661</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2012-11-14T13:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to fill in the missing rows?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126167#M34662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks, how about if i want the year from 201101 to 201210?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 14:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126167#M34662</guid>
      <dc:creator>pravin</dc:creator>
      <dc:date>2012-11-14T14:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to fill in the missing rows?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126168#M34663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What would be your best guess if you had to discover it by yourself?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 14:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126168#M34663</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-11-14T14:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to fill in the missing rows?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126169#M34664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Come on, Art, Give OP a break.&amp;nbsp; I think this would be a little harder for OP, either you want to go ugly doing two loops ( do 201101 to 201112; do 201201 to 201210); or you need to involve those time interval functions. So here is the latter approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set h1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do n=0 to intck('month',input('201101',yymmn6.) ,input('201210',yymmn6.));&lt;/P&gt;&lt;P&gt;_yymm=intnx('month',input('201101',yymmn6.),n);&lt;/P&gt;&lt;P&gt;yymm=put(_yymm, yymmn6.);&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;drop _:;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&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>Wed, 14 Nov 2012 15:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126169#M34664</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-11-14T15:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to fill in the missing rows?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126170#M34665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&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;: Not trying to be difficult, but I like to see posters at least attempt a solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2012 15:39:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126170#M34665</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-11-14T15:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to fill in the missing rows?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126171#M34666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art, there is no doubt that you are THE nicest guy on the forum. That is why I 'd like messing with you once for a while. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&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>Wed, 14 Nov 2012 15:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-fill-in-the-missing-rows/m-p/126171#M34666</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-11-14T15:54:13Z</dc:date>
    </item>
  </channel>
</rss>

