<?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 allow update data only with macro in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-allow-update-data-only-with-macro/m-p/422032#M12953</link>
    <description>&lt;P&gt;One way would be to make that table read only in Oracle, then have a special account for write access, and grant it only to the process which runs that macro (i.e. create a user called write_to_db, and use that account to run the code with.&amp;nbsp; It doesn't stop them running other code however.&amp;nbsp; Maybe stored process might help, if you have that (you haven't specified what you have).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another method maybe that the user writes their data to an area, and a general utility program is run once something appears in that area which uploads the data and then removes the file.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can't think of much more than that, its one of the problems with trying to drive one application with another.&amp;nbsp; Far better to have your users write out data to given area, then the database (i.e. no involvement of SAS or user) picks up that data and runs with it.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Dec 2017 16:17:55 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-12-18T16:17:55Z</dc:date>
    <item>
      <title>How to allow update data only with macro</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-allow-update-data-only-with-macro/m-p/422027#M12952</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I have a dataset MYDS (it is Oracle table) and macro %update_myds which can update it according to some algorithm. I don’t want user can manually update MYDS (ex. with proc sql or data step). Is there some way to make such restriction?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;
&lt;P&gt;Dmitry&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 16:10:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-allow-update-data-only-with-macro/m-p/422027#M12952</guid>
      <dc:creator>DmitryErshov</dc:creator>
      <dc:date>2017-12-18T16:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to allow update data only with macro</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-allow-update-data-only-with-macro/m-p/422032#M12953</link>
      <description>&lt;P&gt;One way would be to make that table read only in Oracle, then have a special account for write access, and grant it only to the process which runs that macro (i.e. create a user called write_to_db, and use that account to run the code with.&amp;nbsp; It doesn't stop them running other code however.&amp;nbsp; Maybe stored process might help, if you have that (you haven't specified what you have).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another method maybe that the user writes their data to an area, and a general utility program is run once something appears in that area which uploads the data and then removes the file.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can't think of much more than that, its one of the problems with trying to drive one application with another.&amp;nbsp; Far better to have your users write out data to given area, then the database (i.e. no involvement of SAS or user) picks up that data and runs with it.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 16:17:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-allow-update-data-only-with-macro/m-p/422032#M12953</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-18T16:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to allow update data only with macro</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-allow-update-data-only-with-macro/m-p/422659#M12976</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37016"&gt;@DmitryErshov&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I believe that boils down to the question how you can have a user initiate a defined process which does something the user can't do with his own credentials.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the SAS side I can only think of:&lt;/P&gt;
&lt;P&gt;- secure compiled macro which connects to Oracle with different credentials (requires user and pw to be compiled into the macro which is ugly).&lt;/P&gt;
&lt;P&gt;- Stored Process with pooled workspace server (so sp process executes with different credentials)&lt;/P&gt;
&lt;P&gt;- batch process: user can only trigger the batch which then runs under a batch user&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As this is Oracle and you actually want to control what can be done on the Oracle side: I believe you could also implement an Oracle Stored Process which does the update. Load the data from SAS to a staging table and then call the Oracle stored process from SAS and only this Ora process got actually the grant to update the table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 10:54:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-allow-update-data-only-with-macro/m-p/422659#M12976</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-12-20T10:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to allow update data only with macro</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-allow-update-data-only-with-macro/m-p/422671#M12978</link>
      <description>&lt;P&gt;Hello!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your replies! I like idea with Stored Process (proc stp wrapped within macro). But how can I make STP execute from the other user?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Dmitry&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2017 11:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-allow-update-data-only-with-macro/m-p/422671#M12978</guid>
      <dc:creator>DmitryErshov</dc:creator>
      <dc:date>2017-12-20T11:46:48Z</dc:date>
    </item>
  </channel>
</rss>

