<?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: Trimming the top and bottom 1% of data in PROC SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152311#M262586</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I concur with all of the reasons that others have given, re: using PROC RANK, etc. PROC RANK is preferable hands down. However, I just want to point out that your original question was how to use PROC SQL to trim variables based on their ranking.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jan 2014 19:12:15 GMT</pubDate>
    <dc:creator>Fugue</dc:creator>
    <dc:date>2014-01-27T19:12:15Z</dc:date>
    <item>
      <title>Trimming the top and bottom 1% of data in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152301#M262576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all so much for your help lately, forum members.&amp;nbsp; I really appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a large set of data that is sorted by a variable, and I would like to exclude the top 1% and bottom 1% of the data based on this ranking.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table rank as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select var&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order by var;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do I need in there to get rid of the top 1% and bottom 1% of that ordering?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 15:52:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152301#M262576</guid>
      <dc:creator>mahler_ji</dc:creator>
      <dc:date>2014-01-24T15:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming the top and bottom 1% of data in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152302#M262577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can create a step that figures out the no of observations, which will let you know how many rows 1% are. Hint, you may use the ATTRN function.&lt;/P&gt;&lt;P&gt;Then use FIRSTOBS= and OBS= data step options to filter your data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 16:20:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152302#M262577</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-01-24T16:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming the top and bottom 1% of data in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152303#M262578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc rank would simply fit your need.&lt;/P&gt;&lt;P&gt;There is my own code template:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt;/*** get percentile ***/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt;/* groups = 100 for percentile (new percentile variable is 0-99)*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt;/* for INSERTING a rank variable to the original table,&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt; just let &amp;lt;dataset_in&amp;gt; = &amp;lt;dataset_out&amp;gt; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: navy; background: white;"&gt;proc&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: navy; background: white;"&gt;rank&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;=&amp;lt;dataset_in&amp;gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;groups&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: teal; background: white;"&gt;100&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;out&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;=&amp;lt;dataset_out&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;var&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; &amp;lt;var1 var2 &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: teal; background: white;"&gt;...&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; &amp;lt;grouping_vars&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;ranks&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; &amp;lt;percentile1 percentile2 &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: teal; background: white;"&gt;...&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;&amp;gt;; &lt;SPAN style="color: #008000; font-family: Consolas; background-color: #ffffff;"&gt;/*variable names of percentile variables*/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: navy; background: white;"&gt;run&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;In case of frequent ties or varying filter values, consider the following more general code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt;/* fractional rank */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt;* Note:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt;* (1) fraction: output fractional rank divided by NObs&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nplus1: fractional rank divided by NObs+1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt;* (2) ties=mean: output average rank value for ties;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: navy; background: white;"&gt;proc&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: navy; background: white;"&gt;rank&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;=&amp;lt;in_data&amp;gt; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;Nplus1&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;ties&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;=mean &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;out&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;=&amp;lt;out_data&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;var&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; &amp;lt;x y ...&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; &amp;lt;Grouping_Vars&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;ranks&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; &amp;lt;x_rnk y_rnk ...&amp;gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: navy; background: white;"&gt;run&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;After ranking, you can easily delete the unwanted value in later data steps. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;(e.g. if x_rnk&amp;gt;0.99 or x_rnk&amp;lt;0.01 then delete;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;Bill&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 16:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152303#M262578</guid>
      <dc:creator>bill0101</dc:creator>
      <dc:date>2014-01-24T16:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming the top and bottom 1% of data in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152304#M262579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your variable is normally distributed, and you have a sufficiently large enough dataset, you could simply use SQL to select those records whose values for that variable falls within -2.06 and +2.06 standard deviations from the mean.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 16:39:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152304#M262579</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-01-24T16:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming the top and bottom 1% of data in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152305#M262580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The most concise way to trim a sorted dataset is probably utilizing set option Nobs= .&lt;/P&gt;&lt;P&gt;However, I do not recommend doing this for 2 reasons:&lt;/P&gt;&lt;P&gt;(1) In many cases, especially for finance researches, ranking or grouping is still needed in further analyses.&lt;/P&gt;&lt;P&gt;(2) For nominal or ordinal ranking variables, ties must be treated carefully. Proc rank provides all the fancy options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reference, there is my working test code. You can see that it does trim 1000 records to 980.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt;/* generate a dataset with 1000 records */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: navy; background: white;"&gt;data&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; a; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; ID=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: teal; background: white;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;to&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: teal; background: white;"&gt;10&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;;&lt;/SPAN&gt;&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; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; x=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: teal; background: white;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;to&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: teal; background: white;"&gt;100&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;;&lt;/SPAN&gt;&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; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;;&lt;/SPAN&gt;&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; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; trim=0.01; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt;/* trim ratio */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt;/* conditional output using set option Nobs= */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: navy; background: white;"&gt;data&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; b;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; a Nobs=NN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt; &amp;amp;trim*NN &amp;lt; _N_ &amp;lt;= (&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: teal; background: white;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;-&amp;amp;trim)*NN &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: blue; background: white;"&gt;run&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: black; background: white;"&gt;; &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: Consolas; color: green; background: white;"&gt;*expect 980 records in b;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 17:32:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152305#M262580</guid>
      <dc:creator>bill0101</dc:creator>
      <dc:date>2014-01-24T17:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming the top and bottom 1% of data in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152306#M262581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Linus.&amp;nbsp; If by "top and bottom 1%" you mean by data volume rather than data distribution, then just derive the first and last obs for that percentage.&amp;nbsp; I'd think this would perform much faster than PROC RANK for large datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this (code untested, so just use it as a guide):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if 0 then set sashelp.zipcode nobs=nobs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symputx("first",int(1/nobs));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symputx("last",int( (1/nobs) * 99));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data trimmed;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.zipcode firstobs=&amp;amp;first obs=&amp;amp;last;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're pedantic, use round() instead of int().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 22:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152306#M262581</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2014-01-24T22:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming the top and bottom 1% of data in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152307#M262582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to demonstrate that you can also use PROC SQL to rank and trim data, although it may not be very efficient for large datasets. Also, as others have pointed out, the following approach would not deal with ties very well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 10pt;"&gt;/* create some fake data */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; test; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; idvar=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;to&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1000&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x=ranuni(&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1234&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 10pt;"&gt;/* trim value */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; trim=0.01;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &amp;amp;trim;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: green; font-size: 10pt;"&gt;/* Largest values ranked 1. Use b.x &amp;lt;= a.x for reverse ranking. */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; rankd_trimd &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;select&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;a.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;*&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; count ( &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; b.x )&lt;/SPAN&gt;&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; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; test b&lt;/SPAN&gt;&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; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; b.x &amp;gt;= a.x &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&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; ) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; rankvar&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , count ( * ) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; obs&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; test a&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having obs*&amp;amp;trim &amp;lt; rankvar &amp;lt;= obs*(&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;-&amp;amp;trim)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;order&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; rankvar&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jan 2014 00:59:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152307#M262582</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2014-01-25T00:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming the top and bottom 1% of data in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152308#M262583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your replies.&amp;nbsp; I think that I have a good place to start. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did want to add that, as some have pointed out, I am working with finance related issues, and my datasets are tens of millions of rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know if that matters with the code, but I am just looking to rank all of the rows based on a given variable, and then figure out how to get rid of the top and the bottom 1% of data, based on the rankings made by the variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Said another way, I would like to throw out the variables which lie in the top 1% and bottom 1% of the distribution for that variable.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will give &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;'s version a try, but if any of you have more suggestions, that would be great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jan 2014 16:00:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152308#M262583</guid>
      <dc:creator>mahler_ji</dc:creator>
      <dc:date>2014-01-25T16:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming the top and bottom 1% of data in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152309#M262584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I recommend proc rank for the following 3 reasons:&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;1. deals with ties appropriately&lt;/P&gt;&lt;P&gt;2. does not require a preceding proc sort&lt;/P&gt;&lt;P&gt;3. very easy to maintain or incorporate with other filter criteria&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The essence is that &lt;SPAN style="text-decoration: underline;"&gt;proc rank allows you to gain full control over your filter process without modifying the original dataset&lt;/SPAN&gt;. Also consider the following situation:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;* If your advisor or referee asks you to WINSORIZE your data instead of deleting them, you will have no choice but using proc rank.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;* &lt;SPAN style="font-size: 10pt;"&gt;If you have filter criteria other than percentiles(and I believe this is the usual case), you can easily output a relatively small rank-only dataset to incorporate with them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;* If you have many variables that require filtering, you can rank them all at once. Repeating proc sort and data deletion many times will be extremely time-wasting and always leads to unwanted information loss. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;As I've mentioned earlier, trimming by Nobs (either by dataset option or macro) serves well for one single purpose. However, it is really not a good choice regarding possible future work.&amp;nbsp; I am also dealing with a ~10M obs CRSP dataset, writing a now 1800-lined code and I do not like leaving any known pain in my own ass. Hope my personal experience helps.&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;Bill&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jan 2014 18:29:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152309#M262584</guid>
      <dc:creator>bill0101</dc:creator>
      <dc:date>2014-01-25T18:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming the top and bottom 1% of data in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152310#M262585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="823152" __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;Thank you very much for your help.&amp;nbsp; I am working within a CRSP dataset as well, so I think that your help is especially poignant.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will do this using PROC RANK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have any more questions, I will be sure to as you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 19:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152310#M262585</guid>
      <dc:creator>mahler_ji</dc:creator>
      <dc:date>2014-01-27T19:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming the top and bottom 1% of data in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152311#M262586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I concur with all of the reasons that others have given, re: using PROC RANK, etc. PROC RANK is preferable hands down. However, I just want to point out that your original question was how to use PROC SQL to trim variables based on their ranking.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 19:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152311#M262586</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2014-01-27T19:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trimming the top and bottom 1% of data in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152312#M262587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey &lt;A __default_attr="823152" __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;&lt;SPAN&gt;I am working in the CRSP and TR databases right now and I have some questions for someone that knows their way around these.&amp;nbsp; I think that we may be able to send direct messages to each other on here, but if not and you're willing to help for a bit maybe you could shoot me an email at &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:mahler.ji@gmail.com"&gt;mahler.ji@gmail.com&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for a way to filter out mutual funds that do not report holdings in consecutive quarters, and I'm not sure how to work with the dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2014 17:19:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trimming-the-top-and-bottom-1-of-data-in-PROC-SQL/m-p/152312#M262587</guid>
      <dc:creator>mahler_ji</dc:creator>
      <dc:date>2014-02-07T17:19:05Z</dc:date>
    </item>
  </channel>
</rss>

