<?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: Proc Rank in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank/m-p/693344#M211379</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/263957"&gt;@Jyuen204&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a data table created with 3 field values&lt;BR /&gt;&lt;STRONG&gt;Table name&lt;/STRONG&gt; =&amp;nbsp;CUST_EMAIL&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Fields:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;CUSTOMER_ID&lt;/P&gt;
&lt;P&gt;BILLING_NUMBER&lt;/P&gt;
&lt;P&gt;EMAIL_ADDRESS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Customer_ID is the highest level granularity meaning it can have multiple BILLING_ACCOUNTS. Each Billing account only has 1 email though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a rank to pull this data together to provide a ranking&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc rank data= CUST_EMAIL out=RANK_RESULTS ties = low descending;&lt;BR /&gt;by CUSTOMER_ID;&lt;BR /&gt;var BILLING_NUMBER;&lt;BR /&gt;ranks EMAIL_RANK ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However when I run the PROC RANK i am getting this error&lt;BR /&gt;ERROR: Data set WORK.CUST_EMAIL is not sorted in ascending sequence. The current BY group has CUSTOMER_ID = 1-9990SF and the next BY group has CUSTOMER_ID = 1-9990NY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even though when I created the table&amp;nbsp;CUST_EMAIL, I had it ordered by CUSTOMER_ID ASC so I am not sure why it is saying that my data set isnt sorted&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Simple solution: Sort the data by the variable on the By statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might check to see if any of those id values have leading blanks. You might think they are in "order" but a leading blank can throw that off. The error message though does show the values at the time your run Proc Rank are out of order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Interpretation of a rank on a value like Billing_Account (is that the same as Billing_number?) sounds a tad off if it is anything other than a sequence number of some sort.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Oct 2020 22:27:27 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-10-21T22:27:27Z</dc:date>
    <item>
      <title>Proc Rank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank/m-p/693339#M211376</link>
      <description>&lt;P&gt;I have a data table created with 3 field values&lt;BR /&gt;&lt;STRONG&gt;Table name&lt;/STRONG&gt; =&amp;nbsp;CUST_EMAIL&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Fields:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;CUSTOMER_ID&lt;/P&gt;
&lt;P&gt;BILLING_NUMBER&lt;/P&gt;
&lt;P&gt;EMAIL_ADDRESS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Customer_ID is the highest level granularity meaning it can have multiple BILLING_ACCOUNTS. Each Billing account only has 1 email though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a rank to pull this data together to provide a ranking&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc rank data= CUST_EMAIL out=RANK_RESULTS ties = low descending;&lt;BR /&gt;by CUSTOMER_ID;&lt;BR /&gt;var BILLING_NUMBER;&lt;BR /&gt;ranks EMAIL_RANK ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However when I run the PROC RANK i am getting this error&lt;BR /&gt;ERROR: Data set WORK.CUST_EMAIL is not sorted in ascending sequence. The current BY group has CUSTOMER_ID = 1-9990SF and the next BY group has CUSTOMER_ID = 1-9990NY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even though when I created the table&amp;nbsp;CUST_EMAIL, I had it ordered by CUSTOMER_ID ASC so I am not sure why it is saying that my data set isnt sorted&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 22:11:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Rank/m-p/693339#M211376</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2020-10-21T22:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Rank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank/m-p/693341#M211377</link>
      <description>&lt;P&gt;You need a PROC SORT before you run PROC RANK. The sort needs to be BY CUSTOMER_ID;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 22:21:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Rank/m-p/693341#M211377</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-21T22:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Rank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank/m-p/693343#M211378</link>
      <description>&lt;P&gt;Thanks! That worked. I figured i could sort the data in my table build and it would be good enough.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 22:26:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Rank/m-p/693343#M211378</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2020-10-21T22:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Rank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank/m-p/693344#M211379</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/263957"&gt;@Jyuen204&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a data table created with 3 field values&lt;BR /&gt;&lt;STRONG&gt;Table name&lt;/STRONG&gt; =&amp;nbsp;CUST_EMAIL&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Fields:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;CUSTOMER_ID&lt;/P&gt;
&lt;P&gt;BILLING_NUMBER&lt;/P&gt;
&lt;P&gt;EMAIL_ADDRESS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Customer_ID is the highest level granularity meaning it can have multiple BILLING_ACCOUNTS. Each Billing account only has 1 email though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a rank to pull this data together to provide a ranking&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc rank data= CUST_EMAIL out=RANK_RESULTS ties = low descending;&lt;BR /&gt;by CUSTOMER_ID;&lt;BR /&gt;var BILLING_NUMBER;&lt;BR /&gt;ranks EMAIL_RANK ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However when I run the PROC RANK i am getting this error&lt;BR /&gt;ERROR: Data set WORK.CUST_EMAIL is not sorted in ascending sequence. The current BY group has CUSTOMER_ID = 1-9990SF and the next BY group has CUSTOMER_ID = 1-9990NY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even though when I created the table&amp;nbsp;CUST_EMAIL, I had it ordered by CUSTOMER_ID ASC so I am not sure why it is saying that my data set isnt sorted&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Simple solution: Sort the data by the variable on the By statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might check to see if any of those id values have leading blanks. You might think they are in "order" but a leading blank can throw that off. The error message though does show the values at the time your run Proc Rank are out of order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Interpretation of a rank on a value like Billing_Account (is that the same as Billing_number?) sounds a tad off if it is anything other than a sequence number of some sort.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 22:27:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Rank/m-p/693344#M211379</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-21T22:27:27Z</dc:date>
    </item>
  </channel>
</rss>

