<?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: Compressing whole library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Compressing-whole-library/m-p/867158#M342465</link>
    <description>&lt;P&gt;That works for a single dataset. I have ~100k datasets and need to do the entire library at once.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2023 02:03:58 GMT</pubDate>
    <dc:creator>bayzid</dc:creator>
    <dc:date>2023-03-30T02:03:58Z</dc:date>
    <item>
      <title>Compressing whole library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compressing-whole-library/m-p/867154#M342463</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using the following code to compress all the datasets in a library. But it requires creating a new library to save the compressed files and that is an issue with me due to very large number of files. Is it possible to compress the whole library without saving into a new one?&lt;/P&gt;&lt;P&gt;****Compressing the whole library;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;options compress=yes;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;datasets&lt;/STRONG&gt; lib=tab nolist;&lt;/P&gt;&lt;P&gt;copy inlib=sas outlib=saso noclone datecopy memtype=data;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;STRONG&gt;quit&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 00:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compressing-whole-library/m-p/867154#M342463</guid>
      <dc:creator>bayzid</dc:creator>
      <dc:date>2023-03-30T00:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing whole library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compressing-whole-library/m-p/867155#M342464</link>
      <description>&lt;P&gt;The only way to do this in place would be DATA steps:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options compress=yes;

data MyLib.MyDataset;
  set MyLib.MyDataset;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;EDIT: Maybe you could copy some at a time into your WORK library, then copy back to your permanent library?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 01:22:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compressing-whole-library/m-p/867155#M342464</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-03-30T01:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing whole library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compressing-whole-library/m-p/867158#M342465</link>
      <description>&lt;P&gt;That works for a single dataset. I have ~100k datasets and need to do the entire library at once.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 02:03:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compressing-whole-library/m-p/867158#M342465</guid>
      <dc:creator>bayzid</dc:creator>
      <dc:date>2023-03-30T02:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Compressing whole library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compressing-whole-library/m-p/867166#M342466</link>
      <description>&lt;P&gt;You will need a macro loop to iterate over tables in the library. Here is some sample code that might help. You'll need to update the WHERE clause and then add the code that you want into the loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    select catt(libname,".",memname), count(*)
    into :table1 -, :table_cnt
    from sashelp.vmember
    where libname="WORK" and memtype="DATA";
quit;

%macro myloop;
  %do i = 1 %to &amp;amp;table_cnt;
    %put Working on &amp;amp;&amp;amp;table&amp;amp;i..;

   /* Your code here */

  %end;
%mend;
%myloop;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 03:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compressing-whole-library/m-p/867166#M342466</guid>
      <dc:creator>SimonDawson</dc:creator>
      <dc:date>2023-03-30T03:29:42Z</dc:date>
    </item>
  </channel>
</rss>

