<?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 a subset of a data file into SAS from a zipped folder without unzipping in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-subset-of-a-data-file-into-SAS-from-a-zipped-folder/m-p/369591#M275585</link>
    <description>&lt;P&gt;When I run the following code to set the zip folder location and identify members...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Setting Zip folder Location*/&lt;/P&gt;&lt;P&gt;filename inzip ZIP "**location hidden for security**/datasetzippedfolder.zip";&lt;BR /&gt;&lt;BR /&gt;/* Read the "members" (files) from the ZIP file */&lt;BR /&gt;data contents(keep=memname isFolder);&lt;BR /&gt;length memname $200 isFolder 8;&lt;BR /&gt;fid=dopen("inzip");&lt;BR /&gt;if fid=0 then&lt;BR /&gt;stop;&lt;BR /&gt;memcount=dnum(fid);&lt;BR /&gt;do i=1 to memcount;&lt;BR /&gt;memname=dread(fid,i);&lt;BR /&gt;/* check for trailing / in folder name */&lt;BR /&gt;isFolder = (first(reverse(trim(memname)))='/');&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;rc=dclose(fid);&lt;BR /&gt;run;&lt;BR /&gt;/* create a report of the ZIP contents */&lt;BR /&gt;title "Files in the ZIP file";&lt;BR /&gt;proc print data=contents noobs N;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...I get the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;memname isFolder &lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;var/lib/jenkins/oracle_export/dataset.csv&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;N = 1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dataset.csv is size 777 PB. I do not want to extract this folder because I don't have the room. I know what columns the dataset has and what the value of the variable needs to be for the subset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I achieve obtaining the subset without extracting?&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jun 2017 17:02:02 GMT</pubDate>
    <dc:creator>Delgoffe_MCRI</dc:creator>
    <dc:date>2017-06-22T17:02:02Z</dc:date>
    <item>
      <title>Reading a subset of a data file into SAS from a zipped folder without unzipping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-subset-of-a-data-file-into-SAS-from-a-zipped-folder/m-p/369591#M275585</link>
      <description>&lt;P&gt;When I run the following code to set the zip folder location and identify members...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Setting Zip folder Location*/&lt;/P&gt;&lt;P&gt;filename inzip ZIP "**location hidden for security**/datasetzippedfolder.zip";&lt;BR /&gt;&lt;BR /&gt;/* Read the "members" (files) from the ZIP file */&lt;BR /&gt;data contents(keep=memname isFolder);&lt;BR /&gt;length memname $200 isFolder 8;&lt;BR /&gt;fid=dopen("inzip");&lt;BR /&gt;if fid=0 then&lt;BR /&gt;stop;&lt;BR /&gt;memcount=dnum(fid);&lt;BR /&gt;do i=1 to memcount;&lt;BR /&gt;memname=dread(fid,i);&lt;BR /&gt;/* check for trailing / in folder name */&lt;BR /&gt;isFolder = (first(reverse(trim(memname)))='/');&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;rc=dclose(fid);&lt;BR /&gt;run;&lt;BR /&gt;/* create a report of the ZIP contents */&lt;BR /&gt;title "Files in the ZIP file";&lt;BR /&gt;proc print data=contents noobs N;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...I get the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;memname isFolder &lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;var/lib/jenkins/oracle_export/dataset.csv&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;N = 1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dataset.csv is size 777 PB. I do not want to extract this folder because I don't have the room. I know what columns the dataset has and what the value of the variable needs to be for the subset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I achieve obtaining the subset without extracting?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 17:02:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-subset-of-a-data-file-into-SAS-from-a-zipped-folder/m-p/369591#M275585</guid>
      <dc:creator>Delgoffe_MCRI</dc:creator>
      <dc:date>2017-06-22T17:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a subset of a data file into SAS from a zipped folder without unzipping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-subset-of-a-data-file-into-SAS-from-a-zipped-folder/m-p/369595#M275586</link>
      <description>&lt;P&gt;You would use the csv file name as the member argument in a filename statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename foo ZIP 'U:\directory1\testzip.zip' member="test1.csv" ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then in your infile statement use the fileref Foo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; infile foo &amp;lt;any options such as delimeter, lrecl and such&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;lt;informat and input statement for the columns in the csv go here&amp;gt;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that if the Zip wasn't created by WinZip&amp;nbsp;this may not work.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 17:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-subset-of-a-data-file-into-SAS-from-a-zipped-folder/m-p/369595#M275586</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-22T17:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a subset of a data file into SAS from a zipped folder without unzipping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-subset-of-a-data-file-into-SAS-from-a-zipped-folder/m-p/369630#M275587</link>
      <description>&lt;P&gt;Thank you for your quick feedback &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I get this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: The zip file dmf_table_33.csv doesn't exist.&lt;BR /&gt;ERROR: Physical file does not exist, dmf_table_33.csv.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems to not recognize the zipped folder. The files are password protected. Would that make a difference?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 18:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-subset-of-a-data-file-into-SAS-from-a-zipped-folder/m-p/369630#M275587</guid>
      <dc:creator>Delgoffe_MCRI</dc:creator>
      <dc:date>2017-06-22T18:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a subset of a data file into SAS from a zipped folder without unzipping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-subset-of-a-data-file-into-SAS-from-a-zipped-folder/m-p/369671#M275588</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/150482"&gt;@Delgoffe_MCRI&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your quick feedback &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, I get this error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: The zip file dmf_table_33.csv doesn't exist.&lt;BR /&gt;ERROR: Physical file does not exist, dmf_table_33.csv.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems to not recognize the zipped folder. The files are password protected. Would that make a difference?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;From &lt;A href="http://blogs.sas.com/content/sasdummy/2014/01/29/using-filename-zip/&amp;nbsp;" target="_blank"&gt;http://blogs.sas.com/content/sasdummy/2014/01/29/using-filename-zip/&amp;nbsp;&lt;/A&gt; :&lt;/P&gt;
&lt;P&gt;For password-protected ZIP files, you'll still need to use external tools like WinZip, 7-Zip, or gzip. This &lt;A href="http://www2.sas.com/proceedings/sugi31/155-31.pdf" rel="nofollow" target="_blank"&gt;SAS Global Forum paper shows how that can work&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 19:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-subset-of-a-data-file-into-SAS-from-a-zipped-folder/m-p/369671#M275588</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-22T19:43:10Z</dc:date>
    </item>
  </channel>
</rss>

