<?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: file permission in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/322545#M9280</link>
    <description>&lt;P&gt;I am using SAS EG and my requirement is similar to OP. &amp;nbsp;However, allowxCMD is not enabled on the Unix server. &amp;nbsp;Is there any other way to change file permission from SAS EG?&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2017 00:08:11 GMT</pubDate>
    <dc:creator>GoExplore</dc:creator>
    <dc:date>2017-01-05T00:08:11Z</dc:date>
    <item>
      <title>file permission</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/275796#M7744</link>
      <description>&lt;P&gt;So I have been trying to find a way code a file permission in SAS but have been unsucessful so far. I have found this macros online which is supposed to do this but I don't know what&amp;nbsp;I would change in this code so it changes the permissions to my data. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;macro chmod(libname,dataset,permis=777);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; proc sql;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* get the absolute path of the libname */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select path into: extpath from dictionary.members&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where libname="%UPCASE(&amp;amp;LIBNAME)";&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* find out if there are any datasets in the library */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select count(path) into: cnt from dictionary.members&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where libname="%UPCASE(&amp;amp;LIBNAME)";&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* if there are datasets...then issue the below command to change the&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; permissions of the dataset called in this macro&amp;nbsp; to 777 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if &amp;amp;cnt &amp;gt; 0 %then %do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename chmod pipe "chmod &amp;amp;PERMIS %trim(&amp;amp;extpath)/&amp;amp;dataset..ssd01";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file chmod;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;BR /&gt;%mend;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 20:02:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/275796#M7744</guid>
      <dc:creator>navashi2</dc:creator>
      <dc:date>2016-06-07T20:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: file permission</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/275798#M7745</link>
      <description>&lt;P&gt;Your filename statement doesn't make much sense in a few ways. But basically a filename with the pipe options and the intention to execute that command will be used in a INFILE statement instead of FILE. You then do an INPUT&amp;nbsp;to execute the command and read the standard output. Note that&amp;nbsp;chmod may not output anything when succesful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The construct you use in the filename (trim, PERMIS) will be verbatim part of the command and are bound to fail. Please enlighten us on what you are trying to achieve. That will help us help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 19:52:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/275798#M7745</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-06-07T19:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: file permission</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/275801#M7746</link>
      <description>&lt;P&gt;Your program raises many questions.&amp;nbsp; Let's start with a few basics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you were not using a SAS program and just using a Unix command, do you know what a chmod command should look like?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you really have SAS data sets that are named with the extension "ssd01"?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you checked with your IT department to see if you will get in trouble for using a chmod value of 777?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 20:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/275801#M7746</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-07T20:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: file permission</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/275807#M7748</link>
      <description>&lt;P&gt;Wow .ssd01 extension is a blast from the past. Weren't V6 datasets named this way? With the digits at the end indicating compatibility groups (little vs big endian etc)? If the OP still has these it must be an application with eternal lifespan. Or maybe you just have very old code and your datasets now have the more modern .sas7bdat extension?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The mode of 777 is indeed dangerous as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding﻿&lt;/a&gt;&amp;nbsp;mentioned&amp;nbsp;and would sound alarmbells at our site. Actually 666 would be sufficient but who are we to judge?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for editing your code, it helps. Still, my advice is to change FILE to INFILE and add an INPUT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 21:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/275807#M7748</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-06-07T21:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: file permission</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/275877#M7757</link>
      <description>&lt;P&gt;Using 777 on files would get you (figuratively) "Hung, Drawn and Quartered" around here.&lt;/P&gt;
&lt;P&gt;The only files that need the execute bit set (for anyone) are programs and shell scripts, and those MUST NOT be writable by anyone than the owner.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 06:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/275877#M7757</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-06-08T06:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: file permission</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/322545#M9280</link>
      <description>&lt;P&gt;I am using SAS EG and my requirement is similar to OP. &amp;nbsp;However, allowxCMD is not enabled on the Unix server. &amp;nbsp;Is there any other way to change file permission from SAS EG?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 00:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/322545#M9280</guid>
      <dc:creator>GoExplore</dc:creator>
      <dc:date>2017-01-05T00:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: file permission</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/322619#M9284</link>
      <description>&lt;P&gt;No. Either have XCMD enabled (there is no logical reason against it), or access by SSH so you can set file permissions manually via commandline.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 10:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/file-permission/m-p/322619#M9284</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-05T10:00:18Z</dc:date>
    </item>
  </channel>
</rss>

