<?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 delete leading missing values in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/delete-leading-missing-values/m-p/43264#M11282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, is there a way to delete leading missing values from a dataset, with by groupings.&amp;nbsp; So I have a large dataset by postal codes and car prices, and car models.&amp;nbsp; certain car models werent built until certain years while others go way back.. I don't want to delete all missing since I need the missing values in between that I just don't have any prices for.&amp;nbsp; Just the leading missing whenever they had happend for each model.&amp;nbsp; thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Feb 2012 15:28:33 GMT</pubDate>
    <dc:creator>podarum</dc:creator>
    <dc:date>2012-02-01T15:28:33Z</dc:date>
    <item>
      <title>delete leading missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-leading-missing-values/m-p/43264#M11282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, is there a way to delete leading missing values from a dataset, with by groupings.&amp;nbsp; So I have a large dataset by postal codes and car prices, and car models.&amp;nbsp; certain car models werent built until certain years while others go way back.. I don't want to delete all missing since I need the missing values in between that I just don't have any prices for.&amp;nbsp; Just the leading missing whenever they had happend for each model.&amp;nbsp; thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 15:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-leading-missing-values/m-p/43264#M11282</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-02-01T15:28:33Z</dc:date>
    </item>
    <item>
      <title>delete leading missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-leading-missing-values/m-p/43265#M11283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide an example of what your records currently look like and how you want them to look after being manipulated?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 16:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-leading-missing-values/m-p/43265#M11283</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-01T16:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: delete leading missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-leading-missing-values/m-p/43266#M11284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;podarum,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sounds like this is what you are trying to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=my_data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by postal_code car_model time_period;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data remove_missings;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set my_data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; by postal_code car_model;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; retain keep_deleting;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if first.car_model then keep_deleting='Y';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if car_price=. then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if keep_deleting='Y' then delete;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else keep_deleting='N';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; drop keep_deleting;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if you need postal_code in the logic or not ... depends on what you are trying to accomplish.&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>Wed, 01 Feb 2012 16:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-leading-missing-values/m-p/43266#M11284</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-02-01T16:22:08Z</dc:date>
    </item>
    <item>
      <title>delete leading missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-leading-missing-values/m-p/43267#M11285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Art,&lt;/P&gt;&lt;P&gt;I just realized that if I wanted to keep all variables in the same dataset, then the oldest value is the one that belongs to the first non-missing date. All the others that are also in the dataset will have a missing value (if they don't have any data) starting from that same date. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2012 16:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-leading-missing-values/m-p/43267#M11285</guid>
      <dc:creator>podarum</dc:creator>
      <dc:date>2012-02-01T16:44:08Z</dc:date>
    </item>
    <item>
      <title>delete leading missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/delete-leading-missing-values/m-p/43268#M11286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello -&lt;/P&gt;&lt;P&gt;I might be wrong, but this question seems to be related to your post: &lt;A _jive_internal="true" href="https://communities.sas.com/message/114872#114872"&gt;http://communities.sas.com/message/114872#114872&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Again I believe that PROC TIMESERIES (of SAS/ETS) could be of interest, since the start date variable in the OUTSUM data set tells you when the first nonmissing observation per BY group occurred. &lt;/P&gt;&lt;P&gt;Then it should be easy to delete these observations from your original data set.&lt;/P&gt;&lt;P&gt;Hope this makes sense.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Udo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 23:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/delete-leading-missing-values/m-p/43268#M11286</guid>
      <dc:creator>udo_sas</dc:creator>
      <dc:date>2012-02-02T23:04:32Z</dc:date>
    </item>
  </channel>
</rss>

