<?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: code for repeated data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/code-for-repeated-data/m-p/401009#M278690</link>
    <description>&lt;P&gt;post sample data in the form of a datastep if you want a code answer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC FREQ or PROC SQL are probably your best choices.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Oct 2017 15:05:34 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2017-10-04T15:05:34Z</dc:date>
    <item>
      <title>code for repeated data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-for-repeated-data/m-p/401008#M278689</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;This is Ibrahim researcher student at UCD in Ireland&lt;/P&gt;&lt;P&gt;I’m looking for code that will solve this issue&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;look at COW_ID COLUMN&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to make a new column which represents how many time each observation repeated in column &amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if the number 72050556 repeated six times in my original&amp;nbsp; dataset column, I would like to print a number 6 in the new column in front of these numbers (72050556) as well as the other repeating times&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BEST REGARDS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ibrahim&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:03:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-for-repeated-data/m-p/401008#M278689</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2017-10-04T15:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: code for repeated data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-for-repeated-data/m-p/401009#M278690</link>
      <description>&lt;P&gt;post sample data in the form of a datastep if you want a code answer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC FREQ or PROC SQL are probably your best choices.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-for-repeated-data/m-p/401009#M278690</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-10-04T15:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: code for repeated data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-for-repeated-data/m-p/401012#M278691</link>
      <description>&lt;P&gt;If I understand your request then there are two parts involved: 1 is count the number of times a value occurs and the second is to merge that value back onto the original data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's one way with a SAS supplied data set you can test.&lt;/P&gt;
&lt;PRE&gt;proc sql;
   create table want as
   select a.*, b.agecount
   from sashelp.class as a
        left join
        (select age, count(*) as agecount
         from sashelp.class
         group by age) as b
        on a.age=b.age
   ;
quit;&lt;/PRE&gt;
&lt;P&gt;It is best to post text as text pasted into a code box. Many users here do not want to open Microsoft format documents as security risks and others have organization policy or software that prevents them from opening such from unapproved sources.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-for-repeated-data/m-p/401012#M278691</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-04T15:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: code for repeated data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-for-repeated-data/m-p/401016#M278692</link>
      <description>&lt;P&gt;This is my data&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have over one million&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-for-repeated-data/m-p/401016#M278692</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2017-10-04T15:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: code for repeated data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/code-for-repeated-data/m-p/401021#M278693</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151600"&gt;@Barkamih&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;This is my data&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have over one million&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;regards&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best is to either provide a data step to create data and another to show the desired result for the example data, or provide an example using a SAS supplied data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you look at the example in my other post?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 15:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/code-for-repeated-data/m-p/401021#M278693</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-04T15:32:48Z</dc:date>
    </item>
  </channel>
</rss>

