<?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 do I extract filename, path, and date modified from a mounted directory? in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-extract-filename-path-and-date-modified-from-a-mounted/m-p/944349#M2591</link>
    <description>&lt;P&gt;I'd recommend using the &lt;STRONG&gt;&lt;A href="https://github.com/SASPAC/baseplus" target="_self"&gt;BasePlus&lt;/A&gt;&lt;/STRONG&gt; package, in particular the &lt;STRONG&gt;&lt;A href="https://github.com/SASPAC/baseplus/blob/main/baseplus.md#dirsandfiles-macro-6" target="_self"&gt;%dirsandfiles()&lt;/A&gt;&lt;/STRONG&gt; macro. The macro gives you the list of files and sub-directories (with content) plus all that "metadata" stuff. It works OS independent, so on Win/Linux/UNIX.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.wuss.org/proceedings/2024/164/164_FINAL_paper_pdf.pdf" target="_self"&gt;&lt;STRONG&gt;This article&lt;/STRONG&gt;&lt;/A&gt;, Appendix B, page 20, gives you quick instruction on how to install and use the package.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2024 07:07:39 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2024-09-18T07:07:39Z</dc:date>
    <item>
      <title>How do I extract filename, path, and date modified from a mounted directory?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-extract-filename-path-and-date-modified-from-a-mounted/m-p/944339#M2589</link>
      <description>&lt;P&gt;I had been using the code below and do some parsing to create an inventory of the contents of a folder and subfolders including path, name of file, file extension, date modified, time modified, and file size.&amp;nbsp; However, our IT department is taking away our ability to use the ls command inside Viya making this code obsolete.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	filename pipedir pipe %sysfunc(quote(ls -lR --full-time "&amp;amp;pathDir" )) lrecl=1000;
	data DIR_RAW;
		infile pipedir truncover;
		input line $char1000.;
	run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I was directed to other SAS options such as data information functions (&lt;A href="https://www.lexjansen.com/wuss/2012/55.pdf" target="_blank"&gt;Paper Template (lexjansen.com)&lt;/A&gt;&amp;nbsp;but from what I can tell they're pretty limited.&amp;nbsp; For example, I can get the filename but not the path if the file is in a sub-folder.&amp;nbsp; I also can't seem to find a way to get the date modified, time modified, or file size.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I only needed to inventory SAS datasets then I could use proc datasets (&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/basess/p0x1eoudl5lk43n10gw8frew9siw.htm" target="_blank"&gt;SAS Help Center: Requesting a Directory Listing for a SAS Library&lt;/A&gt;) to get most of the information I need, but I need all file types.&amp;nbsp; It also doesn't seem to include sub-folders.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas?&amp;nbsp; Using SAS Viya&amp;nbsp;&lt;SPAN&gt;V.03.05M0P111119&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 04:55:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-do-I-extract-filename-path-and-date-modified-from-a-mounted/m-p/944339#M2589</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2024-09-18T04:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract filename, path, and date modified from a mounted directory?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-extract-filename-path-and-date-modified-from-a-mounted/m-p/944347#M2590</link>
      <description>&lt;P&gt;The %dirtree() macro should provide the functionality you need.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/sasutils/macros/blob/master/dirtree.sas" target="_blank"&gt;https://github.com/sasutils/macros/blob/master/dirtree.sas&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 06:37:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-do-I-extract-filename-path-and-date-modified-from-a-mounted/m-p/944347#M2590</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-09-18T06:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract filename, path, and date modified from a mounted directory?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-extract-filename-path-and-date-modified-from-a-mounted/m-p/944349#M2591</link>
      <description>&lt;P&gt;I'd recommend using the &lt;STRONG&gt;&lt;A href="https://github.com/SASPAC/baseplus" target="_self"&gt;BasePlus&lt;/A&gt;&lt;/STRONG&gt; package, in particular the &lt;STRONG&gt;&lt;A href="https://github.com/SASPAC/baseplus/blob/main/baseplus.md#dirsandfiles-macro-6" target="_self"&gt;%dirsandfiles()&lt;/A&gt;&lt;/STRONG&gt; macro. The macro gives you the list of files and sub-directories (with content) plus all that "metadata" stuff. It works OS independent, so on Win/Linux/UNIX.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.wuss.org/proceedings/2024/164/164_FINAL_paper_pdf.pdf" target="_self"&gt;&lt;STRONG&gt;This article&lt;/STRONG&gt;&lt;/A&gt;, Appendix B, page 20, gives you quick instruction on how to install and use the package.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 07:07:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-do-I-extract-filename-path-and-date-modified-from-a-mounted/m-p/944349#M2591</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-09-18T07:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract filename, path, and date modified from a mounted directory?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-extract-filename-path-and-date-modified-from-a-mounted/m-p/944365#M2593</link>
      <description>&lt;P&gt;If you want to code this yourself instead of using a foreign macro, look at my presentation&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-User-Groups-Library/WUSS-Presentation-Talking-to-Your-Host/ta-p/838344" target="_blank" rel="noopener"&gt;Talking to Your Host&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 09:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-do-I-extract-filename-path-and-date-modified-from-a-mounted/m-p/944365#M2593</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-09-18T09:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract filename, path, and date modified from a mounted directory?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-extract-filename-path-and-date-modified-from-a-mounted/m-p/944372#M2594</link>
      <description>Kurt, the macro I mentioned essentially uses your paper code (plus add some additional features to it). I'm even attaching your article to the package.&lt;BR /&gt;&lt;BR /&gt;Bart</description>
      <pubDate>Wed, 18 Sep 2024 10:36:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-do-I-extract-filename-path-and-date-modified-from-a-mounted/m-p/944372#M2594</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-09-18T10:36:45Z</dc:date>
    </item>
  </channel>
</rss>

