<?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: How to get the file size of a spde file on a Unix server in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/948446#M45429</link>
    <description>&lt;P&gt;One more option: from the &lt;A href="https://github.com/SASPAC/baseplus" target="_self"&gt;BasePlus SAS Package&lt;/A&gt; macro &lt;A href="https://github.com/SASPAC/baseplus/blob/main/baseplus.md#dirsandfiles-macro-6" target="_self"&gt;%sdirsAndFiles()&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname a SPDE "R:\test\";

data a.x(index=(i)) a.y a.z(index=(im=(i m1)));
  array m[20] (1:20);
  do i=1 to 2e6;
    output;
  end;
  format i dollar10.2;
run;


filename packages "c:\sas_work\sas_packages";
%include packages (SPFinit.sas);
%loadPackage(BasePlus)

%dirsAndFiles(
    R:\test\
   ,ODS=x
   ,details=1
   ,keepDirs=0
   ,keepFiles=1
   ,maxDepth=1
)
proc print data=x;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Gives:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_0-1729535764477.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101637i1F6BE2B42F2B4508/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_0-1729535764477.png" alt="yabwon_0-1729535764477.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2024 18:37:33 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2024-10-21T18:37:33Z</dc:date>
    <item>
      <title>How to get the file size of a spde file on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/947881#M45411</link>
      <description>&lt;P&gt;Good Morning,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have test this macro function that should give the file zise but it is not working.&lt;/P&gt;
&lt;P&gt;Please note that we have spde files partitions like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/.../auto/be_auto_prmsep2024.dpf.00010a84.0.2.spds9&lt;BR /&gt;/.../auto/be_auto_prmsep2024.dpf.00010a84.1.2.spds9&lt;BR /&gt;/.../auto/be_auto_prmsep2024.dpf.00010a84.2.2.spds9&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;But I would like to get the file size of&amp;nbsp;be_auto_prmsep2024 not of each partition.&lt;/P&gt;
&lt;P&gt;I have tried the following SAS function and it is not working&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro FileAttribs(filename);           
  %local rc fid fidc Bytes CreateDT ModifyDT; 
  %let rc=%sysfunc(filename(onefile,&amp;amp;filename)); 
  %let fid=%sysfunc(fopen(&amp;amp;onefile));
     %if &amp;amp;fid ne 0 %then %do;  
  %let Bytes=%sysfunc(finfo(&amp;amp;fid,File Size (bytes)));   
  %let CreateDT=%sysfunc(finfo(&amp;amp;fid,Create Time));     
  %let ModifyDT=%sysfunc(finfo(&amp;amp;fid,Last Modified));    
  %let fidc=%sysfunc(fclose(&amp;amp;fid));    
  %let rc=%sysfunc(filename(onefile)); 
  %put NOTE: File size of &amp;amp;filename is &amp;amp;bytes bytes;    
  %put NOTE- Created &amp;amp;createdt;       
  %put NOTE- Last modified &amp;amp;modifydt;
     %end;
        %else %put &amp;amp;filename could not be open.;
%mend FileAttribs;
                      
%FileAttribs(c:\aaa.txt)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to create a table like below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;path&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; filename&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;size&lt;/P&gt;
&lt;P&gt;path1&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; &amp;nbsp; &amp;nbsp; &amp;nbsp;be_auto_prmsep2024&amp;nbsp; &amp;nbsp; &amp;nbsp;555 kbytes&lt;/P&gt;
&lt;P&gt;path1&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; &amp;nbsp; &amp;nbsp; &amp;nbsp;be_auto_prmoct2024&amp;nbsp; &amp;nbsp; &amp;nbsp;545 kbytes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and so on.&lt;/P&gt;
&lt;P&gt;how do we do that ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 15:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/947881#M45411</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-10-17T15:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the file size of a spde file on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/947922#M45414</link>
      <description>If all files are in the same directory, list all the files in that directory (see the pinned topic &lt;A href="https://communities.sas.com/t5/SAS-Programming/How-to-List-all-the-files-in-a-folder/m-p/674065#M202918" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/How-to-List-all-the-files-in-a-folder/m-p/674065#M202918&lt;/A&gt;) and get the size of all component files. Don't forget index files if applicable.&lt;BR /&gt;&lt;BR /&gt;Note that you can use the PARTSIZE option of LIBNAME SPDE to avoid splitting the data into multiple files.</description>
      <pubDate>Thu, 17 Oct 2024 17:53:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/947922#M45414</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2024-10-17T17:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the file size of a spde file on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/947932#M45415</link>
      <description>&lt;P&gt;The SPDE engine is meant to speed up processing by spreading it over multiple storage devices, so you may find that your dataset resides in multiple directories.&lt;/P&gt;
&lt;P&gt;So your first task would be to find all the partition files, after which you can determine each file's size and add that up.&lt;/P&gt;
&lt;P&gt;Switch to doing it all in a DATA step, where you can use all the functions without a "%SYSFUNC avalanche".&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 18:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/947932#M45415</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-10-17T18:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the file size of a spde file on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/947934#M45416</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16120"&gt;@Kurt&lt;/a&gt; SPDE is also great to speed up IO thanks to its much better compression algorithms and better indexing, even if just one directory is used.</description>
      <pubDate>Thu, 17 Oct 2024 18:37:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/947934#M45416</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2024-10-17T18:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the file size of a spde file on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/947938#M45417</link>
      <description>&lt;P&gt;I have a macro I use for this. My personal macro library has lots of utility macros in it, and some macros use other macros in the set. The code below will compile the required macros straight from the GitHub repository.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;CAVEAT: You should preview the contents of each these files at &lt;A href="https://github.com/SASJedi/sas-macros" target="_self"&gt;https://github.com/SASJedi/sas-macros&lt;/A&gt;&amp;nbsp;before using them this way so that you can be confident that the code you are executing is safe for your intended use.&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename code url "https://raw.githubusercontent.com/SASJedi/sas-macros/refs/heads/master/exist.sas";
%include code/source2;
filename code url "https://raw.githubusercontent.com/SASJedi/sas-macros/refs/heads/master/fileattribs.sas";
%include code/source2;
filename code url "https://raw.githubusercontent.com/SASJedi/sas-macros/refs/heads/master/findfiles.sas";
%include code/source2;
filename code url "https://raw.githubusercontent.com/SASJedi/sas-macros/refs/heads/master/spdefilesize.sas";
%include code/source2;
filename code url "https://raw.githubusercontent.com/SASJedi/sas-macros/refs/heads/master/translate.sas";
%include code/source2;

%spdeFileSize(?)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This call to the macro:&lt;BR /&gt;&amp;nbsp;&lt;STRONG&gt;%spdeFileSize(?)&lt;/STRONG&gt;&amp;nbsp;&lt;BR /&gt;will write syntax help to the SAS log, including a usage example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT color="#0000FF"&gt; NOTE: SPDEFILESIZE documentation:
      
       Purpose: For an SPDE library dataset, find the filesize for each
                individual sub-file, and the sum of the individual sizes.
      
       Syntax: %SPDEFILESIZE(libref,dsn)
       libref: Libref of the SPDE library
       dsn:    Name of the dataset in the SPDE library
      
       Example: %SPDEFILESIZE(spdelib,myTable)
       Result:
      
       |-------------------------------------------------------------|
       |File                                       |File size (bytes)|
       |-------------------------------------------------------------|
       |/home/myID/spde1/mytable.dpf.a86.2.22.spds9|       98,572,032|
       |/home/myID/spde2/mytable.dpf.a86.0.22.spds9|      134,217,216|
       |/home/myID/spde3/mytable.dpf.a86.1.22.spds9|      134,217,216|
       |Total for all segments:                    |      367,006,464|
       |-------------------------------------------------------------|
      
       Use ? to print this documentation to the SAS log.
&lt;/FONT&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 13:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/947938#M45417</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2024-10-18T13:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the file size of a spde file on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/948395#M45426</link>
      <description>&lt;P&gt;Good Morning Mr. Bremser,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usually, the premium datasets for a specificy year, company (ex: ha for Halifax), lob (auto, prop, entr) reside into the same folder.&lt;/P&gt;
&lt;P&gt;ex:&amp;nbsp;/.../sasdata/sas2024/ha/auto Contains all the premium datasets for auto, year=2024, months=all and lob=auto.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ha_auto_prmjan2024&lt;/P&gt;
&lt;P&gt;ha_auto_prmfev2024&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;ha_auto_prmdec2024&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As we use the spde file engine, these files are partionned but in the same folder as described above.&lt;/P&gt;
&lt;P&gt;So what I need to do, it is to create only on SAS dataset that will give me the following information:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;path&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;fname&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sum of the size for all the partions (ex: sum of all the partitions for&amp;nbsp;ha_auto_prmjan2024)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and that for all year ( 2001 - 2024) , all cies, lob=auto, prop, entr,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That dataset will give me the space used from the actual datasets as well as an estimation of the space required to copy those into another folder for a specific project and a limited period of time. How do we do that? Please note that we have unix serser, so many script found on the SAS community are useless.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 14:42:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/948395#M45426</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-10-21T14:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the file size of a spde file on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/948437#M45427</link>
      <description>&lt;P&gt;Hey Mark (&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13728"&gt;@SASJedi&lt;/a&gt;),&lt;/P&gt;
&lt;P&gt;Off topic thing.&lt;/P&gt;
&lt;P&gt;How about building a package out of your SAS-Jedi macros library?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 17:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/948437#M45427</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-10-21T17:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the file size of a spde file on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/948441#M45428</link>
      <description>&lt;P&gt;Maybe the "Swiss army knife" a.k.a. Proc Datasets?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname a SPDE "R:\";

data a.x a.y a.z;
  array m[20] (1:20);
  do i=1 to 2e6;
    output;
  end;
run;

/*
proc contents data=a.x DETAILS;
run;
*/
ods trace on;
ods select all; 
ods output Members=Members; /* data set */
proc datasets lib=a;
run;
quit;
ods trace off;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Oct 2024 18:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/948441#M45428</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-10-21T18:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the file size of a spde file on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/948446#M45429</link>
      <description>&lt;P&gt;One more option: from the &lt;A href="https://github.com/SASPAC/baseplus" target="_self"&gt;BasePlus SAS Package&lt;/A&gt; macro &lt;A href="https://github.com/SASPAC/baseplus/blob/main/baseplus.md#dirsandfiles-macro-6" target="_self"&gt;%sdirsAndFiles()&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname a SPDE "R:\test\";

data a.x(index=(i)) a.y a.z(index=(im=(i m1)));
  array m[20] (1:20);
  do i=1 to 2e6;
    output;
  end;
  format i dollar10.2;
run;


filename packages "c:\sas_work\sas_packages";
%include packages (SPFinit.sas);
%loadPackage(BasePlus)

%dirsAndFiles(
    R:\test\
   ,ODS=x
   ,details=1
   ,keepDirs=0
   ,keepFiles=1
   ,maxDepth=1
)
proc print data=x;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Gives:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_0-1729535764477.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101637i1F6BE2B42F2B4508/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_0-1729535764477.png" alt="yabwon_0-1729535764477.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 18:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/948446#M45429</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-10-21T18:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the file size of a spde file on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/950120#M45496</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp; I'm looking into that. It would make sharing a lot easier, because my macros often call one or more of the others as modular code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 14:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/950120#M45496</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2024-11-07T14:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the file size of a spde file on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/950191#M45497</link>
      <description>&lt;P&gt;You need to use the UNIX command 'du' to get these file size.&lt;/P&gt;
&lt;P&gt;I wrote a article about it before. Here is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Did you know how big your library is ?



 

 

During our data maintenance , we usually want to know how big our libraries are. Which libraries dominate the whole disk.

 

First of all, I would like to introduce the SAS environment we need to processs. Our SAS9.2 SPD Server is under AIX operation system and we use EG4.3 to connect to SAS server by using Integrated Open Model (IOM).

 

I know there is a command SPDSLS to get the library’s size , but it only handle one library one time. If we has more than one hundred libraries to check , this way is too hard for us.  I found UNIX command DU is very convenient and flexiable , I think we can use it to do better job.

 

A SPD Server library contain two part : one is Meta data which is really small ,we can neglect it ; the other is real table data which we need to check.

 

Now the following is the step by step how we complete this task, Hope can help other peoples.

 

1) Running the following code in EG.

 

options nolabel;

proc sql;

create table x as

 select libname,engine,sysname,'du -g '||strip(sysvalue)||' &amp;gt; '||strip(libname)||'.txt' as value length=400 

  from dictionary.libnames

   where sysname='Datapath' and engine='SASSPDS'

order by libname;quit;

 

 

 

We can see this table now.

 

 

 

 

The SQL create a table named x which contain name of library, engine of library , the type of parameter and a command you used to calculated the size of library.

From sysname=”Datapath”, we know sysvalue is the data path of storing for this libname.

 

Value column really look like :

du -g '/spds_data1/bhyh1/' '/spds_data2/bhyh1/' '/spds_data3/bhyh1/' '/spds_data4/bhyh1/' '/spds_data5/bhyh1/' '/spds_data6/bhyh1/' '/spds_data7/bhyh1/' &amp;gt; BHYH1.txt 

 

“du –g” means calculated the directory’s size by G measure (e.g. 100 G ).  The middle is the data path (i.e. directory ).  “  &amp;gt; BHYH1.txt  ” is telling OS to redirect the result of the command into a txt file.

 

2) At AIX , create a temporary directory :

 

Using software secureCRT to connect to SAS SPD Server . and create a lib_size directory under /spds_data11/temp/

 

 

3)Enter the directory we create a moment ago .

 

 

 

4)Copy these command from dataset X .

 

 

 

 

5) Paste these command into secureCRT  and enter ENTER :

 

 

After that you will see lots of txt file under directory lib_size.

 

 

Open one of them , find the txt look like :

 

 

6) Running the following code to get  the finally result we need , easy Hoo ?

 

data temp;

 infile '/spds_data11/temp/lib_size/*.txt' lrecl=400 expandtabs ;

 input size path : $40. ;

 length lib_name  $ 40 ;

 lib_name=upcase(scan(path,-2,'/'));

run;

proc means data=temp nway noprint;

class lib_name;

var size;

output out=want(drop=_:) sum=lib_size;

run;

 

 

Here is the final result.

 &lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Nov 2024 01:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-the-file-size-of-a-spde-file-on-a-Unix-server/m-p/950191#M45497</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-11-08T01:10:33Z</dc:date>
    </item>
  </channel>
</rss>

