<?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: import txt file compressed into .ZIP or .Gz or .7z in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157532#M30744</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can unzip &amp;amp; read the files "on-the-fly" with syntax as &lt;A __default_attr="828210" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; suggests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With SAS 9.4 there is now also a zip engine available which would allow you to read such archives&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/67407/HTML/default/viewer.htm#n1dn0f61yfyzton1l2ngsa1clllr.htm" title="http://support.sas.com/documentation/cdl/en/lestmtsref/67407/HTML/default/viewer.htm#n1dn0f61yfyzton1l2ngsa1clllr.htm"&gt;SAS(R) 9.4 Statements: Reference, Third Edition&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 20 Dec 2014 00:51:16 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2014-12-20T00:51:16Z</dc:date>
    <item>
      <title>import txt file compressed into .ZIP or .Gz or .7z</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157527#M30739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i import the txt file which is compressed into&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;.ZIP&lt;/SPAN&gt; or &lt;SPAN style="text-decoration: underline;"&gt;.Gz&lt;/SPAN&gt; or &lt;SPAN style="text-decoration: underline;"&gt;.7z&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;using infile statement from (windows) SAS 9.2 version.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 11:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157527#M30739</guid>
      <dc:creator>sas_lak</dc:creator>
      <dc:date>2014-12-19T11:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: import txt file compressed into .ZIP or .Gz or .7z</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157528#M30740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to decompress the file first, there is no functionality at this time to unzip within SAS.&amp;nbsp; You can either do it manually when you receive the file, or pipe an OS command out using x or call system, e.g.:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; winzip_path="'c:\programs\winzip\winzip.exe'";&amp;nbsp; /* Note the double quotes around single quotes */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filepath="'s:\zips\myzip.zip'";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd=winzip_path||" "||filepath;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x cmd;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 11:20:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157528#M30740</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-12-19T11:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: import txt file compressed into .ZIP or .Gz or .7z</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157529#M30741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for quik reply, but every day we received number of files and each compressed file having minimum 5GB,&lt;/P&gt;&lt;P&gt;is there any other option to import into SAS. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 11:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157529#M30741</guid>
      <dc:creator>sas_lak</dc:creator>
      <dc:date>2014-12-19T11:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: import txt file compressed into .ZIP or .Gz or .7z</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157530#M30742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not run a script in your OS to unzip the files.&amp;nbsp; They will need to be unzipped to be used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 11:38:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157530#M30742</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-12-19T11:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: import txt file compressed into .ZIP or .Gz or .7z</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157531#M30743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;filename oscmd pipe "gzip -dc &amp;amp;infilename";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data import;&lt;/P&gt;&lt;P&gt;infile oscmd;&lt;/P&gt;&lt;P&gt;/* process infile as if unzipped */&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will stream the unzipped contents of the file specified in infilename to your data step.&lt;/P&gt;&lt;P&gt;Consult the proper manuals for other compressed file formats and the correpsonding utilities.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2014 14:01:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157531#M30743</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-12-19T14:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: import txt file compressed into .ZIP or .Gz or .7z</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157532#M30744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can unzip &amp;amp; read the files "on-the-fly" with syntax as &lt;A __default_attr="828210" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; suggests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With SAS 9.4 there is now also a zip engine available which would allow you to read such archives&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/67407/HTML/default/viewer.htm#n1dn0f61yfyzton1l2ngsa1clllr.htm" title="http://support.sas.com/documentation/cdl/en/lestmtsref/67407/HTML/default/viewer.htm#n1dn0f61yfyzton1l2ngsa1clllr.htm"&gt;SAS(R) 9.4 Statements: Reference, Third Edition&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2014 00:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157532#M30744</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-12-20T00:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: import txt file compressed into .ZIP or .Gz or .7z</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157533#M30745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May I request you to explain the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;"gzip -dc &amp;amp;infilename" from your filename statement?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2014 04:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157533#M30745</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2014-12-20T04:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: import txt file compressed into .ZIP or .Gz or .7z</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157534#M30746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suggest that you do a Google search using "site:support.sas.com filename pipe". Also searching here in this forum with terms like "filename pipe zip" will return quite a few links.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;"gzip -dc &amp;amp;infilename"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;gzip -dc&lt;/STRONG&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Is calling the 3rd party GZIP tool with appropriate switches for this tool&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;amp;infilename&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;A SAS macro variable which you could define and populate earlier in your code. This is the path and name of your GZIP archive which you pass in as parameter into GZIP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;The example is for GZIP. What's the right 3rd party tool for your archive will depend on what's available in your specific environment.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2014 07:52:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157534#M30746</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-12-20T07:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: import txt file compressed into .ZIP or .Gz or .7z</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157535#M30747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;gzip:&lt;/P&gt;&lt;P&gt;-d: decompresses the file (without the -d gzip will do a compression)&lt;/P&gt;&lt;P&gt;-c: instead of writing a compressed/decompressed file, stream the output to stdout&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The filename pipe works similar to the reverse apostroph (backtick) under UNIX. The string is executed, and the output is provided to SAS as if you read a file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The filename pipe is also very useful if you want to include the output and error messages of a command in the SAS log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename oscmd pipe "&lt;EM&gt;what_you_want_to_execute&lt;/EM&gt; 2&amp;gt;&amp;amp;1"; * 2&amp;gt;&amp;amp;1 redirects stderr to stdout, so you get everything;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;infile oscmd;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;put _infile_; * write the whole input line to the log;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Patrick suggested, you may need to adapt the command to the zip tool available in your environment. All those tools should have options for batch processing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 06:39:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157535#M30747</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-12-22T06:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: import txt file compressed into .ZIP or .Gz or .7z</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157536#M30748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you one and all,&lt;/P&gt;&lt;P&gt;Here I am receiving minimum 50 compressed files in a week time, and it contains approximate 100 GB.&lt;/P&gt;&lt;P&gt;Every time I used to uncompressed and import flat files into SAS. It consumes huge disc space.&lt;/P&gt;&lt;P&gt;Any way am deleting the all files, once SAS datasets are placed into my libelers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 07:22:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157536#M30748</guid>
      <dc:creator>sas_lak</dc:creator>
      <dc:date>2014-12-22T07:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: import txt file compressed into .ZIP or .Gz or .7z</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157537#M30749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Content of post deleted as wrong and being convinced otherwise by &lt;A __default_attr="828210" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 10:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157537#M30749</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-12-22T10:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: import txt file compressed into .ZIP or .Gz or .7z</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157538#M30750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, gzip -dc will not use any diskspace at all. So the pipe approach as described only needs the space for the zipped file and the space for the SAS dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2014 11:59:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-txt-file-compressed-into-ZIP-or-Gz-or-7z/m-p/157538#M30750</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-12-22T11:59:00Z</dc:date>
    </item>
  </channel>
</rss>

