<?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: getting relevant information for filepaths in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435025#M108021</link>
    <description>&lt;P&gt;You're on the right track.&amp;nbsp; You're missing:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;infile inf;&lt;/P&gt;
&lt;P&gt;before your input statement.&lt;/P&gt;
&lt;P&gt;You will also have some data arranging to do once you call execute your %path macro.&amp;nbsp; Like where and how are you going to store user, date, filename ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keep going.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; You really don't want me to provide the answer do you?&lt;/P&gt;</description>
    <pubDate>Wed, 07 Feb 2018 19:38:06 GMT</pubDate>
    <dc:creator>JerryV</dc:creator>
    <dc:date>2018-02-07T19:38:06Z</dc:date>
    <item>
      <title>getting relevant information for filepaths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/434990#M108006</link>
      <description>&lt;P&gt;Hi here is how my input file ( it can have thousands records) looks like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input file:&lt;/P&gt;&lt;P&gt;name&amp;nbsp;&lt;/P&gt;&lt;P&gt;/home/tej/a.sas7bdat&lt;/P&gt;&lt;P&gt;/home/bn/b.sas7bdat&lt;/P&gt;&lt;P&gt;/hom/df.sas7bdat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Outputfile:&lt;/P&gt;&lt;P&gt;&amp;nbsp;name &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;user &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;date&lt;/P&gt;&lt;P&gt;/home/tej/a.sas7bdat &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;/home/bn/b.sas7bdat &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;....&lt;/P&gt;&lt;P&gt;/hom/df.sas7bdat &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; z &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a nutshell i should run 'ls -ul ' command on each record of the input file and append its output to the record. &amp;nbsp;My way or most obvious way of doing this create intermediate data for each record and finally append everything. &amp;nbsp;Is there any other smart way of doing where we can avoid creating intermediate data set for each record.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 18:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/434990#M108006</guid>
      <dc:creator>tej123</dc:creator>
      <dc:date>2018-02-07T18:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: getting relevant information for filepaths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435005#M108014</link>
      <description>&lt;P&gt;If you ran LS on the folders wouldn't it have all that information?&lt;/P&gt;
&lt;P&gt;Other than the user, which I wouldn't necessarily trust, the other information is available from the Dictionary tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3803"&gt;@tej123&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi here is how my input file ( it can have thousands records) looks like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input file:&lt;/P&gt;
&lt;P&gt;name&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/home/tej/a.sas7bdat&lt;/P&gt;
&lt;P&gt;/home/bn/b.sas7bdat&lt;/P&gt;
&lt;P&gt;/hom/df.sas7bdat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Outputfile:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;name &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;user &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;date&lt;/P&gt;
&lt;P&gt;/home/tej/a.sas7bdat &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;/home/bn/b.sas7bdat &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;....&lt;/P&gt;
&lt;P&gt;/hom/df.sas7bdat &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; z &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a nutshell i should run 'ls -ul ' command on each record of the input file and append its output to the record. &amp;nbsp;My way or most obvious way of doing this create intermediate data for each record and finally append everything. &amp;nbsp;Is there any other smart way of doing where we can avoid creating intermediate data set for each record.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 18:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435005#M108014</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-07T18:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: getting relevant information for filepaths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435016#M108017</link>
      <description>&lt;P&gt;A couple of different options.&lt;/P&gt;
&lt;P&gt;1) Before going into SAS, run your ls -l command (1&amp;gt;myNewInput.txt) for all input rows.&amp;nbsp; Then input myNewInput.txt&lt;/P&gt;
&lt;P&gt;2) if xcmd is available in your SAS Session.&amp;nbsp; (EG usually is not).&amp;nbsp; Use the FILENAME statement with the PIPE engine and the 'ls -l' command for all of your datarows.&lt;/P&gt;
&lt;P&gt;3.) Use a&amp;nbsp;combination of the foptname&amp;nbsp;and&amp;nbsp;finfo functions on each of your input rows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 19:12:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435016#M108017</guid>
      <dc:creator>JerryV</dc:creator>
      <dc:date>2018-02-07T19:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: getting relevant information for filepaths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435019#M108018</link>
      <description>&lt;P&gt;something along this lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro path(val);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%global userid;&lt;/P&gt;&lt;P&gt;filename inf pipe "ls -ul &amp;amp;val" lrecl=200;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;length user $8;&lt;/P&gt;&lt;P&gt;input user;&lt;/P&gt;&lt;P&gt;call symputx('user',user);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend path;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data input file;&lt;/P&gt;&lt;P&gt;set inputfile;&lt;/P&gt;&lt;P&gt;call execute( '%path('||filename||')');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;the above methodology is failing. i dont know why?.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 19:28:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435019#M108018</guid>
      <dc:creator>tej123</dc:creator>
      <dc:date>2018-02-07T19:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: getting relevant information for filepaths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435024#M108020</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;the above methodology is failing. i dont know why?.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How is it failing? What does 'failing' mean?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 19:35:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435024#M108020</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-07T19:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: getting relevant information for filepaths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435025#M108021</link>
      <description>&lt;P&gt;You're on the right track.&amp;nbsp; You're missing:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;infile inf;&lt;/P&gt;
&lt;P&gt;before your input statement.&lt;/P&gt;
&lt;P&gt;You will also have some data arranging to do once you call execute your %path macro.&amp;nbsp; Like where and how are you going to store user, date, filename ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Keep going.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; You really don't want me to provide the answer do you?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 19:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435025#M108021</guid>
      <dc:creator>JerryV</dc:creator>
      <dc:date>2018-02-07T19:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: getting relevant information for filepaths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435035#M108024</link>
      <description>&lt;P&gt;Sorry, when i meant fail, in the call execute command the filepath value "/apps / ... " &amp;nbsp;is not getting passed.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 20:15:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435035#M108024</guid>
      <dc:creator>tej123</dc:creator>
      <dc:date>2018-02-07T20:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: getting relevant information for filepaths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435036#M108025</link>
      <description>&lt;P&gt;Sorry, when i meant fail, in the call execute command the filepath value &amp;nbsp;is not getting passed.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 20:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435036#M108025</guid>
      <dc:creator>tej123</dc:creator>
      <dc:date>2018-02-07T20:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: getting relevant information for filepaths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435038#M108026</link>
      <description>&lt;P&gt;I am so sorry for the confusion. the call execute command works and the code is working. &amp;nbsp;I had 3 different sas programs opened and got confused myself as to which variables i am using.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 20:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435038#M108026</guid>
      <dc:creator>tej123</dc:creator>
      <dc:date>2018-02-07T20:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: getting relevant information for filepaths</title>
      <link>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435039#M108027</link>
      <description>&lt;P&gt;Haha, thank you. The code is working after adding the infile.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 20:21:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/getting-relevant-information-for-filepaths/m-p/435039#M108027</guid>
      <dc:creator>tej123</dc:creator>
      <dc:date>2018-02-07T20:21:10Z</dc:date>
    </item>
  </channel>
</rss>

