<?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: I need help to create 1 to 7 sequence in whole dataset in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/I-need-help-to-create-1-to-7-sequence-in-whole-dataset/m-p/642818#M21898</link>
    <description>&lt;P&gt;Here's the a very simple way.&lt;/P&gt;
&lt;P&gt;RETAIN holds the value across the rows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FIRST.SEX is one on the first record of every Sex grouping and 0 otherwise.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
by sex;
run;

data want;
set class;
by sex;
retain count;
if first.sex then count=1;
else if count=7 then count=1;
else count+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 25 Apr 2020 00:51:47 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-04-25T00:51:47Z</dc:date>
    <item>
      <title>I need help to create 1 to 7 sequence in whole dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-need-help-to-create-1-to-7-sequence-in-whole-dataset/m-p/642790#M21893</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create variable seq that has sequence 1 to 7 max by subject and start date.if by variables changes then again it will starts from 1 but max 7 only. please check this excel file for final output should look like this. i have tried many times but can not able to solve this issue on my own.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 21:41:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-need-help-to-create-1-to-7-sequence-in-whole-dataset/m-p/642790#M21893</guid>
      <dc:creator>kk26</dc:creator>
      <dc:date>2020-04-24T21:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: I need help to create 1 to 7 sequence in whole dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-need-help-to-create-1-to-7-sequence-in-whole-dataset/m-p/642818#M21898</link>
      <description>&lt;P&gt;Here's the a very simple way.&lt;/P&gt;
&lt;P&gt;RETAIN holds the value across the rows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FIRST.SEX is one on the first record of every Sex grouping and 0 otherwise.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class;
by sex;
run;

data want;
set class;
by sex;
retain count;
if first.sex then count=1;
else if count=7 then count=1;
else count+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 25 Apr 2020 00:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-need-help-to-create-1-to-7-sequence-in-whole-dataset/m-p/642818#M21898</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-04-25T00:51:47Z</dc:date>
    </item>
  </channel>
</rss>

