<?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: How to Read Load and Process Multiple .GZ files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561184#M157050</link>
    <description>&lt;P&gt;Nope -- you need TS1M5 or higher for GZ support.&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2019 15:23:23 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2019-05-23T15:23:23Z</dc:date>
    <item>
      <title>How to Read Load and Process Multiple .GZ files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561175#M157044</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have about 30 files to read and process from separate directories&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'/path/2019/0421/target.sas7bdat.gz'&lt;BR /&gt;'/path/2019/0420/target.sas7bdat.gz'&lt;BR /&gt;'/path/2019/0419/target.sas7bdat.gz'&lt;BR /&gt;'/path/2019/0418/target.sas7bdat.gz'&lt;BR /&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With uncompressed .sas7bdat files, i load them with libname and reference them in a set statement within a data step.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But, that is not working with the compressed files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I'm trying to start small here, I began with this, which doesn't work either ( &lt;A href="https://blogs.sas.com/content/sasdummy/2017/10/10/reading-writing-gzip-files-sas/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2017/10/10/reading-writing-gzip-files-sas/&lt;/A&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename pdb32 zip '/path/2019/0421/target.sas7bdat.gz' gzip;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data temp0 ;&lt;BR /&gt;&amp;nbsp;infile pdb32 obs = 10;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data = temp0 ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The log keeps yelling at me that the gzip at the end of the filename statement is an error (i turned the slashes around too, and got the same result).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Can someone lend some guidance on how I can read and process these files in a way similar to the libname - set statement method?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;BR /&gt;Jon&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 15:01:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561175#M157044</guid>
      <dc:creator>prolifious</dc:creator>
      <dc:date>2019-05-23T15:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to Read Load and Process Multiple .GZ files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561176#M157045</link>
      <description>&lt;P&gt;GZIP was added in SAS 9.4 Maint 5.&amp;nbsp; If you're running an earlier version, then that's the reason for the error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to try this as a proof-of-concept, you could download SAS University Edition -- then use your success (I hope) as justification to update your level of SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's not an option, you'll have to use external tools (via FILENAME PIPE is standard) to make this work.&amp;nbsp; Lots of doc/papers that show how to do that.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 15:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561176#M157045</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-05-23T15:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to Read Load and Process Multiple .GZ files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561179#M157047</link>
      <description>&lt;P&gt;we're running&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS (r) Proprietary Software 9.4 (TS1M2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;not new enough?&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 15:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561179#M157047</guid>
      <dc:creator>prolifious</dc:creator>
      <dc:date>2019-05-23T15:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to Read Load and Process Multiple .GZ files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561184#M157050</link>
      <description>&lt;P&gt;Nope -- you need TS1M5 or higher for GZ support.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 15:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561184#M157050</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-05-23T15:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Read Load and Process Multiple .GZ files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561207#M157061</link>
      <description>&lt;P&gt;OK, thank you...I'm having trouble finding reference for mysetup: i'm using sas on linux, i write my programs in notepad++ as a .sas file and run it under the sas command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any leads on which version/method of FILENAME PIPE to use?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 16:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561207#M157061</guid>
      <dc:creator>prolifious</dc:creator>
      <dc:date>2019-05-23T16:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Read Load and Process Multiple .GZ files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561209#M157063</link>
      <description>&lt;P&gt;So you have a compressed SAS dataset.&amp;nbsp; You need to uncompress it before SAS can read it.&lt;/P&gt;
&lt;P&gt;You could just un-compress it in the folder where it lives (assuming you have write access);&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile 'gunzip mydata.sas7bdat.gz' pipe;
  input;
  put _infile_;
run;
proc contents data='mydata.sas7bdat'; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you might need to un-compress to a different area where you have write access. Perhaps your SAS work folder.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path=%sysfunc(pathname(work));
data _null_:
  infile "mkdir -p &amp;amp;path/temp" pipe;
  input;
  put _infile_;
run;

data _null_;
  infile "gzip -cd mydata.sas7bdat.gz &amp;gt; &amp;amp;path/mydata.sas7bdat" pipe;
  input;
  put _infile_;
run;

libname mytemp "&amp;amp;path/temp";

proc contents data=mytemp.mydata;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 16:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Read-Load-and-Process-Multiple-GZ-files/m-p/561209#M157063</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-23T16:54:16Z</dc:date>
    </item>
  </channel>
</rss>

