<?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: Trouble reading a DBF file from a zip file using SASZIPAM in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Trouble-reading-a-DBF-file-from-a-zip-file-using-SASZIPAM/m-p/192304#M36212</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you upgrade to sas 9.4?&amp;nbsp; New features Zip filename.&lt;/P&gt;&lt;P&gt;With 9.3 you could use ODS Document for zipping/unzipping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import usage, why not use proc dbf?&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acpcref/66980/HTML/default/viewer.htm#n0k6kxpxq86qx4n1smqrhckbj1tn.htm" title="http://support.sas.com/documentation/cdl/en/acpcref/66980/HTML/default/viewer.htm#n0k6kxpxq86qx4n1smqrhckbj1tn.htm"&gt;SAS/ACCESS(R) 9.4 Interface to PC Files: Reference, Second Edition&lt;/A&gt; (proc dbf)&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acpcref/63181/HTML/default/viewer.htm#n0mcec45gpk9l9n1mlesvzkgvj2w.htm" title="http://support.sas.com/documentation/cdl/en/acpcref/63181/HTML/default/viewer.htm#n0mcec45gpk9l9n1mlesvzkgvj2w.htm"&gt;SAS/ACCESS(R) 9.3 Interface to PC Files: Reference&lt;/A&gt; (proc dbf)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Apr 2014 13:45:42 GMT</pubDate>
    <dc:creator>jakarman</dc:creator>
    <dc:date>2014-04-25T13:45:42Z</dc:date>
    <item>
      <title>Trouble reading a DBF file from a zip file using SASZIPAM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trouble-reading-a-DBF-file-from-a-zip-file-using-SASZIPAM/m-p/192303#M36211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having trouble importing data from a zipped DBF file in SAS 9.3 (using EG 5.1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;As-is situation&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Right now, I have to manually unzip the weekly updates and import the DBF files using proc import with DBMS set to 'DBF'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;To-be situation&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Read and import the DBF files directly from the zipfiles.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;Approach&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Declare the zipfile using the filename statement and SASZIPAM option and import the DBF file using a datastep, as described &lt;A href="http://kb.iu.edu/data/azva.html"&gt;&lt;SPAN style="color: blue;"&gt;here&lt;/SPAN&gt;&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;Problem&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;There are 2 problems, either of which would be a solution if solved:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;It seems impossible to import a DBF file to SAS by use of a datastep (Googling suggests to convert the DBF file to a CSV file, which is not an option here).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;It seems impossible to use a PROC IMPORT using the filename that refers to the zipped DBF, declared with the SASZIPAM option.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Any ideas on how to best approach this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; font-size: 10pt;"&gt;Kirvis&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 13:14:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trouble-reading-a-DBF-file-from-a-zip-file-using-SASZIPAM/m-p/192303#M36211</guid>
      <dc:creator>kirvis</dc:creator>
      <dc:date>2014-04-25T13:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble reading a DBF file from a zip file using SASZIPAM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trouble-reading-a-DBF-file-from-a-zip-file-using-SASZIPAM/m-p/192304#M36212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you upgrade to sas 9.4?&amp;nbsp; New features Zip filename.&lt;/P&gt;&lt;P&gt;With 9.3 you could use ODS Document for zipping/unzipping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import usage, why not use proc dbf?&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acpcref/66980/HTML/default/viewer.htm#n0k6kxpxq86qx4n1smqrhckbj1tn.htm" title="http://support.sas.com/documentation/cdl/en/acpcref/66980/HTML/default/viewer.htm#n0k6kxpxq86qx4n1smqrhckbj1tn.htm"&gt;SAS/ACCESS(R) 9.4 Interface to PC Files: Reference, Second Edition&lt;/A&gt; (proc dbf)&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acpcref/63181/HTML/default/viewer.htm#n0mcec45gpk9l9n1mlesvzkgvj2w.htm" title="http://support.sas.com/documentation/cdl/en/acpcref/63181/HTML/default/viewer.htm#n0mcec45gpk9l9n1mlesvzkgvj2w.htm"&gt;SAS/ACCESS(R) 9.3 Interface to PC Files: Reference&lt;/A&gt; (proc dbf)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 13:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trouble-reading-a-DBF-file-from-a-zip-file-using-SASZIPAM/m-p/192304#M36212</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-04-25T13:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble reading a DBF file from a zip file using SASZIPAM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trouble-reading-a-DBF-file-from-a-zip-file-using-SASZIPAM/m-p/192305#M36213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaap,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. To comment on it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;updating to 9.4 is not an option unfortunately&lt;/LI&gt;&lt;LI&gt;I tried using proc dbf, but that means I have to unzip the files first, which is exactly what I would like to prevent using the SASZIPAM option in the filename statement. It seems impossble to use a proc statement after defining the filename of the zipfile, I have to use a data step to import the data&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unzipping the files on the server and importing them would be a third option, but I have not managed to figure that out either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 13:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trouble-reading-a-DBF-file-from-a-zip-file-using-SASZIPAM/m-p/192305#M36213</guid>
      <dc:creator>kirvis</dc:creator>
      <dc:date>2014-04-25T13:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble reading a DBF file from a zip file using SASZIPAM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trouble-reading-a-DBF-file-from-a-zip-file-using-SASZIPAM/m-p/192306#M36214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, you will need always a two-step process approach&amp;nbsp;&amp;nbsp; 1/ the unzip 2/ dbf to SAS &lt;/P&gt;&lt;P&gt;I Checked the ODS package approach it will allow you to zip but I cannot find unzip. That is a weird approach at SAS as a lot is related to ZIP-functionality although not always made visible.&lt;/P&gt;&lt;P&gt;The two steps can be done in your case by&lt;/P&gt;&lt;P&gt;-unzip step (possible containing many files) using a XCMD (pipe systask processing) . That should work with SAS 9.3 at SAS/base windows&amp;nbsp; (SASZIPAM is windows only)&lt;/P&gt;&lt;P&gt;- the conversion step.&lt;/P&gt;&lt;P&gt;you can specify needed checkpoints in your process as for existence of the wanted filenames.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Still one program or EGP-flow with several steps you can run.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 14:39:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trouble-reading-a-DBF-file-from-a-zip-file-using-SASZIPAM/m-p/192306#M36214</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-04-25T14:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble reading a DBF file from a zip file using SASZIPAM</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trouble-reading-a-DBF-file-from-a-zip-file-using-SASZIPAM/m-p/192307#M36215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have eventually managed to activate 7-zip using the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unzipcmd=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' "C:\Program Files\7-zip\7z.exe" ' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zipfile=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'C:\MyDocuments\zipfile.zip' ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; whereto=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'C:\MyDocuments\target_dir\' ;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd=unzipcmd || ' x ' || zipfile || ' o-' || whereto ;&lt;/P&gt;&lt;P&gt;putlog "NOTE-Files are extracted" cmd ;&lt;/P&gt;&lt;P&gt;call system(cmd);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I realise I can make this more flexible using macro variables and things like that, but for now, this does work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 10:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trouble-reading-a-DBF-file-from-a-zip-file-using-SASZIPAM/m-p/192307#M36215</guid>
      <dc:creator>kirvis</dc:creator>
      <dc:date>2014-04-28T10:58:09Z</dc:date>
    </item>
  </channel>
</rss>

