<?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: Matching by variables when values repeat in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Matching-by-variables-when-values-repeat/m-p/178382#M3586</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, as I look more closely at your original example, the problem might be a lot easier. Does the following do what you want?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anova_03b0 (keep=extremity_0) anova_03b1 (drop=extremity_0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set anova_03b;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; if missing(extremity_1) then output anova_03b0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else output anova_03b1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anova_03bb;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set anova_03b1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set anova_03b0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 22 Feb 2015 20:59:15 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2015-02-22T20:59:15Z</dc:date>
    <item>
      <title>Matching by variables when values repeat</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Matching-by-variables-when-values-repeat/m-p/178378#M3582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I would like to make my dataset "anova_3b" look like "anova_3bb" (see attached picture). I know I can't merge by cohort/attention because there are more than one observation per combination. Could you please shed some light on how I can tranform my dataset?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Juan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Feb 2015 02:45:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Matching-by-variables-when-values-repeat/m-p/178378#M3582</guid>
      <dc:creator>jcabrera</dc:creator>
      <dc:date>2015-02-22T02:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Matching by variables when values repeat</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Matching-by-variables-when-values-repeat/m-p/178379#M3583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I correctly understand how you are trying to collapse your data wouldn't something like the following work?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anova_03bb (drop=last:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set anova_03b;&lt;/P&gt;&lt;P&gt;&amp;nbsp; last_trial=lag(trial);&lt;/P&gt;&lt;P&gt;&amp;nbsp; last_extremity_1=lag(extremity_1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; last_extremity_0=lag(extremity_0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if mod(_n_,2) eq 0 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if missing(extremity_1) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trial=last_trial;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extremity_1=last_extremity_1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else extremity_0=last_extremity_0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Feb 2015 04:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Matching-by-variables-when-values-repeat/m-p/178379#M3583</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-02-22T04:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Matching by variables when values repeat</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Matching-by-variables-when-values-repeat/m-p/178380#M3584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arthur,&lt;/P&gt;&lt;P&gt;Thank you very much for looking into this. The code you gave me creates some missing observations where there should be a data value. I tried to work with it and find the reason but I could not figure it out. Below is the dataset resulting from running the code you provided me with (there should be 24 obs for &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Extremity_0 and 24 obs for Extremity_1) . Thanks again for looking into this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="doc1.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/9251_doc1.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Feb 2015 19:31:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Matching-by-variables-when-values-repeat/m-p/178380#M3584</guid>
      <dc:creator>jcabrera</dc:creator>
      <dc:date>2015-02-22T19:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Matching by variables when values repeat</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Matching-by-variables-when-values-repeat/m-p/178381#M3585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would have to post your data file in order to see what you actually have. A picture of it doesn't help much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Feb 2015 19:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Matching-by-variables-when-values-repeat/m-p/178381#M3585</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-02-22T19:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Matching by variables when values repeat</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Matching-by-variables-when-values-repeat/m-p/178382#M3586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, as I look more closely at your original example, the problem might be a lot easier. Does the following do what you want?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anova_03b0 (keep=extremity_0) anova_03b1 (drop=extremity_0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set anova_03b;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; if missing(extremity_1) then output anova_03b0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else output anova_03b1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data anova_03bb;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set anova_03b1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set anova_03b0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Feb 2015 20:59:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Matching-by-variables-when-values-repeat/m-p/178382#M3586</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-02-22T20:59:15Z</dc:date>
    </item>
  </channel>
</rss>

