<?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 Identify Frequent Flyers in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Identify-Frequent-Flyers/m-p/150537#M11607</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table with customer ID column and I want to create a new column that counts the occurences of the customer ID. So if the customer ID in the first row occurs 4 time within the ID column I want the number 4 to show up in the new column wherever that customer ID is in the ID column. Maybe this doesn't make sense and there is a better way to accomplish this. All replies are welcome!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Brian&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Mar 2014 18:23:58 GMT</pubDate>
    <dc:creator>BTAinRVA</dc:creator>
    <dc:date>2014-03-20T18:23:58Z</dc:date>
    <item>
      <title>Identify Frequent Flyers</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Identify-Frequent-Flyers/m-p/150537#M11607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table with customer ID column and I want to create a new column that counts the occurences of the customer ID. So if the customer ID in the first row occurs 4 time within the ID column I want the number 4 to show up in the new column wherever that customer ID is in the ID column. Maybe this doesn't make sense and there is a better way to accomplish this. All replies are welcome!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Brian&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2014 18:23:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Identify-Frequent-Flyers/m-p/150537#M11607</guid>
      <dc:creator>BTAinRVA</dc:creator>
      <dc:date>2014-03-20T18:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Identify Frequent Flyers</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Identify-Frequent-Flyers/m-p/150538#M11608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;BR /&gt;This would be easier if you could show some data or some code. If you can't post your data, then making an example that uses SASHELP.CLASS or SASHELP.SHOES, would be useful. For example, in the code below, I used SASHELP.CLASS and made a "fake" customerID variable by adding a random number to the AGE variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;You should be able to run the code and see the input data and the output report. I generated the report 2 different ways, one with PROC REPORT and the other way with PROC TABULATE. Unless you have different data complexities or different report needs, one of these examples should do what you describe.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data class;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; set sashelp.class;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; customerID = age+3200;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods _all_ close;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html file='c:\temp\countID.html';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc print data=class;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; title 'what is input data';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; var customerID name height weight;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc report data=class nowd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; title 'Proc Report Getting a Count Column';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; column customerID n ('Average' height weight);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define customerID / group&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style(column)=Header;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define n / 'Count';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define height / mean f=6.2;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; define weight / mean f=6.2;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc tabulate data=class;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; var height weight;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; class customerID;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; table customerID,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n&amp;nbsp; mean='Average'*(height weight);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; title 'TABULATE Getting a Count';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; keylabel n='Count';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; keyword n / style={vjust=b};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html close;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2014 20:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Identify-Frequent-Flyers/m-p/150538#M11608</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-03-20T20:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Identify Frequent Flyers</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Identify-Frequent-Flyers/m-p/150539#M11609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This involves calculating the number and merging in, though you can do it in one step via SQL. It still requires two passes, and you'll see a note in the log that indicates this:&lt;/P&gt;&lt;P&gt;NOTE: The query requires remerging summary statistics back with the original data.&lt;/P&gt;&lt;P&gt;NOTE: Table WORK.CARS_COUNT created, with 428 rows and 16 columns.&lt;/P&gt;&lt;P&gt;&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 cars_count as&lt;/P&gt;&lt;P&gt;select *, count(m) as count_of_make&lt;/P&gt;&lt;P&gt;from sashelp.cars&lt;/P&gt;&lt;P&gt;group by make;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2014 21:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Identify-Frequent-Flyers/m-p/150539#M11609</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-03-20T21:34:37Z</dc:date>
    </item>
  </channel>
</rss>

