<?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: check dataset compression without resetting last access date in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/422617#M12974</link>
    <description>&lt;P&gt;Talk to your admins. They should be able to install a script that does the atime reset via sudo, so you get root permissions &lt;EM&gt;only for this special action&lt;/EM&gt;. I have done the same (on AIX) so that the batch processing user can query the TSM database or kill processes that get in the way of production jobs.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Dec 2017 07:08:28 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-12-20T07:08:28Z</dc:date>
    <item>
      <title>check dataset compression without resetting last access date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/421735#M12945</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to be able to check whether a dataset is compressed.&amp;nbsp; Can do this by using DICTIONARY.TABLES to obtain the name of the SAS data set (memname) and check whether the SAS data set is compressed (COMPRESS).&amp;nbsp; However, this will reset the last access date which I am trying&amp;nbsp;to avoid.&amp;nbsp;&amp;nbsp; (We run file cleanup reports for users&amp;nbsp;based on last access date)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, my question -- does&amp;nbsp;anyone know if there&amp;nbsp;is another way to check&amp;nbsp;whether a dataset is compressed and not reset the&amp;nbsp;access date?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Alan&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 00:17:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/421735#M12945</guid>
      <dc:creator>alandool</dc:creator>
      <dc:date>2017-12-16T00:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: check dataset compression without resetting last access date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/421749#M12946</link>
      <description>&lt;P&gt;What last access date?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no other place than in the actual dataset where metadata like that is stored so to read it you need to read the dataset.&lt;/P&gt;
&lt;P&gt;Unless you setup your own method to save a copy of that metadata and a method to keep it up to date.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 03:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/421749#M12946</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-12-16T03:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: check dataset compression without resetting last access date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/421750#M12947</link>
      <description>&lt;P&gt;What about PROC CONTENTS or DATASETS with the CONTENTS statement?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 03:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/421750#M12947</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-12-16T03:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: check dataset compression without resetting last access date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/421778#M12948</link>
      <description>&lt;P&gt;Thanks for the responses.&amp;nbsp; Was trying to keep from resetting the LAST access date.&amp;nbsp; It appears that any of the 3 (DICTIONARY.TABLES, Proc Contents, Proc Datasets) will reset the access date -- which is problematic for what we are trying to accomplish.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The idea here was to check if users were compressing their large datasets (compress=yes or compress=binary) -- with a need&amp;nbsp;towards decreasing space usage.&amp;nbsp;&amp;nbsp; At the same time, not reset the last access date -- since users get a report of files they have not recently accessed.&amp;nbsp; Need to step back and rethink . . .&amp;nbsp;may have to rely on the last modified date instead.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Alan&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 14:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/421778#M12948</guid>
      <dc:creator>alandool</dc:creator>
      <dc:date>2017-12-16T14:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: check dataset compression without resetting last access date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/421792#M12949</link>
      <description>&lt;P&gt;Any good operating system lets you determine the current last access date and set it with a utility; you will need to do some shell scripting for that.&lt;/P&gt;
&lt;P&gt;The idea would be to work through a list of files, determine the access date (eg with l&lt;FONT face="courier new,courier"&gt;s -ul&lt;/FONT&gt;) and, after checking for the compress, set it again with&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;touch -a -d&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 20:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/421792#M12949</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-16T20:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: check dataset compression without resetting last access date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/421795#M12951</link>
      <description>Shouldn't your last access report be able to distinguish between users?</description>
      <pubDate>Sat, 16 Dec 2017 20:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/421795#M12951</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-12-16T20:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: check dataset compression without resetting last access date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/422172#M12954</link>
      <description>&lt;P&gt;I just ran this code on my Windows 7 system:&lt;/P&gt;
&lt;PRE&gt;proc sql;
   select *
   from dictionary.tables
   where libname='IPP' and memname='CY1995UNDUP';
QUIT;&lt;/PRE&gt;
&lt;P&gt;And the file system shows the last accessed as 10/14/2011. So if the Compression Routine and or Percent Compression have the info you need that seems to work in at least one environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 00:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/422172#M12954</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-12-19T00:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: check dataset compression without resetting last access date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/422207#M12955</link>
      <description>&lt;P&gt;To do a counter-check, I first created this macro:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro ls(dir=,out=,tim=);
data _null_;
if "&amp;amp;tim" not in ("A","a")
then call symputx('tim','','l');
else call symputx('tim','--time=atime','l');
run;

filename ls_oscmd pipe "/usr/linux/bin/ls -l &amp;amp;tim --time-style=full-iso &amp;amp;dir 2&amp;gt;&amp;amp;1";

%if "&amp;amp;out" = "" %then %let out=_null_;
data &amp;amp;out;
infile ls_oscmd truncover;
length
  perms $10
  links 3
  user $8
  group $8
  size 8
  date 4
  time 5
  tz $5
  name $200
;
informat
  date yymmdd10.
  time time19.
;
format
  date yymmdd10.
  time time8.
;
input
  perms
  links
  user
  group
  size
  date
  time
  tz
  name $200.
;
if perms ne 'total';
if upcase("&amp;amp;out") = "_NULL_" then put _all_;
run;

filename ls_oscmd clear;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which uses the GNU ls on AIX to retrieve a directory listing with a long ISO timestamp.&lt;/P&gt;
&lt;P&gt;Then I ran this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.test;
x1 = 1;
run;

%ls(dir=%sysfunc(pathname(WORK)),out=dirlist1,tim=a);

data _null_;
x = sleep(5,1);
run;

proc sql;
create table memlist as
select * from dictionary.tables where libname = 'WORK' and memname = 'TEST';
quit;

%ls(dir=%sysfunc(pathname(WORK)),out=dirlist2,tim=a);

proc print data=dirlist1 noobs;
where name = 'test.sas7bdat';
run;

proc print data=dirlist2 noobs;
where name = 'test.sas7bdat';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which produced this output:&lt;/P&gt;
&lt;PRE&gt;  perms       links    user      group       size           date        time     tz          name

-rw-r--r--      1      e9782    sasadmin    131072    2017-12-19     9:06:33    +0100    test.sas7bdat

  perms       links    user      group       size           date        time     tz          name

-rw-r--r--      1      e9782    sasadmin    131072    2017-12-19     9:06:38    +0100    test.sas7bdat
&lt;/PRE&gt;
&lt;P&gt;As you can see, the access done by the proc sql is dutifully recorded by the operating system. I assume that other UNIXen will behave the same.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 08:08:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/422207#M12955</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-19T08:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: check dataset compression without resetting last access date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/422306#M12960</link>
      <description>&lt;P&gt;Thanks everyone for the input.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think &lt;A class="lia-link-navigation lia-page-link lia-user-name-link" id="link_34" style="color: rgb(0, 153, 153);" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562" target="_self"&gt;&lt;SPAN class="login-bold"&gt;KurtBremser&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp; hit on the solution.&amp;nbsp; That is, first, for a given user, run&amp;nbsp;a check to see if a file is compressed, then reset the last access date back to what it was before the check was run.&amp;nbsp; However, I find that I do not have the permissions needed&amp;nbsp;to reset the last access date (going back in time).&amp;nbsp; Since I am not one of the official&amp;nbsp;SAS admin at my site,&amp;nbsp;it would prove too much&amp;nbsp;of a battle to try to get those permissions.&amp;nbsp; I will have to find a plan B.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks again,&lt;/P&gt;
&lt;P&gt;Alan&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 15:12:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/422306#M12960</guid>
      <dc:creator>alandool</dc:creator>
      <dc:date>2017-12-19T15:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: check dataset compression without resetting last access date</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/422617#M12974</link>
      <description>&lt;P&gt;Talk to your admins. They should be able to install a script that does the atime reset via sudo, so you get root permissions &lt;EM&gt;only for this special action&lt;/EM&gt;. I have done the same (on AIX) so that the batch processing user can query the TSM database or kill processes that get in the way of production jobs.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 07:08:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/check-dataset-compression-without-resetting-last-access-date/m-p/422617#M12974</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-12-20T07:08:28Z</dc:date>
    </item>
  </channel>
</rss>

