<?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 Reading XLSX inside a ZIP file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638058#M189731</link>
    <description>&lt;P&gt;I am trying to read a XLSX file that is "compressed" in Windows 10 I assume WinZip.&amp;nbsp; &amp;nbsp;When I point to it I get:&amp;nbsp;Insufficient authorization to access error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename in1 zip 'C:\myzipfile.zip' ;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;infile in1;&lt;BR /&gt;input;&lt;BR /&gt;put _infile_;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Apr 2020 14:20:18 GMT</pubDate>
    <dc:creator>asabou01</dc:creator>
    <dc:date>2020-04-07T14:20:18Z</dc:date>
    <item>
      <title>Reading XLSX inside a ZIP file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638058#M189731</link>
      <description>&lt;P&gt;I am trying to read a XLSX file that is "compressed" in Windows 10 I assume WinZip.&amp;nbsp; &amp;nbsp;When I point to it I get:&amp;nbsp;Insufficient authorization to access error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename in1 zip 'C:\myzipfile.zip' ;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;infile in1;&lt;BR /&gt;input;&lt;BR /&gt;put _infile_;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 14:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638058#M189731</guid>
      <dc:creator>asabou01</dc:creator>
      <dc:date>2020-04-07T14:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reading XLSX inside a ZIP file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638060#M189732</link>
      <description>&lt;P&gt;Do you have a standalone SAS installation, or do you work in a client/server environment? If the latter, you can't access your desktop drive like this.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 14:24:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638060#M189732</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-07T14:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reading XLSX inside a ZIP file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638061#M189733</link>
      <description>&lt;P&gt;A ZIP file is like a directory. What file inside the ZIP file are you trying to read? You need to specify the member name. Either in the FILENAME statement or the INFILE statement.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=lestmtsglobal&amp;amp;docsetTarget=n1dn0f61yfyzton1l2ngsa1clllr.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=lestmtsglobal&amp;amp;docsetTarget=n1dn0f61yfyzton1l2ngsa1clllr.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If it is an XLSX file then you will need to first copy it out to an actual file for the XLSX libname engine to work on it.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 14:25:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638061#M189733</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-07T14:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reading XLSX inside a ZIP file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638065#M189734</link>
      <description>&lt;P&gt;No it is a network drive (client/server)&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 14:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638065#M189734</guid>
      <dc:creator>asabou01</dc:creator>
      <dc:date>2020-04-07T14:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Reading XLSX inside a ZIP file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638089#M189738</link>
      <description>&lt;P&gt;C: is NOT a network share. It is always the local disk from which Windows was started.&lt;/P&gt;
&lt;P&gt;I was NOT asking about your disk drives, I was asking about your&amp;nbsp;&lt;STRONG&gt;SAS installation.&lt;/STRONG&gt; Be precise in your wording.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 14:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638089#M189738</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-07T14:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reading XLSX inside a ZIP file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638095#M189739</link>
      <description>&lt;P&gt;Sorry about "misspeaking" on my part.&amp;nbsp; &amp;nbsp;Windows 10 SAS installed on local PC.&amp;nbsp; I added a "member" and I was able to read it.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The member is in XLS format and not newer EXCEL version (XLSX).&amp;nbsp; &amp;nbsp;Do I need now to define all columns in XLS file in a datastep? I have been using "Proc Import" after un-compressing the file in the past. Thanks very much!&lt;/P&gt;&lt;P&gt;filename in1 ZIP 'C:\health.zip' member="myhealth.xls";&lt;/P&gt;&lt;P&gt;data be;&lt;BR /&gt;infile in1;&lt;BR /&gt;input;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 15:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638095#M189739</guid>
      <dc:creator>asabou01</dc:creator>
      <dc:date>2020-04-07T15:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reading XLSX inside a ZIP file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638107#M189742</link>
      <description>&lt;P&gt;You cannot read an XLS file like it was text.&amp;nbsp; You could try to read it as binary data, but it wouldn't make sense to do that.&amp;nbsp; Instead use PROC IMPORT to convert on of the sheets in the XLS file into a SAS dataset.&lt;/P&gt;
&lt;P&gt;You could try using your fileref of IN1 with PROC IMPORT,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename in1 ZIP 'C:\health.zip' member="myhealth.xls" recfm=f lrecl=512;
proc import datafile=in1 dbms=xls out=myhealth replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but I suspect that you will have to copy the file out of the ZIP into a real physical file and point PROC IMPORT at that physical file instead.&amp;nbsp; You could use a temporary file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename in1 ZIP 'C:\health.zip' member="myhealth.xls" recfm=f lrecl=512;
filename copy temp recfm=f lrecl=512;
data _null_;
  rc=fcopy('in1','copy');
  put rc=;
run;

proc import datafile=copy dbms=xls out=myhealth replace;
run;
proc contents data=myhealth;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 15:27:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638107#M189742</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-07T15:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Reading XLSX inside a ZIP file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638114#M189743</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 15:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-XLSX-inside-a-ZIP-file/m-p/638114#M189743</guid>
      <dc:creator>asabou01</dc:creator>
      <dc:date>2020-04-07T15:40:50Z</dc:date>
    </item>
  </channel>
</rss>

