<?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 GZIP - getting metadata from zipped SAS files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/GZIP-getting-metadata-from-zipped-SAS-files/m-p/833431#M329473</link>
    <description>&lt;P&gt;Curiousity question based on &lt;A href="https://stackoverflow.com/questions/73718161/read-single-observation-from-compressed-dataset-sas7bdat-gz" target="_self"&gt;this post&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to get the metadata of a zipped SAS file without uncompressing it fully?&lt;/P&gt;
&lt;P&gt;IIRC there's ways in R to process large SAS datasets essentially line by line so it can read only a few rows at a time so I'm wondering if something similar is possible in SAS directly or if the zipped/compression makes this impossible.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given this note in the blog post I don't think it's possible but curious.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&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;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;If your file is in a binary format such as a SAS data set (sas7bdat) or Excel (XLS or XLSX), you probably will need to expand the file completely before reading it as data. These files are read using special drivers that don't process the bytes sequentially, so you need the entire file available on disk.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Wed, 14 Sep 2022 20:19:32 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-09-14T20:19:32Z</dc:date>
    <item>
      <title>GZIP - getting metadata from zipped SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/GZIP-getting-metadata-from-zipped-SAS-files/m-p/833431#M329473</link>
      <description>&lt;P&gt;Curiousity question based on &lt;A href="https://stackoverflow.com/questions/73718161/read-single-observation-from-compressed-dataset-sas7bdat-gz" target="_self"&gt;this post&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to get the metadata of a zipped SAS file without uncompressing it fully?&lt;/P&gt;
&lt;P&gt;IIRC there's ways in R to process large SAS datasets essentially line by line so it can read only a few rows at a time so I'm wondering if something similar is possible in SAS directly or if the zipped/compression makes this impossible.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given this note in the blog post I don't think it's possible but curious.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&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;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;If your file is in a binary format such as a SAS data set (sas7bdat) or Excel (XLS or XLSX), you probably will need to expand the file completely before reading it as data. These files are read using special drivers that don't process the bytes sequentially, so you need the entire file available on disk.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 14 Sep 2022 20:19:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/GZIP-getting-metadata-from-zipped-SAS-files/m-p/833431#M329473</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-09-14T20:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: GZIP - getting metadata from zipped SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/GZIP-getting-metadata-from-zipped-SAS-files/m-p/833454#M329479</link>
      <description>&lt;P&gt;No.&amp;nbsp; Just as the quotes says.&amp;nbsp; The SAS7BDAT file is a binary file.&amp;nbsp; &amp;nbsp;You have to have the actual file for SAS to read it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I tried making a copy of a dataset that only included the beginning the resulting file is unusable by SAS.&lt;/P&gt;
&lt;PRE&gt;228    set sashelp.class;
229  run;

NOTE: The data set WORK.CLASS has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


230  options generic;
231
232  data _null_;
233    infile "%sysfunc(pathname(work))/class.sas7bdat" lrecl=512 recfm=f obs=10;
234    file "%sysfunc(pathname(work))/class2.sas7bdat" lrecl=512 recfm=f ;
235    input;
236    put _infile_;
237  run;

NOTE: The infile "(system-specific pathname)/class.sas7bdat" is:
      (system-specific pathname),
      (system-specific file attributes)

NOTE: The file "(system-specific pathname)/class2.sas7bdat" is:
      (system-specific pathname),
      (system-specific file attributes)

NOTE: 10 records were read from the infile (system-specific pathname).
NOTE: 10 records were written to the file (system-specific pathname).
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


238
239
240  proc contents data=class2;
ERROR: Attempt to reference a page past end-of-file on WORK.CLASS2.DATA.
241  run;

NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE CONTENTS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

NOTE: The SAS System stopped processing this step because of errors.
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 00:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/GZIP-getting-metadata-from-zipped-SAS-files/m-p/833454#M329479</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-09-15T00:41:30Z</dc:date>
    </item>
  </channel>
</rss>

