<?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 proc import --excel worksheet in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-import-excel-worksheet/m-p/720743#M223290</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;code below is producing an error because the Sheet does not exist, which is true.&amp;nbsp;Can &lt;EM&gt;fileexist&lt;/EM&gt; be used&lt;STRONG&gt; to check for the existence of an excel worksheet?&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(and then conditionally continue to the next datastep only if the sheet&amp;nbsp;exists)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;proc import out=sae1a&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;datafile= "&amp;amp;sas_dir\sas_production\output\reconciliation\sae reconciliation_master.xlsx"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;dbms=excelcs replace;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;sheet='SAE-Discrepant$A7:AD999';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;ERROR: File _IMEX_.'SAE-Discrepant$A7:AD999'n.DATA does not exist&lt;/STRONG&gt;.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;data sae1b sae1c;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; length subject $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;150&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; rec1 &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;set sae1a (rename=OK_AS_IS__ENTER_YES_IF_UNRECONCI=ok_as_is);&lt;/P&gt;
&lt;P&gt;xxxx&lt;/P&gt;
&lt;P&gt;xxxx&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;ERROR: File WORK.SAE1A.DATA does not exist.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;DIV id="tinyMceEditorNJGIRL_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tinyMceEditorNJGIRL_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;Thanks for your time! NJGIRL&lt;/P&gt;</description>
    <pubDate>Sun, 21 Feb 2021 16:32:22 GMT</pubDate>
    <dc:creator>NJGIRL</dc:creator>
    <dc:date>2021-02-21T16:32:22Z</dc:date>
    <item>
      <title>proc import --excel worksheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-excel-worksheet/m-p/720743#M223290</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;code below is producing an error because the Sheet does not exist, which is true.&amp;nbsp;Can &lt;EM&gt;fileexist&lt;/EM&gt; be used&lt;STRONG&gt; to check for the existence of an excel worksheet?&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(and then conditionally continue to the next datastep only if the sheet&amp;nbsp;exists)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;proc import out=sae1a&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;datafile= "&amp;amp;sas_dir\sas_production\output\reconciliation\sae reconciliation_master.xlsx"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;dbms=excelcs replace;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;sheet='SAE-Discrepant$A7:AD999';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;ERROR: File _IMEX_.'SAE-Discrepant$A7:AD999'n.DATA does not exist&lt;/STRONG&gt;.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;data sae1b sae1c;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; length subject $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;150&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; rec1 &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;set sae1a (rename=OK_AS_IS__ENTER_YES_IF_UNRECONCI=ok_as_is);&lt;/P&gt;
&lt;P&gt;xxxx&lt;/P&gt;
&lt;P&gt;xxxx&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;ERROR: File WORK.SAE1A.DATA does not exist.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;DIV id="tinyMceEditorNJGIRL_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tinyMceEditorNJGIRL_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;Thanks for your time! NJGIRL&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 16:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-excel-worksheet/m-p/720743#M223290</guid>
      <dc:creator>NJGIRL</dc:creator>
      <dc:date>2021-02-21T16:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: proc import --excel worksheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-excel-worksheet/m-p/720744#M223291</link>
      <description>&lt;P&gt;You can define a libname (XLSX) to the Excel workbook, and then check dictionary.tables for the presence of the sheet (dataset).&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 16:41:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-excel-worksheet/m-p/720744#M223291</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-21T16:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc import --excel worksheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-excel-worksheet/m-p/720749#M223292</link>
      <description>Thanks!&lt;BR /&gt;&lt;BR /&gt;Let me give that a whirl.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 21 Feb 2021 17:19:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-excel-worksheet/m-p/720749#M223292</guid>
      <dc:creator>NJGIRL</dc:creator>
      <dc:date>2021-02-21T17:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: proc import --excel worksheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-excel-worksheet/m-p/721295#M223551</link>
      <description>Unfortunately, I can't get this to work. I established the Libname statement with the xlsx engine, then I  check for the existence, but  unsure of the code to proceed to next step and conditionally execute if the spreadsheet exists, if not, I need to bypass the datastep. any additional feedback? thanks!</description>
      <pubDate>Tue, 23 Feb 2021 15:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-excel-worksheet/m-p/721295#M223551</guid>
      <dc:creator>NJGIRL</dc:creator>
      <dc:date>2021-02-23T15:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: proc import --excel worksheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-excel-worksheet/m-p/721456#M223618</link>
      <description>&lt;P&gt;I suggest you try PROC CONTENTS after running your LIBNAME to report on the sheets SAS sees in your workbook:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname MyExcel XLSX "&amp;amp;sas_dir\sas_production\output\reconciliation\sae reconciliation_master.xlsx";
proc contents library = MyExcel;
run;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 02:58:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-excel-worksheet/m-p/721456#M223618</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-02-24T02:58:40Z</dc:date>
    </item>
  </channel>
</rss>

