<?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 owner and group of a file in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-owner-and-group-of-a-file/m-p/730098#M38428</link>
    <description>Forget about the question, I have found the solution which is to put the information provided in the call is single quote.</description>
    <pubDate>Tue, 30 Mar 2021 14:06:09 GMT</pubDate>
    <dc:creator>alepage</dc:creator>
    <dc:date>2021-03-30T14:06:09Z</dc:date>
    <item>
      <title>how to get the owner and group of a file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-owner-and-group-of-a-file/m-p/730093#M38427</link>
      <description>&lt;P&gt;Hello, I am using the following code to get the owner and group and it works well only if there is no space into the macro variable provided.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ex:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro find_owner(f);&lt;BR /&gt;* this will find the file owner;&lt;BR /&gt;filename fog pipe "ls -la &amp;amp;f. | awk '{print $3, $4}'";&lt;/P&gt;
&lt;P&gt;data _null_ ;&lt;BR /&gt;infile fog truncover delimiter="|";&lt;BR /&gt;input xvalue :$256.;&lt;BR /&gt;call symput('owner',strip(substr(xvalue,1,index(xvalue," "))));&lt;BR /&gt;call symput('group',strip(substr(xvalue,index(xvalue," "),200))); &lt;BR /&gt;run;&lt;BR /&gt;%put &amp;amp;=owner &amp;amp;=group; &lt;BR /&gt;%mend find_owner;&lt;/P&gt;
&lt;P&gt;The first call is working properly because there is no blank into the macro variable &amp;amp;f.&lt;/P&gt;
&lt;P&gt;%find_owner(/finsys/lego816/saspgm/sasmacro/program1.sas);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But for the second one, there is a blank into the macro variable &amp;amp;f.&amp;nbsp; between lego and 816.&amp;nbsp; Is there a way to overcome this situation.&lt;/P&gt;
&lt;P&gt;%find_owner(/finsys/lego 816/saspgm/sasmacro/program1.sas);&lt;/P&gt;
&lt;P&gt;Also, when there is a space into the path or file name, I am not sure the macro macro variable will pick the complete path and program name.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 13:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-owner-and-group-of-a-file/m-p/730093#M38427</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2021-03-30T13:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the owner and group of a file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-owner-and-group-of-a-file/m-p/730098#M38428</link>
      <description>Forget about the question, I have found the solution which is to put the information provided in the call is single quote.</description>
      <pubDate>Tue, 30 Mar 2021 14:06:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-owner-and-group-of-a-file/m-p/730098#M38428</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2021-03-30T14:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the owner and group of a file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-owner-and-group-of-a-file/m-p/730119#M38432</link>
      <description>You can post the answer, corrected, and mark that as the solution. I'm certain someone else will ask this or google it at some point.</description>
      <pubDate>Tue, 30 Mar 2021 15:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-owner-and-group-of-a-file/m-p/730119#M38432</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-30T15:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the owner and group of a file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-owner-and-group-of-a-file/m-p/730455#M38443</link>
      <description>For example:&lt;BR /&gt;&lt;BR /&gt;%find_owner('/finsys/lego 816/saspgm/sasmacro/program1.sas');</description>
      <pubDate>Wed, 31 Mar 2021 18:08:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-owner-and-group-of-a-file/m-p/730455#M38443</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2021-03-31T18:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to get the owner and group of a file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-owner-and-group-of-a-file/m-p/730633#M38451</link>
      <description>&lt;P&gt;I think you are overcomplicating things:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
infile "ls -l '&amp;amp;f.'" pipe;
input perms :$10. links owner :$8. group :$8.;
call symputx("owner",owner);
call symputx("group",group);
run;

%put &amp;amp;=owner &amp;amp;=group;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Apr 2021 10:11:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-the-owner-and-group-of-a-file/m-p/730633#M38451</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-01T10:11:56Z</dc:date>
    </item>
  </channel>
</rss>

