<?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 a record counter variable in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-record-counter-variable/m-p/459750#M29629</link>
    <description>Just a note that I modified your subject line to make it more descriptive.</description>
    <pubDate>Thu, 03 May 2018 17:07:01 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-05-03T17:07:01Z</dc:date>
    <item>
      <title>How to create a record counter variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-record-counter-variable/m-p/459746#M29626</link>
      <description>&lt;P&gt;Okay SAS community, I'm very green in this field of Data.&amp;nbsp; I have specific field expertise, but lack the data science background, so I need a little direction:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to apply sequential identifiers to a column of existing ID numbers in order to later filter out the first ID number in the original column.&amp;nbsp; There are roughly 30 columns of total data and about 500K records...big table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the existing ID numbers in my table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;6JGM92501240&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;6JGM92501240&lt;BR /&gt;6JGM92301228&lt;BR /&gt;6JGM92001215&lt;BR /&gt;6JGM92001215&lt;BR /&gt;6JGM92001215&lt;BR /&gt;6JGM92001215&lt;BR /&gt;6JGM92301228&lt;BR /&gt;6JGM92301228&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to have this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92501240&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92501240&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92301228&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92001215&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92001215&lt;BR /&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92001215&lt;BR /&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92001215&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92301228&lt;BR /&gt;2&amp;nbsp; &amp;nbsp;&amp;nbsp; 6JGM92301228&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't simply use select distinct rows only due to some other factors.&amp;nbsp; Any idea how to do this??&amp;nbsp; Any help would be great, thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 17:06:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-record-counter-variable/m-p/459746#M29626</guid>
      <dc:creator>LeftHandLob</dc:creator>
      <dc:date>2018-05-03T17:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I solve this problem...</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-record-counter-variable/m-p/459748#M29627</link>
      <description>&lt;P&gt;This post goes over how to enumerate BY groups:&lt;/P&gt;
&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/208117"&gt;@LeftHandLob&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Okay SAS community, I'm very green in this field of Data.&amp;nbsp; I have specific field expertise, but lack the data science background, so I need a little direction:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to apply sequential identifiers to a column of existing ID numbers in order to later filter out the first ID number in the original column.&amp;nbsp; There are roughly 30 columns of total data and about 500K records...big table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the existing ID numbers in my table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;6JGM92501240&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;6JGM92501240&lt;BR /&gt;6JGM92301228&lt;BR /&gt;6JGM92001215&lt;BR /&gt;6JGM92001215&lt;BR /&gt;6JGM92001215&lt;BR /&gt;6JGM92001215&lt;BR /&gt;6JGM92301228&lt;BR /&gt;6JGM92301228&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to have this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92501240&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92501240&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92301228&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92001215&lt;BR /&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92001215&lt;BR /&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92001215&lt;BR /&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92001215&lt;BR /&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6JGM92301228&lt;BR /&gt;2&amp;nbsp; &amp;nbsp;&amp;nbsp; 6JGM92301228&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't simply use select distinct rows only due to some other factors.&amp;nbsp; Any idea how to do this??&amp;nbsp; Any help would be great, thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 17:06:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-record-counter-variable/m-p/459748#M29627</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-03T17:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I solve this problem...</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-record-counter-variable/m-p/459749#M29628</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
    by id;
run;
data want;
    set have;
    by id;
    if first.id then seq=0;
    seq+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the data is already sorted, you can leave out the PROC SORT.&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 17:06:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-record-counter-variable/m-p/459749#M29628</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-05-03T17:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a record counter variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-record-counter-variable/m-p/459750#M29629</link>
      <description>Just a note that I modified your subject line to make it more descriptive.</description>
      <pubDate>Thu, 03 May 2018 17:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-record-counter-variable/m-p/459750#M29629</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-03T17:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a record counter variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-record-counter-variable/m-p/459752#M29630</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id $20.;
cards;
6JGM92501240   
6JGM92501240
6JGM92301228
6JGM92001215
6JGM92001215
6JGM92001215
6JGM92001215
6JGM92301228
6JGM92301228
;

data want;
set have;
by id notsorted;
if first.id then n=1;
else n+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 May 2018 17:09:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-create-a-record-counter-variable/m-p/459752#M29630</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-03T17:09:03Z</dc:date>
    </item>
  </channel>
</rss>

