<?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 compare the datasets name and the imported excel sheets name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-the-datasets-name-and-the-imported-excel-sheets/m-p/310305#M66916</link>
    <description>&lt;PRE&gt;
CODE NOT TESTED.


libname xx xlsx 'c:\temp\x.xlsx';

proc sql;

select upcase(memname) from dictionary.members
 where libname='XX'

except

select upcase(memname) from dictionary.members
 where libname='MYLIB' ;

quit;


&lt;/PRE&gt;</description>
    <pubDate>Wed, 09 Nov 2016 07:35:47 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-11-09T07:35:47Z</dc:date>
    <item>
      <title>how to compare the datasets name and the imported excel sheets name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-the-datasets-name-and-the-imported-excel-sheets/m-p/309975#M66805</link>
      <description>&lt;P&gt;I have a library with 5 datasets(for eg: a,b,c,d,e,f) and i have a excel file with 3 sheets (sheet name: a,e,d). i need to do some process only for the matching datasets names in both excel as well as in datasets. the datasets name not matched with excel sheet name should throw an exception like "dataset f is no in excel file". can anyone help me to solve this.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 07:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-the-datasets-name-and-the-imported-excel-sheets/m-p/309975#M66805</guid>
      <dc:creator>ramuking003</dc:creator>
      <dc:date>2016-11-08T07:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare the datasets name and the imported excel sheets name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-the-datasets-name-and-the-imported-excel-sheets/m-p/309978#M66806</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use the SASHELP.VSTABLE as dataset to find tables that are used in multiple libraries. Here is a simple code that should list all the tables in a library which have the same name as tables (worksheets) from an Excel file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname myxlsx XLSX 'c:\demo.xlsx';&lt;BR /&gt;libname myLIB 'c:\temp';&lt;BR /&gt;&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;select memname&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;into :fromXLS separated by '","'&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;from sashelp.vstable&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;where libname = "MYXLSX";&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;select libname, memname&lt;BR /&gt;from sashelp.vstable&lt;BR /&gt;where libname = "MYLIB" and memname in ("&amp;amp;fromXLS");&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had no time to validate that code but it should do the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a good day!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 08:27:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-the-datasets-name-and-the-imported-excel-sheets/m-p/309978#M66806</guid>
      <dc:creator>XavierBizoux</dc:creator>
      <dc:date>2016-11-08T08:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare the datasets name and the imported excel sheets name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-the-datasets-name-and-the-imported-excel-sheets/m-p/309998#M66811</link>
      <description>&lt;P&gt;So, are you sure the datasets Exactly match the Excel file? &amp;nbsp;How have you tested this, how are you accessing the Excel file? &amp;nbsp;If your reading in data then you can simply state:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table DATASETS_IN_BOTH as
  select  MEMNAME
  from    SASHELP.VTABLE
  where  LIBNAME="&amp;lt;excel libname&amp;gt;"
    and   MEMNAME in (select distinct MEMNAME from SASHELP.VTABLE where libname="&amp;lt;dataset libname");
quit;&lt;/PRE&gt;
&lt;P&gt;That will give you a dataset with all the matching dataset names - you could also just merge the two. &amp;nbsp;However it is likely that if your dealing with Excel data, then you may have naming issues and plenty of other problems.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 09:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-the-datasets-name-and-the-imported-excel-sheets/m-p/309998#M66811</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-08T09:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to compare the datasets name and the imported excel sheets name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-compare-the-datasets-name-and-the-imported-excel-sheets/m-p/310305#M66916</link>
      <description>&lt;PRE&gt;
CODE NOT TESTED.


libname xx xlsx 'c:\temp\x.xlsx';

proc sql;

select upcase(memname) from dictionary.members
 where libname='XX'

except

select upcase(memname) from dictionary.members
 where libname='MYLIB' ;

quit;


&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Nov 2016 07:35:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-compare-the-datasets-name-and-the-imported-excel-sheets/m-p/310305#M66916</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-09T07:35:47Z</dc:date>
    </item>
  </channel>
</rss>

