<?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: Get the size of the files stored on the SAS server. in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/798349#M40324</link>
    <description>&lt;P&gt;If you just want to delete stuff, why don't you log on to the server and remove files from the commandline?&lt;/P&gt;</description>
    <pubDate>Thu, 24 Feb 2022 09:46:07 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-02-24T09:46:07Z</dc:date>
    <item>
      <title>View the size of the different types of files within the "Files" folder on the SAS server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797759#M40257</link>
      <description>&lt;P&gt;Hello everyone, I'm new to programming in sas and I would like to obtain in tables the weight/size that my .xlsx, .csv, etc. files occupy, inside the "Files" folder on the sas server as shown in the image below .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas.PNG" style="width: 234px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68733i781E3E95A63C5D74/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas.PNG" alt="sas.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;To do the same but in "Libraries" I have used the dictionary.tables functions offered by SAS, but I don't know if there is a similar function to see the size of the different types of files within SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone guide me about this? I will be very grateful, thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 10:25:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797759#M40257</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-02-22T10:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: View the size of the different types of files within the "Files" folder on the SAS ser</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797776#M40258</link>
      <description>&lt;P&gt;Usually, this folder (which leads directly into the SAS server's filesystem) is configured to start at the home directory of the user.&lt;/P&gt;
&lt;P&gt;See if this ingenious code (with regards to it's creator,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;) does it for you:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data filelist;
  length dname filename $256 dir level 8 lastmod size 8;
  format lastmod datetime20.;
  input dname;
  retain filename ' ' level 0 dir 1;
cards4;
$HOME
;;;;

data filelist;
  modify filelist;
  rc1=filename('tmp',catx('/',dname,filename));
  rc2=dopen('tmp');
  dir = not not rc2;
  if not dir then do;
    fid=fopen('tmp','i',0,'b');
    lastmod=input(finfo(fid,foptname(fid,5)),NLDATM100.);
    size=input(finfo(fid,foptname(fid,6)),32.);
    fid=fclose(fid);
  end;
  else do;
    dname=catx('/',dname,filename);
    filename=' ';
    lastmod=input(dinfo(rc2,doptname(rc2,5)),NLDATM100.);
  end;
  replace;
  if dir;
  level=level+1;
  do i=1 to dnum(rc2);
    filename=dread(rc2,i);
    output;
  end;
  rc3=dclose(rc2);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If it doesn't, ask your SAS administrator where the navigation path is set to by the server configuration in SAS metadata, so you can use this instead of $HOME in the first step.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 11:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797776#M40258</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-22T11:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: View the size of the different types of files within the "Files" folder on the SAS ser</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797797#M40262</link>
      <description>&lt;P&gt;Thank you very much for your help, about 24k records have appeared but I really don't know where they come from, look for one that contains '.csv' in the filename field but none appeared, so I don't know if I'm redirecting the path to where I must, how can I know if the navigation path is different from that of home?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 13:00:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797797#M40262</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-02-22T13:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: View the size of the different types of files within the "Files" folder on the SAS ser</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797855#M40264</link>
      <description>&lt;P&gt;Ask your SAS administrator(s) where they set the navigation root of the workspace server.&lt;/P&gt;
&lt;P&gt;Look at how $HOME is defined:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %sysget(HOME);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Feb 2022 16:35:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797855#M40264</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-22T16:35:40Z</dc:date>
    </item>
    <item>
      <title>Get the size of the files stored on the SAS server.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797991#M40299</link>
      <description>&lt;P&gt;Hello everyone, I'm new to programming in SAS, I'm trying to see how much the tables and data occupy within the SAS server. I have managed to figure out how much the tables take up thanks to built-in SAS functions like dictionary.tables, from which I extract a lot of information. However, for the "Archivos" folder I would like to do the same but I think there are no functions of this type, where they give you information about the size, the last modification date etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this attached image I indicate which folder within SAS I want to go through to see what the files inside occupy:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="foro.PNG" style="width: 189px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68765i79B56FF3C99BCC25/image-size/large?v=v2&amp;amp;px=999" role="button" title="foro.PNG" alt="foro.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Searching the internet I found a code that goes through all the "Files" folders according to the path you indicate, the only problem is that this macro does not return the size of these files or the last modification date, I would like to have an output the same as the one I currently have but adding those 2 more fields, size (either in kb or mb/gb) and date of last modification. Here is the code, you just have to change the path.&lt;/P&gt;&lt;PRE&gt;data work.list ;
length type $ 10 name $ 512 relpath $ 1024 path $ 2048
queue $ 10240 root $ 512 ;
* -- initialise our queue with the root directory -- ;
root = "/opt/sas/data/xxx/xxx/SASGuide/pg/" ;
* -- initialise our queue with the current directory -- ;
queue = "." ;
k = 1 ;
q_entry = scan( strip(queue), k, "|" );
do while ( not missing( q_entry ) );
* -- assign reference to the current entry -- ;
if ( filename( 'ditem', catx( "/", root, q_entry ) ) ^= 0 ) then
continue ;
* -- reset return variables and any references -- ;
call missing( name, relpath, path, type, did );
* -- assign directory reference -- ;
did = dopen( 'ditem' );
if ( did = 0 ) then continue ; * -- could not open directory ... next ;
do i = 1 to dnum( did ) ;
* -- common reference details to both directory and files -- ;
* -- get name -- ;
name = dread( did, i );
* -- get relative path -- ;
relpath = strip(tranwrd( catx( "/", q_entry, name ), './', ''));
* -- get absolute path -- ;
path = catx( "/", root, relpath );
* -- determine directory or file -- ;
if ( filename( 'item', path ) ^= 0 ) then
continue; * &amp;lt;-- could not assign a filename so next item ;
ditem = dopen( 'item' );
if ( ditem &amp;gt; 0 ) then do;
* a directory ;
type = "DIR";
output ; * add directory to the output data set ;
rc = dclose( ditem );
rc = filename( 'item', '' );
* -- add it to the queue -- ;
call catx( "|", queue, relpath ) ;
continue ; * &amp;lt;-- next directory ;
end;
* -- if we are here .. it is a file -- ;
type = "FILE";
* ... derive any file properties here ... ;
* -- clear the file reference -- ;
rc = filename( 'item', '' ) ;
output ; * add file to the output data set ;
end;
* -- close directory reference -- ;
rc = dclose( did ) ;
* -- get next directory in the queue -- ;
k = k + 1 ;
q_entry = scan( strip(queue), k, "|" );
end;
run;&lt;/PRE&gt;&lt;P&gt;Could someone give me a hand with this or send me documentation that can help me to do what I want? I imagine that by getting a data step that adds these fields to the work.list I would have, but I don't know how to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 11:03:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797991#M40299</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-02-23T11:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: View the size of the different types of files within the "Files" folder on the SAS ser</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797993#M40296</link>
      <description>&lt;P&gt;It has worked changing my route, thank you very much!! One last question, how could I put the size in KB and another column in GB? because the value is returned to me in bytes&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 11:22:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797993#M40296</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-02-23T11:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: View the size of the different types of files within the "Files" folder on the SAS ser</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797994#M40297</link>
      <description>&lt;P&gt;See this format that adapts itself according to the amount:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
picture kmg
  0 - 1023 = [5.]
  1024 - 1048575 = "009K"(mult=.0009765625)
  1048576 - 1073741823 = "009M" (mult=9.5367431640625E-7)
  1073741824 - high = "000.009G" (mult=9.3132257461548E-10)
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Feb 2022 11:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797994#M40297</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-23T11:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get the size of the files stored on the SAS server.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797996#M40300</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/415512"&gt;@Abelp9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Searching the internet I found a code that goes through all the "Files" folders according to the path you indicate, the only problem is that this macro does not return the size of these files or the last modification date&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The data step code I gave you does exactly this (determine size and last modification), so I moved this post here.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 12:03:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/797996#M40300</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-23T12:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Get the size of the files stored on the SAS server.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/798059#M40311</link>
      <description>&lt;P&gt;Hello good! I have been testing the code that you sent me and it works perfectly, although finally I am encountering some encoding problems, when I focus the path to a folder that has files with an encoding other than UTF-8 I get this error message :&lt;/P&gt;&lt;PRE&gt;ERROR: Some code points were not transcoded.
ERROR: Some code points were not transcoded.
ERROR: Some code points were not transcoded.
ERROR: Some code points were not transcoded.
ERROR: Some code points were not transcoded.
ERROR: Some code points were not transcoded.&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;How can i fix this? thank you very much in advance&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 16:05:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/798059#M40311</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-02-23T16:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Get the size of the files stored on the SAS server.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/798063#M40312</link>
      <description>&lt;P&gt;My code never reads a file, it only reads file metadata. So a transcoding issue could only happen with funny file/path names. Rectify that, as "funny" filenames will bite you in the behind anyway, sooner or later.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 16:09:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/798063#M40312</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-23T16:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Get the size of the files stored on the SAS server.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/798332#M40321</link>
      <description>and there is no way to read the metadata files that have tildes or weird symbols? I just want to get rid of that garbage</description>
      <pubDate>Thu, 24 Feb 2022 07:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/798332#M40321</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-02-24T07:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get the size of the files stored on the SAS server.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/798349#M40324</link>
      <description>&lt;P&gt;If you just want to delete stuff, why don't you log on to the server and remove files from the commandline?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 09:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/798349#M40324</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-24T09:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Get the size of the files stored on the SAS server.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/867435#M42666</link>
      <description>&lt;P&gt;i'm having troubles with the same error&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 12:44:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/View-the-size-of-the-different-types-of-files-within-the-quot/m-p/867435#M42666</guid>
      <dc:creator>danzsas</dc:creator>
      <dc:date>2023-03-31T12:44:12Z</dc:date>
    </item>
  </channel>
</rss>

