<?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: Proc SQL MERGE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458364#M116314</link>
    <description>&lt;P&gt;all you need is a simple look up with a subquery like:&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 *
from  full_employee 
where employee_id not in (select employee_id from terminated);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 28 Apr 2018 14:59:37 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-04-28T14:59:37Z</dc:date>
    <item>
      <title>Proc SQL MERGE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458354#M116305</link>
      <description>&lt;P&gt;I have 2 data sets, One is containing terminated employees of the organisation and other contains full employee list(working and terminated both) now I want a data set which contain only working employee. I want to use proc sql merge. Please suggest which merge will get the correct data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance !!&lt;/P&gt;</description>
      <pubDate>Sat, 28 Apr 2018 14:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458354#M116305</guid>
      <dc:creator>Ankur32</dc:creator>
      <dc:date>2018-04-28T14:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL MERGE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458359#M116309</link>
      <description>&lt;P&gt;Where are the samples of the datasets?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Apr 2018 14:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458359#M116309</guid>
      <dc:creator>MarkWik</dc:creator>
      <dc:date>2018-04-28T14:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL MERGE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458360#M116310</link>
      <description>Hi:&lt;BR /&gt;  You can do either an SQL JOIN or a DATA step MERGE to get what you want. Does the full employee list have any variable such as termination date that you might use for filtering, instead of doing a JOIN or MERGE? Just curious how the "full" employee data might distinguish between employees who need to be paid and employees who do not need to be paid.&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Sat, 28 Apr 2018 14:47:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458360#M116310</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-04-28T14:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL MERGE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458361#M116311</link>
      <description>&lt;P&gt;I don't have data sets, question was asked in an interview.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Apr 2018 14:49:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458361#M116311</guid>
      <dc:creator>Ankur32</dc:creator>
      <dc:date>2018-04-28T14:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL MERGE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458362#M116312</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for replying. I have only employee id's. which join will give correct answer?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Apr 2018 14:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458362#M116312</guid>
      <dc:creator>Ankur32</dc:creator>
      <dc:date>2018-04-28T14:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL MERGE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458364#M116314</link>
      <description>&lt;P&gt;all you need is a simple look up with a subquery like:&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 *
from  full_employee 
where employee_id not in (select employee_id from terminated);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 28 Apr 2018 14:59:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458364#M116314</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-04-28T14:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL MERGE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458366#M116315</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks very much for the reply. Shall we use Join? This question was asked in an interview and they asked me which join will be used to get the data set.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Apr 2018 15:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458366#M116315</guid>
      <dc:creator>Ankur32</dc:creator>
      <dc:date>2018-04-28T15:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL MERGE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458368#M116316</link>
      <description>&lt;P&gt;You mentioned&lt;EM&gt;&lt;STRONG&gt; "I want a data set which contain only working employee."&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Challenge your interviewer why you need a join. The need for join arises only when you need to extract a variable/variables from the look up dataset. Your interview question doesn't seem to mandate a pull of any external information. All the best!&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Apr 2018 15:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458368#M116316</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-04-28T15:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL MERGE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458369#M116317</link>
      <description>This is definitely what I would do in this situation.  No need to actually merge datasets.</description>
      <pubDate>Sat, 28 Apr 2018 15:30:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458369#M116317</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2018-04-28T15:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL MERGE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458398#M116327</link>
      <description>&lt;P&gt;If all you had were IDs you could do:&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 employee_id from full_employee 
except
select employee_id from terminated;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;again, not a join.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Apr 2018 20:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458398#M116327</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-04-28T20:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL MERGE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458443#M116351</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select a.employee_id
from  full_employee  a
full join 
terminated b
on a.employee_id = b.employee_id
where b.employee_id is missing&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;with join need to do a full join followed by employee_id is missing for terminated table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Apr 2018 15:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-MERGE/m-p/458443#M116351</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-04-29T15:03:19Z</dc:date>
    </item>
  </channel>
</rss>

