<?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: How to create an enumeration variable within one datastep? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695528#M79775</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
 input Event :$12.;
 cards;
basketball

basketball

basketball

football

football

baseball
;

data want;
 set have;
 by Event notsorted;
 if first.Event then no=0;
 no+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 30 Oct 2020 16:38:44 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2020-10-30T16:38:44Z</dc:date>
    <item>
      <title>How to create an enumeration variable within one datastep?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695527#M79774</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I would like to know how to count the number of the event happening times.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Event&lt;/P&gt;&lt;P&gt;basketball&lt;/P&gt;&lt;P&gt;basketball&lt;/P&gt;&lt;P&gt;basketball&lt;/P&gt;&lt;P&gt;football&lt;/P&gt;&lt;P&gt;football&lt;/P&gt;&lt;P&gt;baseball&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;Event&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NO&lt;/P&gt;&lt;P&gt;basketball&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;basketball&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;basketball&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;football&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;football&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;baseball&amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What data step can make the result like that? It need to output in one data step. Please help. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 16:34:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695527#M79774</guid>
      <dc:creator>rx5873</dc:creator>
      <dc:date>2020-10-30T16:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an enumeration variable within one datastep?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695528#M79775</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
 input Event :$12.;
 cards;
basketball

basketball

basketball

football

football

baseball
;

data want;
 set have;
 by Event notsorted;
 if first.Event then no=0;
 no+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Oct 2020 16:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695528#M79775</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-10-30T16:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an enumeration variable within one datastep?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695530#M79776</link>
      <description>&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/faq/how-can-i-create-an-enumeration-variable-by-groups/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/faq/how-can-i-create-an-enumeration-variable-by-groups/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/354862"&gt;@rx5873&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I would like to know how to count the number of the event happening times.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Event&lt;/P&gt;
&lt;P&gt;basketball&lt;/P&gt;
&lt;P&gt;basketball&lt;/P&gt;
&lt;P&gt;basketball&lt;/P&gt;
&lt;P&gt;football&lt;/P&gt;
&lt;P&gt;football&lt;/P&gt;
&lt;P&gt;baseball&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;Event&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NO&lt;/P&gt;
&lt;P&gt;basketball&amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;basketball&amp;nbsp; 2&lt;/P&gt;
&lt;P&gt;basketball&amp;nbsp; 3&lt;/P&gt;
&lt;P&gt;football&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;football&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;
&lt;P&gt;baseball&amp;nbsp; &amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What data step can make the result like that? It need to output in one data step. Please help. Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 16:39:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695530#M79776</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-30T16:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an enumeration variable within one datastep?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695532#M79777</link>
      <description>it use the proc function which more than one data step.</description>
      <pubDate>Fri, 30 Oct 2020 16:41:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695532#M79777</guid>
      <dc:creator>rx5873</dc:creator>
      <dc:date>2020-10-30T16:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an enumeration variable within one datastep?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695534#M79779</link>
      <description>I need to show the result in one data step. It cannot open another data want; and use the by function</description>
      <pubDate>Fri, 30 Oct 2020 16:44:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695534#M79779</guid>
      <dc:creator>rx5873</dc:creator>
      <dc:date>2020-10-30T16:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an enumeration variable within one datastep?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695538#M79780</link>
      <description>&lt;P&gt;Are you trying to mean that you do not want to create a "new" dataset named want and would rather update the existing dataset? If yes, you could just recreate "have"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
 set have;
 by Event notsorted;
 if first.Event then no=0;
 no+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Oct 2020 16:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695538#M79780</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-10-30T16:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an enumeration variable within one datastep?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695541#M79781</link>
      <description>data have;&lt;BR /&gt; set have;&lt;BR /&gt; by Event notsorted;&lt;BR /&gt; if first.Event then no=0;&lt;BR /&gt; no+1;&lt;BR /&gt;run;</description>
      <pubDate>Fri, 30 Oct 2020 17:02:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-an-enumeration-variable-within-one-datastep/m-p/695541#M79781</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-30T17:02:23Z</dc:date>
    </item>
  </channel>
</rss>

