<?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 Common variable in a library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Common-variable-in-a-library/m-p/731513#M227863</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title ' How to find Common variables in a Library';

data ds;
set sashelp.class;
run;

data ds1;
set sashelp.class;
run;



proc sql;
select * from dictionary.columns 
where libname='WORK'
and memname in ('DS', 'DS1')
group by upcase(Sex)
having count(*)&amp;gt;1;
quit;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;CODE class=" language-sas"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;ERROR:&lt;/FONT&gt;&lt;/STRONG&gt; The following columns were not found in the contributing tables: Sex.&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Apr 2021 06:52:27 GMT</pubDate>
    <dc:creator>BrahmanandaRao</dc:creator>
    <dc:date>2021-04-06T06:52:27Z</dc:date>
    <item>
      <title>Common variable in a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Common-variable-in-a-library/m-p/731513#M227863</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title ' How to find Common variables in a Library';

data ds;
set sashelp.class;
run;

data ds1;
set sashelp.class;
run;



proc sql;
select * from dictionary.columns 
where libname='WORK'
and memname in ('DS', 'DS1')
group by upcase(Sex)
having count(*)&amp;gt;1;
quit;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;CODE class=" language-sas"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;ERROR:&lt;/FONT&gt;&lt;/STRONG&gt; The following columns were not found in the contributing tables: Sex.&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 06:52:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Common-variable-in-a-library/m-p/731513#M227863</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2021-04-06T06:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Common variable in a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Common-variable-in-a-library/m-p/731516#M227865</link>
      <description>&lt;P&gt;And what is the question?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 06:49:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Common-variable-in-a-library/m-p/731516#M227865</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-06T06:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Common variable in a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Common-variable-in-a-library/m-p/731519#M227867</link>
      <description>&lt;P&gt;Dictionary.columns has no variable named SEX.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;maybe you wanted&lt;/P&gt;
&lt;P&gt;"and upcase(name)='SEX' "&lt;/P&gt;
&lt;P&gt;on the where statement and then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;group by Upcase(name)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or maybe completely ignoring the "memname in " part of the where if you are looking for the number of data sets that have "SEX" as a variable.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 07:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Common-variable-in-a-library/m-p/731519#M227867</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-06T07:05:38Z</dc:date>
    </item>
  </channel>
</rss>

