<?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: Gzip large dataset in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Gzip-large-dataset/m-p/509898#M1850</link>
    <description>&lt;P&gt;1. Test your command line string in the command window first to make sure it's zipped&lt;/P&gt;
&lt;P&gt;2. Then use CALL SYSTEM or %SYSEXEC or X command to call the commandline.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's how I call it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxwait noxsync;

data _null_;
 *Path to winzip program;
  zipexe='"C:\Program Files\7-Zip\7z.exe" a -tzip';
 *Zip file name;
  zipfile="C:\My Documents\Sample.zip";
 *File to be zipped;
  file="C:\Temp\Sample.txt";
 *Full cmd line to be passed to command line. It embeds the quotes for paths with spaces;
  cmd = zipexe ||' "'|| zipfile ||'" "'|| file ||'"' ; 
 *Place note in log;
  putlog "NOTE-Processing command" cmd;
 *Execute command;
  call system(cmd);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/9602105" target="_blank"&gt;https://gist.github.com/statgeek/9602105&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you still have issues, post your full code and log.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/89720"&gt;@sameer112217&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have 7 zip installed in my windows.. but when i run the code, it is showing error or sometimes gzip happens with 0 kb size&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Nov 2018 15:01:38 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-11-02T15:01:38Z</dc:date>
    <item>
      <title>Gzip large dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Gzip-large-dataset/m-p/509812#M1833</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to gzip large sas dataset and copy it&amp;nbsp; from one folder to another&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Location of sas tables in windows sas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;\\10.00.112.12\ddbg_va\Data\Backup SAS Data\Final Tables\currentmonth.sas7bdat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The location is mentioned above. However our sas is on windows, and I am unable to gunzip it and tried various commands but could not do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename source &lt;SPAN&gt;\\10.00.112.12\ddbg_va\Data\Backup SAS Data\Final Tables\currentmonth.sas7bdat&lt;/SPAN&gt;";&lt;BR /&gt;filename tozip zip "&lt;SPAN&gt;\\10.00.112.12\ddbg_va\Data\Backup SAS Data\Final Tables\currentmonth.sas7bdat&lt;/SPAN&gt;.gz" GZIP;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;infile source;&lt;BR /&gt;file tozip;&lt;BR /&gt;input;&lt;BR /&gt;put _infile_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got an error for GZIP&amp;nbsp;statement. I have also tried x&amp;nbsp; gzip -c and below method to be unsuccessful in doing so&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;systask command "gzip '&lt;SPAN&gt;\\10.00.112.12\ddbg_va\Data\Backup SAS Data\Final Tables\currentmonth.sas7bdat&lt;/SPAN&gt;"&lt;BR /&gt;wait taskname=zip status= check shell;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 10:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Gzip-large-dataset/m-p/509812#M1833</guid>
      <dc:creator>sameer112217</dc:creator>
      <dc:date>2018-11-02T10:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Gzip large dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Gzip-large-dataset/m-p/509819#M1835</link>
      <description>&lt;P&gt;GZIP was added in SAS 9.4 Maintenance 5.&amp;nbsp; &lt;A href="https://blogs.sas.com/content/sasdummy/2017/10/10/reading-writing-gzip-files-sas/" target="_self"&gt;See details here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't have the M5 level, and you need GZ files, then you'll have to use an external tool.&amp;nbsp; On Windows though, you'll have to first install a tool like gzip or 7-zip that can support gz files.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 11:09:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Gzip-large-dataset/m-p/509819#M1835</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-11-02T11:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Gzip large dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Gzip-large-dataset/m-p/509821#M1837</link>
      <description>&lt;P&gt;I have 7 zip installed in my windows.. but when i run the code, it is showing error or sometimes gzip happens with 0 kb size&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 11:14:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Gzip-large-dataset/m-p/509821#M1837</guid>
      <dc:creator>sameer112217</dc:creator>
      <dc:date>2018-11-02T11:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Gzip large dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Gzip-large-dataset/m-p/509831#M1840</link>
      <description>&lt;P&gt;I prefer the following method for running external commands, not only for debugging, but also in production:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe "the command you want to run 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;The 2&amp;gt;&amp;amp;1 at the end will redirect all error output to the pipe, so you will find &lt;EM&gt;all&lt;/EM&gt; responses in your SAS log.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 12:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Gzip-large-dataset/m-p/509831#M1840</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-02T12:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Gzip large dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Gzip-large-dataset/m-p/509898#M1850</link>
      <description>&lt;P&gt;1. Test your command line string in the command window first to make sure it's zipped&lt;/P&gt;
&lt;P&gt;2. Then use CALL SYSTEM or %SYSEXEC or X command to call the commandline.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's how I call it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxwait noxsync;

data _null_;
 *Path to winzip program;
  zipexe='"C:\Program Files\7-Zip\7z.exe" a -tzip';
 *Zip file name;
  zipfile="C:\My Documents\Sample.zip";
 *File to be zipped;
  file="C:\Temp\Sample.txt";
 *Full cmd line to be passed to command line. It embeds the quotes for paths with spaces;
  cmd = zipexe ||' "'|| zipfile ||'" "'|| file ||'"' ; 
 *Place note in log;
  putlog "NOTE-Processing command" cmd;
 *Execute command;
  call system(cmd);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/9602105" target="_blank"&gt;https://gist.github.com/statgeek/9602105&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you still have issues, post your full code and log.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/89720"&gt;@sameer112217&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have 7 zip installed in my windows.. but when i run the code, it is showing error or sometimes gzip happens with 0 kb size&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 15:01:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Gzip-large-dataset/m-p/509898#M1850</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-02T15:01:38Z</dc:date>
    </item>
  </channel>
</rss>

