<?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 Impossible to post an answer in All Things Community</title>
    <link>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231196#M1140</link>
    <description>&lt;P&gt;Hello, I am encountering a situation where it is impossible for me to post an answer to a topic. I tried three times. Every time I submit a post, it is like nothing happened. The topic is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Matching-main-dataset-to-sub-datasets-based-on-date-var/m-p/231195#M42034" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Matching-main-dataset-to-sub-datasets-based-on-date-var/m-p/231195#M42034&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Oct 2015 16:06:38 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2015-10-22T16:06:38Z</dc:date>
    <item>
      <title>Impossible to post an answer</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231196#M1140</link>
      <description>&lt;P&gt;Hello, I am encountering a situation where it is impossible for me to post an answer to a topic. I tried three times. Every time I submit a post, it is like nothing happened. The topic is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Matching-main-dataset-to-sub-datasets-based-on-date-var/m-p/231195#M42034" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Matching-main-dataset-to-sub-datasets-based-on-date-var/m-p/231195#M42034&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 16:06:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231196#M1140</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-10-22T16:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Impossible to post an answer</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231200#M1141</link>
      <description>&lt;P&gt;Looks like the original message has been deleted, so that would mean you can't reply to it.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 16:17:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231200#M1141</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-10-22T16:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Impossible to post an answer</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231203#M1142</link>
      <description>&lt;P&gt;I can still see the message. The Reply button on top is dimmed, but the one on the bottom is active. What makes you say the message has been deleted?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 16:23:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231203#M1142</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-10-22T16:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Impossible to post an answer</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231220#M1143</link>
      <description>&lt;P&gt;It may be a browser cache issue that you see it. I tried the link and got a 'not found' page.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 17:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231220#M1143</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-10-22T17:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Impossible to post an answer</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231224#M1144</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw﻿&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller﻿&lt;/a&gt;. Too bad, I had a good answer to the question&amp;nbsp;&lt;img id="smileyfrustrated" class="emoticon emoticon-smileyfrustrated" src="https://communities.sas.com/i/smilies/16x16_smiley-frustrated.png" alt="Smiley Frustrated" title="Smiley Frustrated" /&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 17:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231224#M1144</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-10-22T17:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Impossible to post an answer</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231225#M1145</link>
      <description>&lt;P&gt;I get a "message not found" error when I click on the link.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, there's no reason you have to waste a good answer! You can post the answer here!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 17:33:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231225#M1145</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-10-22T17:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Impossible to post an answer</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231226#M1146</link>
      <description>&lt;P&gt;The Communities was down for a while in that time period. I got a message that said "Doing maintenance."&amp;nbsp; Maybe the OP will repost!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 17:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231226#M1146</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-10-22T17:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Impossible to post an answer</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231227#M1147</link>
      <description>&lt;P&gt;Good idea&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller﻿&lt;/a&gt;, The question was&lt;/P&gt;
&lt;PRE&gt;Hi,
 
I have a dataset at the person level with an ID and a date variable, and 5 sub-datasets, each of which represents the patients' data in a single year. 
 
What I want is to join the dataset to the sub-datasets on ID, but I only want to pull in data from the sub-datasets in the sub-dataset representing the year closest to the year of the date variable, eg:
 
Main dataset:
ID   Date            
1    10/5/2010
2     1/3/2012
 
Sub dataset 2011:
ID   var1   var2   var3
1      a       b       c
 
Sub dataset 2012:
ID   var1   var2   var3
2      d       e        f
 
So after the join, it should be like this:
 
ID     Date            closest_var1    closest_var2    closest_var3
1    10/5/2010                 a                    b                    c
2     1/3/2012                  d                    e                    f
 
Any help is much appreciated.&lt;/PRE&gt;
&lt;P&gt;and my answer was:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Three methods:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select m.date, s.* from main as m inner join sub2010 as s on m.id=s.id where year(m.date)=2010
union all
select m.date, s.* from main as m inner join sub2011 as s on m.id=s.id where year(m.date)=2011
union all
select m.date, s.* from main as m inner join sub2012 as s on m.id=s.id where year(m.date)=2012
union all
select m.date, s.* from main as m inner join sub2013 as s on m.id=s.id where year(m.date)=2013
union all
select m.date, s.* from main as m inner join sub2014 as s on m.id=s.id where year(m.date)=2014;
quit;

proc sql;
create table want as
select m.date, s.* from
	main as m inner join
	(	select 2010 as year, * from sub2010 union all
		select 2011 as year, * from sub2011 union all
		select 2012 as year, * from sub2012 union all
		select 2013 as year, * from sub2013 union all
		select 2014 as year, * from sub2014 ) as s
	on m.id=s.id and year(m.date) = s.year;
quit;

data s;
set sub: indsname=ds;
year = input(compress(ds,,"DK"), best.);
run;

proc sql;
create table want as
select m.date, s.* from main as m inner join s on m.id=s.id and year(m.date)=s.year;
drop table s;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There, I've said it. Feels better.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 17:38:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Impossible-to-post-an-answer/m-p/231227#M1147</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-10-22T17:38:21Z</dc:date>
    </item>
  </channel>
</rss>

