<?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 can we do with retain statement creating sequence number? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-do-with-retain-statement-creating-sequence-number/m-p/427570#M105485</link>
    <description>&lt;P&gt;Are you after the same results as you did, meaning all 1s&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
set sashelp.class;
run;

data a1;
set a;
retain seq 1;
if lag(name) eq name then seq+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 14 Jan 2018 22:58:06 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-01-14T22:58:06Z</dc:date>
    <item>
      <title>How can we do with retain statement creating sequence number?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-do-with-retain-statement-creating-sequence-number/m-p/427567#M105482</link>
      <description>&lt;P&gt;In the below code I have created sequence number using first and last name in the sashelp.class I have distinct name so we get every record with 1 value in seq variable. Same i need in retain concept without using first and last.name.&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;data a;
set sashelp.class;
run;

data a1;
set a;
by name;
if first.name then seq=1;
else seq+1;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jan 2018 22:50:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-do-with-retain-statement-creating-sequence-number/m-p/427567#M105482</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2018-01-14T22:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can we do with retain statement creating sequence number?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-do-with-retain-statement-creating-sequence-number/m-p/427570#M105485</link>
      <description>&lt;P&gt;Are you after the same results as you did, meaning all 1s&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
set sashelp.class;
run;

data a1;
set a;
retain seq 1;
if lag(name) eq name then seq+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Jan 2018 22:58:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-do-with-retain-statement-creating-sequence-number/m-p/427570#M105485</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-14T22:58:06Z</dc:date>
    </item>
  </channel>
</rss>

