<?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: Creating a Column That Groups Data Every n Rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Column-That-Groups-Data-Every-n-Rows/m-p/446847#M112184</link>
    <description>&lt;P&gt;Thanks a lot.&lt;/P&gt;
&lt;P&gt;A bit shorter.&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want;
set have;
retain grp 1;
if mod(n,100)=0 then grp+1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 19 Mar 2018 16:21:01 GMT</pubDate>
    <dc:creator>hhchenfx</dc:creator>
    <dc:date>2018-03-19T16:21:01Z</dc:date>
    <item>
      <title>Creating a Column That Groups Data Every n Rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Column-That-Groups-Data-Every-n-Rows/m-p/427077#M105287</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am looking to create a new column that groups my data every n rows. For example I have 1,000 rows, I would like to create a column that assigns the first 100 rows Group 1, the next 100 rows Group 2, and so on until the final row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone know how to accomplish this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 00:56:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-Column-That-Groups-Data-Every-n-Rows/m-p/427077#M105287</guid>
      <dc:creator>AAWTomHanks</dc:creator>
      <dc:date>2018-01-12T00:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Column That Groups Data Every n Rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Column-That-Groups-Data-Every-n-Rows/m-p/427079#M105289</link>
      <description>&lt;P&gt;&lt;SPAN&gt;data wantttt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;grp=1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;do n=1 to 1000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if mod(n,100)=0 then do; output;grp+1;end;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else output;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;end;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 01:11:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-Column-That-Groups-Data-Every-n-Rows/m-p/427079#M105289</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-12T01:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Column That Groups Data Every n Rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Column-That-Groups-Data-Every-n-Rows/m-p/427080#M105290</link>
      <description>&lt;P&gt;same story but when reading a dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;do n=1 to 1000;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;retain grp 1;&lt;BR /&gt;if mod(n,100)=0 then do; output;grp+1;end;&lt;BR /&gt;else output;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 01:19:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-Column-That-Groups-Data-Every-n-Rows/m-p/427080#M105290</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-12T01:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Column That Groups Data Every n Rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Column-That-Groups-Data-Every-n-Rows/m-p/427086#M105292</link>
      <description>&lt;P&gt;Perfect, thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 01:56:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-Column-That-Groups-Data-Every-n-Rows/m-p/427086#M105292</guid>
      <dc:creator>AAWTomHanks</dc:creator>
      <dc:date>2018-01-12T01:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Column That Groups Data Every n Rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-Column-That-Groups-Data-Every-n-Rows/m-p/446847#M112184</link>
      <description>&lt;P&gt;Thanks a lot.&lt;/P&gt;
&lt;P&gt;A bit shorter.&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want;
set have;
retain grp 1;
if mod(n,100)=0 then grp+1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Mar 2018 16:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-Column-That-Groups-Data-Every-n-Rows/m-p/446847#M112184</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-03-19T16:21:01Z</dc:date>
    </item>
  </channel>
</rss>

