<?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 help needed in understanding a sas command , that looks simple in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324961#M271363</link>
    <description>&lt;P&gt;&lt;BR /&gt;Can somone please help me in undrstanding fully the below sas command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data dups ;&lt;BR /&gt;set Work.pbs ;&lt;BR /&gt;by q1_code ;&lt;BR /&gt;if first.q1_code + last.q1_code &amp;lt; 2 then output ;&lt;BR /&gt;proc print data=dups ;&lt;BR /&gt;run ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like a new data set "dups" is being created from "work.pgs" data set.&lt;/P&gt;&lt;P&gt;but what is happening next (&lt;SPAN&gt;by q1_code ;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;if first.q1_code + last.q1_code &amp;lt; 2 then output &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; , I do not understand at all. and also it looks like there is a problem with the command as it would not work.. and the new data "dups" will be created but with 0 observations...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THanks very much in advance &amp;nbsp;for your time and help.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jan 2017 04:48:01 GMT</pubDate>
    <dc:creator>healtheconomist</dc:creator>
    <dc:date>2017-01-16T04:48:01Z</dc:date>
    <item>
      <title>help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324961#M271363</link>
      <description>&lt;P&gt;&lt;BR /&gt;Can somone please help me in undrstanding fully the below sas command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data dups ;&lt;BR /&gt;set Work.pbs ;&lt;BR /&gt;by q1_code ;&lt;BR /&gt;if first.q1_code + last.q1_code &amp;lt; 2 then output ;&lt;BR /&gt;proc print data=dups ;&lt;BR /&gt;run ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like a new data set "dups" is being created from "work.pgs" data set.&lt;/P&gt;&lt;P&gt;but what is happening next (&lt;SPAN&gt;by q1_code ;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;if first.q1_code + last.q1_code &amp;lt; 2 then output &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; , I do not understand at all. and also it looks like there is a problem with the command as it would not work.. and the new data "dups" will be created but with 0 observations...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THanks very much in advance &amp;nbsp;for your time and help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 04:48:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324961#M271363</guid>
      <dc:creator>healtheconomist</dc:creator>
      <dc:date>2017-01-16T04:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324964#M271364</link>
      <description>&lt;P&gt;The only case where&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;first.q1_code + last.q1_code = 2&lt;/STRONG&gt; is when a q1_code group contains a single record. So this data step will eliminate q1_code groups with a single observation and keep the others in the new dups dataset.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 05:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324964#M271364</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-01-16T05:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324965#M271365</link>
      <description>&lt;P&gt;Dear PG,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THanks so much for your kind and speedy reply. It is really helpful, I am now able to understand what they were trying to do over here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one more concern regarding the same command. When I run this command&lt;/P&gt;&lt;P&gt;(data dups ;&amp;nbsp;set pbs ;&amp;nbsp;by q1_code ;&amp;nbsp;if first.q1_code + last.q1_code &amp;lt; 2 then output ; proc print data=dups ; run ;), the new data set (dups) comes with 8 variables and &lt;STRONG&gt;zero&lt;/STRONG&gt; observations. Which should not happen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ALso in the command it says&amp;nbsp;&lt;STRONG&gt;first.q1_code + last.q1_code &lt;FONT color="#00FF00"&gt;&amp;lt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp; but not&amp;nbsp;&lt;STRONG&gt;first.q1_code + last.q1_code &lt;FONT color="#FF0000"&gt;= 2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;Do you kindly add any further thoughts.&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 05:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324965#M271365</guid>
      <dc:creator>healtheconomist</dc:creator>
      <dc:date>2017-01-16T05:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324966#M271366</link>
      <description>&lt;P&gt;&lt;STRONG&gt;first.q1_code + last.q1_code = 0 when observation is not the first or the last&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;first.q1_code + last.q1_code = 1 when observation is the first but not the last OR is the last but not the first&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;first.q1_code + last.q1_code = 2 when observation is the first and the last&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;those are the only possible values for&amp;nbsp;first.q1_code + last.q1_code.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If your dataset work.pbs does contain q1_code groups with more than one observations and you get an empty dataset, you should check the SAS log.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;In fact, you should always chech the SAS log&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 05:27:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324966#M271366</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-01-16T05:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324977#M271367</link>
      <description>&lt;P&gt;Supply example data that illustrates your problem. Do so in a &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;data step&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 07:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324977#M271367</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-16T07:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324985#M271368</link>
      <description>&lt;P&gt;Let us suppose your input contains the 3 lines:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;U&gt;Q1_code&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; a &amp;nbsp; &amp;nbsp; - on this line: first.q1_code=&lt;STRONG&gt;1&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;last_q1_code=0&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; a &amp;nbsp; &amp;nbsp;&lt;SPAN&gt; - on this line: first.q1_code=0 &amp;nbsp;&amp;nbsp; &amp;nbsp; last_q1_code=0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; a &amp;nbsp; &amp;nbsp;&lt;SPAN&gt; - on this line: first.q1_code=0 &amp;nbsp; &amp;nbsp; &amp;nbsp;last_q1_code=&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In case of only one single line Q1_CODE then&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;a&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;b &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; - on this line: first.q1_code=&lt;STRONG&gt;1&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;last_q1_code=&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this will help you understand the case.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 08:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324985#M271368</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-16T08:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324994#M271369</link>
      <description>&lt;P&gt;A bettter way of writing may be:&lt;/P&gt;
&lt;PRE&gt;data dups ;
  set work.pbs;
  by q1_code;
  if first.q1_code and last.q1_code then delete;
run;
&lt;/PRE&gt;
&lt;P&gt;So remove records where observation is firsts and last - i.e. there is only one.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 09:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/324994#M271369</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-16T09:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/325136#M271370</link>
      <description>&lt;P&gt;Dear Advisors,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have run the same sas code with slight modifications (highlighted in red) more than one times.. and here is the sas log statments that I receive for each of those command versions. Out of four, 3 times I get 0 observations in the new data set "dups". Only exception is when (&lt;SPAN&gt;first.q1_code + last.q1_code &lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;=&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt; 2 then output &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; where the new data set (dups) contains exactly the same number of observations as was in case of "work.pbs". But the program that has been handed over to me uses (first.q1_code + last.q1_code&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&amp;lt;&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;2 then output &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; and the whole analysis that has been done in the past by someone else is based on that, and when I try to rerun the program file to replicate th results a problem occurs and dups data comes up with 0 entry (can someone please interpret this for me).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data dups ;&lt;BR /&gt;set work.pbs ;&lt;BR /&gt;by q1_code ;&lt;BR /&gt;if first.q1_code + last.q1_code &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&amp;lt;&lt;/FONT&gt;&lt;/STRONG&gt; 2 then output ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: There were 3476 observations read from the data set WORK.PBS.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: The data set WORK.DUPS has 0 observations and 8 variables.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data dups ;&lt;BR /&gt;set work.pbs ;&lt;BR /&gt;by q1_code ;&lt;BR /&gt;if first.q1_code + last.q1_code &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;=&lt;/FONT&gt;&lt;/STRONG&gt; 2 then output ;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: There were 3476 observations read from the data set WORK.PBS.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: The data set WORK.DUPS has 3476 observations and 8 variables.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data dups ;&lt;BR /&gt;set work.pbs ;&lt;BR /&gt;by q1_code ;&lt;BR /&gt;if first.q1_code + last.q1_code&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt; =&lt;/FONT&gt;&lt;/STRONG&gt; 1 then output ;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: There were 3476 observations read from the data set WORK.PBS.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: The data set WORK.DUPS has 0 observations and 8 variables.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;data dups ;&lt;BR /&gt;set work.pbs ;&lt;BR /&gt;by q1_code ;&lt;BR /&gt;if first.q1_code + last.q1_code &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;=&lt;/FONT&gt;&lt;/STRONG&gt; 3 then output ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: There were 3476 observations read from the data set WORK.PBS.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: The data set WORK.DUPS has 0 observations and 8 variables.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 21:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/325136#M271370</guid>
      <dc:creator>healtheconomist</dc:creator>
      <dc:date>2017-01-16T21:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/325137#M271371</link>
      <description>&lt;P&gt;Dear Advisors,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have run the same sas code with slight modifications (highlighted in red) more than one times.. and here is the sas log statments that I receive for each of those command versions. Out of four, 3 times I get 0 observations in the new data set "dups". Only exception is when (&lt;SPAN&gt;first.q1_code + last.q1_code &lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;=&lt;/FONT&gt;&lt;/STRONG&gt;&lt;SPAN&gt; 2 then output &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; where the new data set (dups) contains exactly the same number of observations as was in case of "work.pbs". But the program that has been handed over to me uses (first.q1_code + last.q1_code&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&amp;lt;&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;2 then output &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; and the whole analysis that has been done in the past by someone else is based on that, and when I try to rerun the program file to replicate th results a problem occurs and dups data comes up with 0 entry (can someone please interpret this for me).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data dups ;&lt;BR /&gt;set work.pbs ;&lt;BR /&gt;by q1_code ;&lt;BR /&gt;if first.q1_code + last.q1_code &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&amp;lt;&lt;/FONT&gt;&lt;/STRONG&gt; 2 then output ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: There were 3476 observations read from the data set WORK.PBS.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: The data set WORK.DUPS has 0 observations and 8 variables.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data dups ;&lt;BR /&gt;set work.pbs ;&lt;BR /&gt;by q1_code ;&lt;BR /&gt;if first.q1_code + last.q1_code &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;=&lt;/FONT&gt;&lt;/STRONG&gt; 2 then output ;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: There were 3476 observations read from the data set WORK.PBS.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: The data set WORK.DUPS has 3476 observations and 8 variables.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data dups ;&lt;BR /&gt;set work.pbs ;&lt;BR /&gt;by q1_code ;&lt;BR /&gt;if first.q1_code + last.q1_code&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt; =&lt;/FONT&gt;&lt;/STRONG&gt; 1 then output ;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: There were 3476 observations read from the data set WORK.PBS.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: The data set WORK.DUPS has 0 observations and 8 variables.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;data dups ;&lt;BR /&gt;set work.pbs ;&lt;BR /&gt;by q1_code ;&lt;BR /&gt;if first.q1_code + last.q1_code &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;=&lt;/FONT&gt;&lt;/STRONG&gt; 3 then output ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: There were 3476 observations read from the data set WORK.PBS.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: The data set WORK.DUPS has 0 observations and 8 variables.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 22:01:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/325137#M271371</guid>
      <dc:creator>healtheconomist</dc:creator>
      <dc:date>2017-01-16T22:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/325142#M271372</link>
      <description>&lt;P&gt;Your dataset contains only one observation per q1_code. That's it. Since first. and last. are always true (=1), the sum of both is always 2.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 22:32:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/325142#M271372</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-16T22:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/325144#M271373</link>
      <description>&lt;P&gt;Your second step shows that all q1_code groups contain single records. They were all first &lt;STRONG&gt;and&lt;/STRONG&gt; last in their group.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 22:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/325144#M271373</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-01-16T22:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/325149#M271374</link>
      <description>&lt;P&gt;Thanks so much PGStats,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So that simply means there are no dubplicate q1_code records?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 22:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/325149#M271374</guid>
      <dc:creator>healtheconomist</dc:creator>
      <dc:date>2017-01-16T22:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: help needed in understanding a sas command , that looks simple</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/325150#M271375</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/52983"&gt;@healtheconomist&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks so much PGStats,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So that simply means there are no dubplicate q1_code records?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Aah, yes?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 23:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-needed-in-understanding-a-sas-command-that-looks-simple/m-p/325150#M271375</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-16T23:29:25Z</dc:date>
    </item>
  </channel>
</rss>

