<?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 Issue importing a huge zipped text 'file.txt.gz'. Tried 'gzip -c filepath'. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/375788#M276537</link>
    <description>&lt;P&gt;Could not import a huge text file zipped as&amp;nbsp;'file.txt.gz'.&lt;/P&gt;&lt;P&gt;Tried "&lt;SPAN&gt;filename file_ref Pipe&amp;nbsp;&lt;/SPAN&gt;'gzip -c filepath';" and getting "ERROR: Invalid device type." while trying to read it using infile and input statements(Data Step).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is Appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2017 18:19:32 GMT</pubDate>
    <dc:creator>Ram_Bravos</dc:creator>
    <dc:date>2017-07-13T18:19:32Z</dc:date>
    <item>
      <title>Issue importing a huge zipped text 'file.txt.gz'. Tried 'gzip -c filepath'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/375788#M276537</link>
      <description>&lt;P&gt;Could not import a huge text file zipped as&amp;nbsp;'file.txt.gz'.&lt;/P&gt;&lt;P&gt;Tried "&lt;SPAN&gt;filename file_ref Pipe&amp;nbsp;&lt;/SPAN&gt;'gzip -c filepath';" and getting "ERROR: Invalid device type." while trying to read it using infile and input statements(Data Step).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is Appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 18:19:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/375788#M276537</guid>
      <dc:creator>Ram_Bravos</dc:creator>
      <dc:date>2017-07-13T18:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Issue importing a huge zipped text 'file.txt.gz'. Tried 'gzip -c filepath'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/375789#M276538</link>
      <description>&lt;P&gt;When decompressing to stdout, use&lt;/P&gt;
&lt;PRE&gt;gzip -dc filename&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Jul 2017 18:22:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/375789#M276538</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-13T18:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Issue importing a huge zipped text 'file.txt.gz'. Tried 'gzip -c filepath'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/375989#M276539</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried that too, still same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;FILENAME LGCY_GZ PIPE "gzip -dc /product/..../Infile.TXT.gz" lrecl=32767;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;DATA Legacy_Test;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;INFILE LGCY_GZ(OBS=5)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LRECL=32767&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DLM='|'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MISSOVER&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DSD;&lt;BR /&gt;INPUT&lt;BR /&gt;D_U_N_S_NUMBER : BEST9.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;....;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;I get this error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;"ERROR: Invalid device type."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 12:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/375989#M276539</guid>
      <dc:creator>Ram_Bravos</dc:creator>
      <dc:date>2017-07-14T12:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Issue importing a huge zipped text 'file.txt.gz'. Tried 'gzip -c filepath'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/375991#M276540</link>
      <description>&lt;P&gt;Do you have XCMD enabled? Run&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and search for "XCMD" in the log.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;filename pipe&lt;/FONT&gt; only works when XCMD is enabled.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you can try filename zip:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename lgcy_gz zip "/product/....../infile.txt.gz";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 13:09:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/375991#M276540</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-14T13:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: Issue importing a huge zipped text 'file.txt.gz'. Tried 'gzip -c filepath'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/376044#M276541</link>
      <description>&lt;P&gt;Ran Proc Options and i could see 'XCMD' in the log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried (FILENAME LGCY_GZ ZIP "&lt;SPAN&gt;/product/sas-shared/.....&lt;/SPAN&gt;/file.txt.gz" lrecl=32767;) getting the error below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: The file "/product/sas-shared/......./TWC_LEGACY1.TXT.gz" exists and is not a zip file. The output&lt;BR /&gt;file must be a zip file.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 15:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/376044#M276541</guid>
      <dc:creator>Ram_Bravos</dc:creator>
      <dc:date>2017-07-14T15:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Issue importing a huge zipped text 'file.txt.gz'. Tried 'gzip -c filepath'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/376195#M276542</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153941"&gt;@Ram_Bravos&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Unlike in your previous post you're now trying to use the ZIP engine. For this to work you would need a ZIP and not a GZ archive.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stick to the PIPE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First thing to do: Use Putty or the like and make your GZIP command work without any SAS involvement. Once that works stick the command into pipe using the SAS Filename command as you've already started doing.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FILENAME LGCY_GZ PIPE "gzip -dc /product/..../Infile.TXT.gz" lrecl=32767;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Make sure you're using a length for lrecl long enough for the file you want to read (infile.txt). lrecl may be longer than 32767.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And for a first test using SAS I'd go for code as below:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename lgcy_gz pipe "gzip -dc /product/..../infile.txt.gz" lrecl=32767;
data legacy_test;
  infile lgcy_gz;
  input;
  put _infile_;
  stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Jul 2017 03:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/376195#M276542</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-07-15T03:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Issue importing a huge zipped text 'file.txt.gz'. Tried 'gzip -c filepath'.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/376417#M276543</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153941"&gt;@Ram_Bravos&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Ran Proc Options and i could see 'XCMD' in the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tried (FILENAME LGCY_GZ ZIP "&lt;SPAN&gt;/product/sas-shared/.....&lt;/SPAN&gt;/file.txt.gz" lrecl=32767;) getting the error below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: The file "/product/sas-shared/......./TWC_LEGACY1.TXT.gz" exists and is not a zip file. The output&lt;BR /&gt;file must be a zip file.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you are forced to use the external gzip.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe "gzip -d /product/..../Infile.TXT.gz 2&amp;gt;&amp;amp;1";

data _null_;
infile oscmd;
input;
put _infile_;
run;

filename oscmd clear;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You will see all messages created by the system call in your SAS log.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 06:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-importing-a-huge-zipped-text-file-txt-gz-Tried-gzip-c/m-p/376417#M276543</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-17T06:26:12Z</dc:date>
    </item>
  </channel>
</rss>

