<?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 increment by 1 in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/increment-by-1/m-p/13682#M2041</link>
    <description>Hi, &lt;BR /&gt;
&lt;BR /&gt;
In report,  need to create a new variable name on the report that are not exist in the dataset.&lt;BR /&gt;
&lt;BR /&gt;
For example,&lt;BR /&gt;
&lt;BR /&gt;
id name&lt;BR /&gt;
1  stu&lt;BR /&gt;
2  Bob&lt;BR /&gt;
3 Ben&lt;BR /&gt;
&lt;BR /&gt;
In final output it should be,&lt;BR /&gt;
&lt;BR /&gt;
id name age last&lt;BR /&gt;
1 stu    .&lt;BR /&gt;
2  bob  .&lt;BR /&gt;
3  ben  .&lt;BR /&gt;
&lt;BR /&gt;
For last field, each record start with 1 and increment by 1  for each subsequent record.&lt;BR /&gt;
&lt;BR /&gt;
Please let me know .&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
    <pubDate>Tue, 14 Jun 2011 21:30:39 GMT</pubDate>
    <dc:creator>raveena</dc:creator>
    <dc:date>2011-06-14T21:30:39Z</dc:date>
    <item>
      <title>increment by 1</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/increment-by-1/m-p/13682#M2041</link>
      <description>Hi, &lt;BR /&gt;
&lt;BR /&gt;
In report,  need to create a new variable name on the report that are not exist in the dataset.&lt;BR /&gt;
&lt;BR /&gt;
For example,&lt;BR /&gt;
&lt;BR /&gt;
id name&lt;BR /&gt;
1  stu&lt;BR /&gt;
2  Bob&lt;BR /&gt;
3 Ben&lt;BR /&gt;
&lt;BR /&gt;
In final output it should be,&lt;BR /&gt;
&lt;BR /&gt;
id name age last&lt;BR /&gt;
1 stu    .&lt;BR /&gt;
2  bob  .&lt;BR /&gt;
3  ben  .&lt;BR /&gt;
&lt;BR /&gt;
For last field, each record start with 1 and increment by 1  for each subsequent record.&lt;BR /&gt;
&lt;BR /&gt;
Please let me know .&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Tue, 14 Jun 2011 21:30:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/increment-by-1/m-p/13682#M2041</guid>
      <dc:creator>raveena</dc:creator>
      <dc:date>2011-06-14T21:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: increment by 1</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/increment-by-1/m-p/13683#M2042</link>
      <description>Here is a PROC REPORT step that has a row counter.&lt;BR /&gt;
[pre]&lt;BR /&gt;
data names;&lt;BR /&gt;
input id name $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 stu&lt;BR /&gt;
2 Bob&lt;BR /&gt;
3 Ben&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc report data=names nowd;&lt;BR /&gt;
columns id name obsno;&lt;BR /&gt;
define id/display;&lt;BR /&gt;
define name/display;&lt;BR /&gt;
define obsno/computed;&lt;BR /&gt;
compute obsno;&lt;BR /&gt;
   cnt+1;&lt;BR /&gt;
   obsno=cnt;&lt;BR /&gt;
endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Wed, 15 Jun 2011 02:44:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/increment-by-1/m-p/13683#M2042</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2011-06-15T02:44:56Z</dc:date>
    </item>
  </channel>
</rss>

