<?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: Row by row comparison same group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Row-by-row-comparison-same-group/m-p/756047#M238634</link>
    <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i start with "TRUE" for the first month of the ids? i can not compare the first one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jul 2021 20:59:44 GMT</pubDate>
    <dc:creator>Sk1_SAS</dc:creator>
    <dc:date>2021-07-22T20:59:44Z</dc:date>
    <item>
      <title>Row by row comparison same group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Row-by-row-comparison-same-group/m-p/756032#M238625</link>
      <description>&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need verify if the numbers of rows are increased in months.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my table:&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;DATA want;
 INPUT TABLE_NAME $ MONTH NOBS GRUP;
CARDS;
TABLE_A 202101 1234 1
TABLE_A 202102 1235 1
TABLE_A 202103 1236 1
TABLE_A 202104 1237 1
TABLE_A 202105 1238 1
TABLE_A 202106 1239 1
TABLE_A 202107 1230 1
TABLE_B 202101 1000 2
TABLE_B 202102 500 2
TABLE_B 202103 700 2
TABLE_B 202104 300 2
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;i need compare the nobs of the first month with next moth&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex: Compare nobs in Grup 1 - &amp;gt; 202101 with 202102, 202102 with 202103, 202103 with 202104.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and if the month is less than the next month, status = 'true' else 'false', the first month of the grup can start with "TRUE"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i need:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sk1_SAS_0-1626984483768.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61612iC4F2F0EB03F94B10/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sk1_SAS_0-1626984483768.png" alt="Sk1_SAS_0-1626984483768.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 20:09:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Row-by-row-comparison-same-group/m-p/756032#M238625</guid>
      <dc:creator>Sk1_SAS</dc:creator>
      <dc:date>2021-07-22T20:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Row by row comparison same group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Row-by-row-comparison-same-group/m-p/756035#M238628</link>
      <description>&lt;P&gt;Look at the DIF function for starters.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by table_name;
dif = dif(NOBS);
if first.table_name or dif&amp;gt;0 then status="TRUE";
else status="FALSE";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Jul 2021 21:04:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Row-by-row-comparison-same-group/m-p/756035#M238628</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-22T21:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Row by row comparison same group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Row-by-row-comparison-same-group/m-p/756047#M238634</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i start with "TRUE" for the first month of the ids? i can not compare the first one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 20:59:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Row-by-row-comparison-same-group/m-p/756047#M238634</guid>
      <dc:creator>Sk1_SAS</dc:creator>
      <dc:date>2021-07-22T20:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Row by row comparison same group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Row-by-row-comparison-same-group/m-p/756049#M238636</link>
      <description>If first.table_name will take care of that. I made a mistake and typed out first.month in my first version of the code, updated it for you here.</description>
      <pubDate>Thu, 22 Jul 2021 21:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Row-by-row-comparison-same-group/m-p/756049#M238636</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-22T21:05:27Z</dc:date>
    </item>
  </channel>
</rss>

