<?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: Member enroll and drop with Merge statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Member-enroll-and-drop-with-Merge-statement/m-p/321688#M71088</link>
    <description>&lt;P&gt;Regarding question #1, there is no need to make any changes. &amp;nbsp;You later select observations where MEMBER did not appear in both data sets (a ^= b), so the remaining observations will not face any overwriting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding question #2, you haven't shown us your expectations. &amp;nbsp;Give just one example (a single MEMBER) and show us what you expect and what happened in the SAS program.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Dec 2016 03:53:59 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-12-30T03:53:59Z</dc:date>
    <item>
      <title>Member enroll and drop with Merge statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Member-enroll-and-drop-with-Merge-statement/m-p/321681#M71084</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question about member enrolling and dropping. Suppose there are Jan, Feb, March, ... Dec 2016 member data, total 12 dataset. In each dataset, variables are the same (&amp;gt;100 variables). Would like to see who drops and who enrolls. My code is as following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%LET measure = var1;&lt;/P&gt;&lt;P&gt;data enroll (keep=MEMBERID &amp;amp;measure flag) drop (keep=MEMBERID &amp;amp;measure flag);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; merge Jan2016Data (keep=MEMBER &amp;amp;measure IN=a) Feb2016Data (keep=MEMBER &amp;amp;measure IN=b);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by member;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if b then flag="enroll";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if a then flag="drop";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if &amp;amp;measure ^= ""; /*there are many missing value which need to be excluded basing on the requirement*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if a ^= b;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if flag="enroll" then output enroll;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if flag="drop" then output drop;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Issure:&lt;/P&gt;&lt;P&gt;1. how to make &amp;amp;measure in Feb2016Data &lt;U&gt;not&lt;/U&gt; to overwrite Jan2016Data?&lt;/P&gt;&lt;P&gt;2. Why sas result is different than my manual result (compared in excel)? Is there anything wroing? (no error msg in log)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;Viv&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 02:57:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Member-enroll-and-drop-with-Merge-statement/m-p/321681#M71084</guid>
      <dc:creator>fannavivian</dc:creator>
      <dc:date>2016-12-30T02:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Member enroll and drop with Merge statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Member-enroll-and-drop-with-Merge-statement/m-p/321688#M71088</link>
      <description>&lt;P&gt;Regarding question #1, there is no need to make any changes. &amp;nbsp;You later select observations where MEMBER did not appear in both data sets (a ^= b), so the remaining observations will not face any overwriting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding question #2, you haven't shown us your expectations. &amp;nbsp;Give just one example (a single MEMBER) and show us what you expect and what happened in the SAS program.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 03:53:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Member-enroll-and-drop-with-Merge-statement/m-p/321688#M71088</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-12-30T03:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Member enroll and drop with Merge statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Member-enroll-and-drop-with-Merge-statement/m-p/321696#M71094</link>
      <description>&lt;P&gt;I would consider a different algorithm as that won't scale.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider appending data instead of merging and using INDSNAME to obtain source.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data monthly;&lt;/P&gt;
&lt;P&gt;set jan2016 (keep=memberId)&lt;/P&gt;
&lt;P&gt;feb2016(keep=memberid)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;dec2016(keep=memberid) INDSNAME=source;&lt;/P&gt;
&lt;P&gt;input_dataset = source;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can then use the file above to prepare summaries. Note that you'll need previous months record to determine who is new in January.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 04:58:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Member-enroll-and-drop-with-Merge-statement/m-p/321696#M71094</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-30T04:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Member enroll and drop with Merge statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Member-enroll-and-drop-with-Merge-statement/m-p/321743#M71104</link>
      <description>&lt;P&gt;question #1 &amp;nbsp;- &amp;nbsp;Yeah, your are absolutely right! I forgot that point.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 14:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Member-enroll-and-drop-with-Merge-statement/m-p/321743#M71104</guid>
      <dc:creator>fannavivian</dc:creator>
      <dc:date>2016-12-30T14:54:58Z</dc:date>
    </item>
  </channel>
</rss>

