<?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: If first.memberiD then output? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770096#M244255</link>
    <description>&lt;P&gt;You would do well to teach yourself.&amp;nbsp; Besides reading the documentation, try running a test program.&amp;nbsp; Here is an example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mystestdata;
set fromthissorted;
by memberID;
first = first.memberID;
last = last.memberID;
Run;
proc print;
var memberID first last;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 Sep 2021 03:08:08 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2021-09-24T03:08:08Z</dc:date>
    <item>
      <title>If first.memberiD then output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770069#M244242</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;if I have data as&lt;/P&gt;
&lt;PRE&gt; data mystestdata;
set fromthissorted
by memberID;
if first.memberID then output;
Run;&lt;/PRE&gt;
&lt;P&gt;if first.memberID means from the grouped data, only read the first memberID from the group?&lt;/P&gt;
&lt;P&gt;Please advise me.&lt;/P&gt;
&lt;P&gt;Respectfully,&lt;/P&gt;
&lt;P&gt;blueblue&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 22:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770069#M244242</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-09-23T22:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: If first.memberiD then output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770071#M244244</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;if I have data as&lt;/P&gt;
&lt;PRE&gt; data mystestdata;
set fromthissorted
by memberID;
if first.memberID then output;
Run;&lt;/PRE&gt;
&lt;P&gt;if first.memberID means from the grouped data, only read the first memberID?&lt;/P&gt;
&lt;P&gt;Please advise me.&lt;/P&gt;
&lt;P&gt;Respectfully,&lt;/P&gt;
&lt;P&gt;blueblue&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;After you correct the code so that the Set statement has a terminating semicolon ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not read, when encountered. This will "read" all the records in the data set(s) on the Set statement.&lt;/P&gt;
&lt;P&gt;If the data is sorted by the By variable then only the records that are the first for each value of the by variable will be written to the output data set. If not sorted an error will be thrown.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 22:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770071#M244244</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-09-23T22:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: If first.memberiD then output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770096#M244255</link>
      <description>&lt;P&gt;You would do well to teach yourself.&amp;nbsp; Besides reading the documentation, try running a test program.&amp;nbsp; Here is an example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mystestdata;
set fromthissorted;
by memberID;
first = first.memberID;
last = last.memberID;
Run;
proc print;
var memberID first last;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Sep 2021 03:08:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770096#M244255</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-09-24T03:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: If first.memberiD then output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770103#M244260</link>
      <description>&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;READ&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;THE&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="7"&gt;&lt;FONT size="5"&gt;DOCUMENTATION&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;the link to which (this particular documentation!) I already gave you.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;And apply Maxim 4. Try It.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Sep 2021 05:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770103#M244260</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-24T05:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: If first.memberiD then output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770554#M244478</link>
      <description>&lt;P&gt;Hello ballardw,&lt;/P&gt;
&lt;P&gt;When you say: "&lt;SPAN&gt;&amp;nbsp;that are the first for each value of the by variable will be written to the output data set"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you mean the first for each group?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please let me know.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;blueblue&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 01:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770554#M244478</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-09-27T01:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: If first.memberiD then output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770567#M244487</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello ballardw,&lt;/P&gt;
&lt;P&gt;When you say: "&lt;SPAN&gt;&amp;nbsp;that are the first for each value of the by variable will be written to the output data set"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you mean the first for each group?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please let me know.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;blueblue&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Each distinct value of a BY variable constitutes a group.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 05:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/770567#M244487</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-27T05:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: If first.memberiD then output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/774771#M246265</link>
      <description>Hello, &lt;BR /&gt;How do you know I have not read the documentation? I have read it a several time and I watched video tutorials. Please kindly bear with me. If we could understand each topic with reading, then what is the point of going to school?&lt;BR /&gt;Respecctfully,&lt;BR /&gt;Blueblue</description>
      <pubDate>Sun, 17 Oct 2021 22:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-first-memberiD-then-output/m-p/774771#M246265</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-10-17T22:20:39Z</dc:date>
    </item>
  </channel>
</rss>

