<?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: how to make this result possible? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-make-this-result-possible/m-p/70746#M20367</link>
    <description>PROC SQL;&lt;BR /&gt;
CREATE TABLE Combined AS&lt;BR /&gt;
SELECT	u1.*,&lt;BR /&gt;
u2.*, case when u1.id is not null and u2.idx is not null then 1 else 0 end as Var999&lt;BR /&gt;
FROM test as u1 FULL JOIN test2 as u2&lt;BR /&gt;
ON u1.ID = (u2.IDX)/100	&lt;BR /&gt;
;	&lt;BR /&gt;
QUIT;</description>
    <pubDate>Fri, 27 May 2011 22:15:36 GMT</pubDate>
    <dc:creator>DBailey</dc:creator>
    <dc:date>2011-05-27T22:15:36Z</dc:date>
    <item>
      <title>how to make this result possible?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-make-this-result-possible/m-p/70745#M20366</link>
      <description>Dear All&lt;BR /&gt;
&lt;BR /&gt;
Suppose I have following codes:&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
input ID Var1;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 1&lt;BR /&gt;
2 2&lt;BR /&gt;
3 3&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data test2;&lt;BR /&gt;
input IDX Var100;&lt;BR /&gt;
cards;&lt;BR /&gt;
100 100&lt;BR /&gt;
200 200&lt;BR /&gt;
400 400&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
CREATE TABLE Combined AS&lt;BR /&gt;
SELECT	u1.*,&lt;BR /&gt;
		u2.*												&lt;BR /&gt;
FROM test as u1 FULL JOIN test2 as u2&lt;BR /&gt;
ON u1.ID = (u2.IDX)/100		&lt;BR /&gt;
;	&lt;BR /&gt;
QUIT;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The created data set Combined look like:&lt;BR /&gt;
&lt;BR /&gt;
ID Var1 IDX VAR100&lt;BR /&gt;
1 1 100 100&lt;BR /&gt;
2 2 200 200&lt;BR /&gt;
3 3 . .&lt;BR /&gt;
. . 400 400&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Now I want to careate one more Variable, Say Var999 that tells whether the combined data contains data from both dataset test and dataset test2 so that the created data set Combined will look like:&lt;BR /&gt;
&lt;BR /&gt;
ID Var1 IDX VAR100 Var999&lt;BR /&gt;
1 1 100 100 1&lt;BR /&gt;
2 2 200 200 1&lt;BR /&gt;
3 3 . . 0&lt;BR /&gt;
. . 400 400 0&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Can someone tell me how to do it?</description>
      <pubDate>Fri, 27 May 2011 21:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-make-this-result-possible/m-p/70745#M20366</guid>
      <dc:creator>littlestone</dc:creator>
      <dc:date>2011-05-27T21:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to make this result possible?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-make-this-result-possible/m-p/70746#M20367</link>
      <description>PROC SQL;&lt;BR /&gt;
CREATE TABLE Combined AS&lt;BR /&gt;
SELECT	u1.*,&lt;BR /&gt;
u2.*, case when u1.id is not null and u2.idx is not null then 1 else 0 end as Var999&lt;BR /&gt;
FROM test as u1 FULL JOIN test2 as u2&lt;BR /&gt;
ON u1.ID = (u2.IDX)/100	&lt;BR /&gt;
;	&lt;BR /&gt;
QUIT;</description>
      <pubDate>Fri, 27 May 2011 22:15:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-make-this-result-possible/m-p/70746#M20367</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2011-05-27T22:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to make this result possible?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-make-this-result-possible/m-p/70747#M20368</link>
      <description>thank you very much.&lt;BR /&gt;
&lt;BR /&gt;
Have a nice holiday.</description>
      <pubDate>Sat, 28 May 2011 01:17:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-make-this-result-possible/m-p/70747#M20368</guid>
      <dc:creator>littlestone</dc:creator>
      <dc:date>2011-05-28T01:17:50Z</dc:date>
    </item>
  </channel>
</rss>

