<?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 inventory a mounted LAN folder from SAS Viya? in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914924#M2251</link>
    <description>&lt;P&gt;Thanks!&amp;nbsp; Yes.&amp;nbsp; I was masking my path and pasted my example in the wrong format.&amp;nbsp; I appreciate you making that clear and for letting me know I don't need DIR or quotes in the command statement.&amp;nbsp; I pasted some code below that worked as you described.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;filename pipedir pipe %sysfunc(quote(ls -lR /TEMP )) lrecl=1000;
data DIR;
     infile pipedir truncover;
     input line $char1000.;
run;&lt;/PRE&gt;</description>
    <pubDate>Wed, 07 Feb 2024 19:34:00 GMT</pubDate>
    <dc:creator>Ryanb2</dc:creator>
    <dc:date>2024-02-07T19:34:00Z</dc:date>
    <item>
      <title>How do I inventory a mounted LAN folder from SAS Viya?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914824#M2243</link>
      <description>&lt;P&gt;I'm a base SAS user but getting into SAS Viya.&amp;nbsp; One thing I do frequently in base SAS is inventory files on the local network or my C drive as shown below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename pipedir pipe %sysfunc(quote( dir "C:\TEMP" /S )) lrecl=1000;&lt;BR /&gt;data indata;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;infile pipedir truncover;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;input line $char1000.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It returns raw information about the folder path, the contents of the folder, the subfolder paths and subfolder contents.&amp;nbsp; Each file includes date/time modified, and file size in addition to the filenames.&amp;nbsp; I can parse and combine the raw data to get exactly what I need which I then use to find new files and import them automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, when I run similar code in SAS Viya using an NFS mounted drive I only get the filenames for the immediate folder.&amp;nbsp; No subfolders and none of the other information.&amp;nbsp; This is useful enough for most purposes but not including the subfolders is going to be a problem.&amp;nbsp; Does anyone know how to get the kind of information I get using my PC SAS version when using SAS Viya for a mounted drive?&amp;nbsp; Because SAS Viya exists on a Linux server are there some Linux commands that can be run from my SAS code that give me what I need?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 07:02:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914824#M2243</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2024-02-07T07:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I inventory a mounted LAN folder from SAS Viya?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914902#M2247</link>
      <description>In Windows, dir /S is a recursive path listing, the equivalent command in linux would probably be ls -lR /path/to/read.</description>
      <pubDate>Wed, 07 Feb 2024 18:24:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914902#M2247</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2024-02-07T18:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I inventory a mounted LAN folder from SAS Viya?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914916#M2249</link>
      <description>&lt;P&gt;Wow!&amp;nbsp; I was not sure where to put your changes in my line but it worked on the first try!&amp;nbsp; Very nice.&amp;nbsp; The format is different than in windows but the information is the same and it includes the subfolders.&amp;nbsp; Much appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;filename pipedir pipe %sysfunc(quote( dir ls -lR "C:\TEMP" )) lrecl=1000;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; data DIR;&lt;BR /&gt;infile pipedir truncover;&lt;BR /&gt;input line $char1000.;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 19:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914916#M2249</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2024-02-07T19:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I inventory a mounted LAN folder from SAS Viya?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914920#M2250</link>
      <description>I'm pleased you got what you were looking for! To clarify, this line:&lt;BR /&gt;&lt;BR /&gt;filename pipedir pipe %sysfunc(quote(dir "C:\TEMP" /S)) lrecl=1000;&lt;BR /&gt;&lt;BR /&gt;Is creating a fileref called "pipedir" that when called runs the command 'dir C:\TEMP" /s' and provides the output of this command through the fileref.&lt;BR /&gt;&lt;BR /&gt;Linux doesn't have drive letters, so it's temp directory is typically /tmp. Instead of running "dir" we are running "ls", so "dir" would not be needed any longer. So, a comparable line for Linux would be (I'm removing the sysfunc and quote pieces since I don't think they're needed here):&lt;BR /&gt;&lt;BR /&gt;filename pipedir pipe "ls -lR /tmp" lrecl=1000;&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Feb 2024 19:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914920#M2250</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2024-02-07T19:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I inventory a mounted LAN folder from SAS Viya?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914924#M2251</link>
      <description>&lt;P&gt;Thanks!&amp;nbsp; Yes.&amp;nbsp; I was masking my path and pasted my example in the wrong format.&amp;nbsp; I appreciate you making that clear and for letting me know I don't need DIR or quotes in the command statement.&amp;nbsp; I pasted some code below that worked as you described.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;filename pipedir pipe %sysfunc(quote(ls -lR /TEMP )) lrecl=1000;
data DIR;
     infile pipedir truncover;
     input line $char1000.;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Feb 2024 19:34:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914924#M2251</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2024-02-07T19:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I inventory a mounted LAN folder from SAS Viya?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914994#M2252</link>
      <description>&lt;P&gt;I'm very close but I'm getting some strange results:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename pipedir pipe %sysfunc(quote(ls -lR "&amp;amp;pathDir" )) lrecl=1000;
data DIR;
	infile pipedir truncover;
	input line $char1000.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;this code returns some values with the year and others with the time.&amp;nbsp;&lt;/P&gt;
&lt;TABLE id="__jsview7--data18--dataTable_Data1-table" class="sapUiTableCtrl sapUiTableCtrlRowScroll sapUiTableCtrlScroll" role="presentation" data-sap-ui-table-acc-covered="overlay,nodata" aria-describedby="__jsview7--data18--dataTable_Data1-ariasummary"&gt;
&lt;TBODY&gt;
&lt;TR id="__jsview7--data18--dataTable_Data1-rows-row8" class="sapUiTableRowEven sapUiTableTr" data-sap-ui="__jsview7--data18--dataTable_Data1-rows-row8" data-sap-ui-rowindex="8" aria-owns="__jsview7--data18--dataTable_Data1-rowsel8"&gt;
&lt;TD class="sapUiTableTd" data-sap-ui-colid="__column112" aria-hidden="true"&gt;
&lt;DIV class="sapUiTableCell"&gt;&lt;SPAN class="sapMText sapMTextMaxWidth sapMTextNoWrap sasMText" data-sap-ui="__text240-col1_0-row8_8"&gt;-rw-------. 1 ryanb domain users 40016 Aug 7 &lt;FONT color="#FF6600"&gt;2023&lt;/FONT&gt; FILENAME1.mor&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR id="__jsview7--data18--dataTable_Data1-rows-row9" class="sapUiTableRowOdd sapUiTableTr" data-sap-ui="__jsview7--data18--dataTable_Data1-rows-row9" data-sap-ui-rowindex="9" aria-owns="__jsview7--data18--dataTable_Data1-rowsel9"&gt;
&lt;TD class="sapUiTableTd sasLeftMouseDown" data-sap-ui-colid="__column112" aria-hidden="true"&gt;
&lt;DIV class="sapUiTableCell"&gt;&lt;SPAN class="sapMText sapMTextMaxWidth sapMTextNoWrap sasMText" data-sap-ui="__text240-col1_0-row9_9"&gt;-rw-------. 1 ryanb domain users 40016 Aug 14 &lt;FONT color="#FF6600"&gt;10:10&lt;/FONT&gt; FILENAME2.mor&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;It will provide one or the other but never both, at least in the sample I reviewed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 02:55:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914994#M2252</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2024-02-08T02:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I inventory a mounted LAN folder from SAS Viya?</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914999#M2253</link>
      <description>&lt;P&gt;I looked up ls parameters and came across&amp;nbsp;--full-time.&amp;nbsp; It generates output a little different than before but everything is now consistent.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename pipedir pipe %sysfunc(quote(ls -lR --full-time "&amp;amp;pathDir" )) lrecl=1000;&lt;BR /&gt;data DIR;&lt;BR /&gt;infile pipedir truncover;&lt;BR /&gt;input line $char1000.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 04:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-do-I-inventory-a-mounted-LAN-folder-from-SAS-Viya/m-p/914999#M2253</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2024-02-08T04:38:22Z</dc:date>
    </item>
  </channel>
</rss>

