<?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: 2 dataset, list different observations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/2-dataset-list-different-observations/m-p/239008#M43936</link>
    <description>&lt;P&gt;Look at Proc Compare OR look into SASHELP.VTABLE for the column names from each table, variables that aren't duplicate are unique to each table.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Dec 2015 22:03:23 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-12-11T22:03:23Z</dc:date>
    <item>
      <title>2 dataset, list different observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-dataset-list-different-observations/m-p/239007#M43935</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 2 datasets a and b.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A has 2155 observations and 15 variables. (Product of a left join)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;B has 2171 observations and 12 variables.(Product of a left join)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ANd only 5 variables are common to both the datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to list the extra varables in the dataset B?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Archana&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 21:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-dataset-list-different-observations/m-p/239007#M43935</guid>
      <dc:creator>ArchanaSudhir</dc:creator>
      <dc:date>2015-12-11T21:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: 2 dataset, list different observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-dataset-list-different-observations/m-p/239008#M43936</link>
      <description>&lt;P&gt;Look at Proc Compare OR look into SASHELP.VTABLE for the column names from each table, variables that aren't duplicate are unique to each table.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 22:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-dataset-list-different-observations/m-p/239008#M43936</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-11T22:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: 2 dataset, list different observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-dataset-list-different-observations/m-p/239009#M43937</link>
      <description>&lt;P&gt;Dataset variable names are in pseudo-table dictionary.columns:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select name from dictionary.columns
where libname="WORK" and memname="B" and 
    name not in (
        select name from dictionary.columns
        where libname="WORK" and memname="A");
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Dec 2015 22:14:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-dataset-list-different-observations/m-p/239009#M43937</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-12-11T22:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: 2 dataset, list different observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/2-dataset-list-different-observations/m-p/239187#M43968</link>
      <description>&lt;P&gt;This will pull only the variables that are in B and not A:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data a;&lt;BR /&gt;input var1 var2;&lt;BR /&gt;cards;&lt;BR /&gt;1 2&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data b;&lt;BR /&gt;input var1 var2 var3;&lt;BR /&gt;cards;&lt;BR /&gt;1 2 3&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc transpose data=a out=tran_a (keep=_NAME_);&lt;BR /&gt;&lt;BR /&gt;proc transpose data=b out=tran_b (keep=_NAME_);&lt;BR /&gt;&lt;BR /&gt;data a_vars b_vars both_vars;&lt;BR /&gt;merge tran_a(in=a)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tran_b(in=b);&lt;BR /&gt;by _NAME_;&lt;BR /&gt;if a and not b then output a_vars;&lt;BR /&gt;if b and not a then output b_vars;&lt;BR /&gt;if a and b then output both_vars;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;select _NAME_&lt;BR /&gt;into :var_names&lt;BR /&gt;separated by ','&lt;BR /&gt;from b_vars;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table want as&lt;BR /&gt;select &amp;amp;var_names&lt;BR /&gt;from b;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 16:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/2-dataset-list-different-observations/m-p/239187#M43968</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-12-14T16:26:34Z</dc:date>
    </item>
  </channel>
</rss>

