<?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 Number Category Variables by Category in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Number-Category-Variables-by-Category/m-p/566790#M159359</link>
    <description>&lt;P&gt;Actually there are some missing with the variable "class" ,so I tried like follows,but the log&lt;/P&gt;&lt;P&gt;notes that variable first.class uninitialized.Any&amp;nbsp; solution? thanks&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    by class;
    if  Class^=. and  first.Class then No=0;
    No+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 18 Jun 2019 06:04:00 GMT</pubDate>
    <dc:creator>HannaZhang</dc:creator>
    <dc:date>2019-06-18T06:04:00Z</dc:date>
    <item>
      <title>How to Number Category Variables by Category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Number-Category-Variables-by-Category/m-p/566785#M159356</link>
      <description>&lt;P&gt;hi，all&lt;/P&gt;&lt;P&gt;I have a&amp;nbsp;category variable "class" ,I want to create a new&amp;nbsp;variable "NO" which&amp;nbsp;number&amp;nbsp;ariable "class" ,the result as follows：&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="11.png" style="width: 360px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30345i31FE5B288A5EF660/image-size/large?v=v2&amp;amp;px=999" role="button" title="11.png" alt="11.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot！&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 05:48:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Number-Category-Variables-by-Category/m-p/566785#M159356</guid>
      <dc:creator>HannaZhang</dc:creator>
      <dc:date>2019-06-18T05:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to Number Category Variables by Category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Number-Category-Variables-by-Category/m-p/566786#M159357</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Class Grades;
datalines;
1 367
1 363
1 302
2 349
2 332
2 311
2 311
3 357
3 343
;

data want;
    set have;
    by class;
    if first.Class then No=0;
    No+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jun 2019 05:51:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Number-Category-Variables-by-Category/m-p/566786#M159357</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-06-18T05:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Number Category Variables by Category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Number-Category-Variables-by-Category/m-p/566790#M159359</link>
      <description>&lt;P&gt;Actually there are some missing with the variable "class" ,so I tried like follows,but the log&lt;/P&gt;&lt;P&gt;notes that variable first.class uninitialized.Any&amp;nbsp; solution? thanks&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    by class;
    if  Class^=. and  first.Class then No=0;
    No+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jun 2019 06:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Number-Category-Variables-by-Category/m-p/566790#M159359</guid>
      <dc:creator>HannaZhang</dc:creator>
      <dc:date>2019-06-18T06:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to Number Category Variables by Category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Number-Category-Variables-by-Category/m-p/566792#M159360</link>
      <description>&lt;P&gt;This would only appear in the log if you did not have your By Statement, which initializes the first. and last. variables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 06:06:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Number-Category-Variables-by-Category/m-p/566792#M159360</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-06-18T06:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to Number Category Variables by Category</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Number-Category-Variables-by-Category/m-p/566795#M159361</link>
      <description>THANKS!</description>
      <pubDate>Tue, 18 Jun 2019 06:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Number-Category-Variables-by-Category/m-p/566795#M159361</guid>
      <dc:creator>HannaZhang</dc:creator>
      <dc:date>2019-06-18T06:17:37Z</dc:date>
    </item>
  </channel>
</rss>

