<?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: Pulling required observations from 2 data sets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335623#M76000</link>
    <description>&lt;P&gt;This will give you everyone from A who is also in B (i.e. excludes those from A who are not in B)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;create table C as
select *
from A
where yourIDVar in (select yourIDVar from B);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 Feb 2017 15:48:03 GMT</pubDate>
    <dc:creator>nehalsanghvi</dc:creator>
    <dc:date>2017-02-24T15:48:03Z</dc:date>
    <item>
      <title>Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335613#M75994</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help me, I want to pull required data from 2 dataset with a data step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;datasetA:&lt;/P&gt;&lt;P&gt;101 bike&lt;/P&gt;&lt;P&gt;102 car&amp;nbsp;&lt;/P&gt;&lt;P&gt;103 bike&lt;/P&gt;&lt;P&gt;104 car&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;datasetB:&lt;/P&gt;&lt;P&gt;105 car&lt;/P&gt;&lt;P&gt;101 bike&amp;nbsp;&lt;/P&gt;&lt;P&gt;102 car&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want&amp;nbsp;to exclude the observations which are not in datasetB and in datasetA as follow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;datasetC:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;101 bike&lt;/P&gt;&lt;P&gt;102 car&lt;/P&gt;&lt;P&gt;103 bike&lt;/P&gt;&lt;P&gt;105 car&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: here In C observation: &lt;STRONG&gt;104 should be missed , and 105 should be there&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 15:18:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335613#M75994</guid>
      <dc:creator>ysantosh18</dc:creator>
      <dc:date>2017-02-24T15:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335615#M75995</link>
      <description>&lt;P&gt;Why is 103 bike in the desired set. Are you matching on one or both variables?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 15:28:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335615#M75995</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-02-24T15:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335616#M75996</link>
      <description>&lt;P&gt;No, I want to keep the records of A and B and exclude the record which is not in B and in A&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 15:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335616#M75996</guid>
      <dc:creator>ysantosh18</dc:creator>
      <dc:date>2017-02-24T15:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335617#M75997</link>
      <description>&lt;P&gt;103 bike is one of two records not in B and in A, so why have you put it in your desired output dataset C?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 15:34:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335617#M75997</guid>
      <dc:creator>nehalsanghvi</dc:creator>
      <dc:date>2017-02-24T15:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335618#M75998</link>
      <description>Perhaps it's because of long working week, but I don't get the logic. Perhaps if you describe the business requirement it would be a bit clearer. &lt;BR /&gt;Also, why data step if e.g. SQL is better suited?</description>
      <pubDate>Fri, 24 Feb 2017 15:34:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335618#M75998</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-02-24T15:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335622#M75999</link>
      <description>&lt;P&gt;Am working with Clinical data, for Subject Elements, I need to set them One by One, if they are not in datasetB, they are said to be Non-completers of the study, so I've to exclude those subjects from A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 15:43:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335622#M75999</guid>
      <dc:creator>ysantosh18</dc:creator>
      <dc:date>2017-02-24T15:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335623#M76000</link>
      <description>&lt;P&gt;This will give you everyone from A who is also in B (i.e. excludes those from A who are not in B)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;create table C as
select *
from A
where yourIDVar in (select yourIDVar from B);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Feb 2017 15:48:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335623#M76000</guid>
      <dc:creator>nehalsanghvi</dc:creator>
      <dc:date>2017-02-24T15:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335626#M76002</link>
      <description>&lt;P&gt;thanks for, but it worked for records who are in both the datasets&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 15:55:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335626#M76002</guid>
      <dc:creator>ysantosh18</dc:creator>
      <dc:date>2017-02-24T15:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335632#M76004</link>
      <description>&lt;P&gt;Let's break this down Santosh. You do not want those obs&amp;nbsp;from A which are not in B, This throws out:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;STRONG&gt;103&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; bike&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;STRONG&gt;104&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; car&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;You say you do want &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;105&lt;/FONT&gt;&lt;/STRONG&gt; car in dataset C:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;In this case, are you simply not looking for the dataset B itself? What are we not getting?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 16:02:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335632#M76004</guid>
      <dc:creator>nehalsanghvi</dc:creator>
      <dc:date>2017-02-24T16:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335633#M76005</link>
      <description>&lt;P&gt;Yes!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 16:05:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335633#M76005</guid>
      <dc:creator>ysantosh18</dc:creator>
      <dc:date>2017-02-24T16:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335634#M76006</link>
      <description>&lt;P&gt;Okay, so are you all set? You just need dataset B? There is no coding problem to solve?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 16:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335634#M76006</guid>
      <dc:creator>nehalsanghvi</dc:creator>
      <dc:date>2017-02-24T16:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335637#M76008</link>
      <description>&lt;P&gt;Not like that, As I said have to exclude the records which are "not in B" and "in A", Have to keep the records which are "in B" and "not in A"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 16:10:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335637#M76008</guid>
      <dc:creator>ysantosh18</dc:creator>
      <dc:date>2017-02-24T16:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335639#M76009</link>
      <description>&lt;P&gt;Obviouslly, those of us reading this trhead don't understand what you are trying to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For each of the 4 records in data set c, separately, please explain why they were selected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 16:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335639#M76009</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-02-24T16:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335648#M76012</link>
      <description>&lt;P&gt;thanks all for your support!&lt;/P&gt;&lt;P&gt;I apologise for not being clear, My situation is like that!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Working with clinical data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let us take an example of Acadamic class,&lt;/P&gt;&lt;P&gt;class6 and class8&lt;/P&gt;&lt;P&gt;Class8 may have promoted students who are succeded, and class6 are striving for success, and if students not in class8 of class6 are said to be failures, and if there are individual&amp;nbsp;students of both the classes are said to be succeeded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;still am not clear&lt;/P&gt;&lt;P&gt;No problem&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 16:33:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335648#M76012</guid>
      <dc:creator>ysantosh18</dc:creator>
      <dc:date>2017-02-24T16:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling required observations from 2 data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335738#M76035</link>
      <description>Your description is called as "left join".&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table dataset_c as&lt;BR /&gt;select dataset_a.*, dataset_b.*&lt;BR /&gt;from dataset_a LEFT OUTER&lt;BR /&gt;join dataset_b on dataset_a.student=table_b.student; quit;&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Feb 2017 20:53:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pulling-required-observations-from-2-data-sets/m-p/335738#M76035</guid>
      <dc:creator>Yavuz</dc:creator>
      <dc:date>2017-02-24T20:53:03Z</dc:date>
    </item>
  </channel>
</rss>

