<?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: Create observation count variable - X in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-observation-count-variable-X/m-p/269654#M53451</link>
    <description>&lt;P&gt;Its always a good idea to post test data (in the form of a datastep), and what the output should look like. &amp;nbsp;We can only work with what you post here. &amp;nbsp;Do you mean you want an equivalent to the SAS automatic variable _n_ or a total observations?&lt;/P&gt;</description>
    <pubDate>Wed, 11 May 2016 08:07:55 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-05-11T08:07:55Z</dc:date>
    <item>
      <title>Create observation count variable - X</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-observation-count-variable-X/m-p/269618#M53440</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a cancer data set and I need to create an X variable (observation count). What's the codings used in this case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 03:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-observation-count-variable-X/m-p/269618#M53440</guid>
      <dc:creator>mayasak</dc:creator>
      <dc:date>2016-05-11T03:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Create observation count variable - X</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-observation-count-variable-X/m-p/269622#M53441</link>
      <description>&lt;P&gt;SAS has an automatic variable that can be used as an observation counter. This assumes you want a row counter. If you want to count observations by groups or some other method you need to provide more details, preferably sample input and output.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data want;
Set sashelp.class;
X = _n_;

Run;

Proc print data=want label;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 May 2016 03:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-observation-count-variable-X/m-p/269622#M53441</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-11T03:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create observation count variable - X</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-observation-count-variable-X/m-p/269654#M53451</link>
      <description>&lt;P&gt;Its always a good idea to post test data (in the form of a datastep), and what the output should look like. &amp;nbsp;We can only work with what you post here. &amp;nbsp;Do you mean you want an equivalent to the SAS automatic variable _n_ or a total observations?&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 08:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-observation-count-variable-X/m-p/269654#M53451</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-05-11T08:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Create observation count variable - X</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-observation-count-variable-X/m-p/269732#M53475</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 14:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-observation-count-variable-X/m-p/269732#M53475</guid>
      <dc:creator>mayasak</dc:creator>
      <dc:date>2016-05-11T14:09:00Z</dc:date>
    </item>
  </channel>
</rss>

