<?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 procedures in RTDM in SAS Customer Intelligence</title>
    <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/procedures-in-RTDM/m-p/402163#M633</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;wanna excute a sql procedure using the RTDM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/U&gt; - so in order to do it i need to send a varibles from the flow to that&amp;nbsp;&lt;SPAN&gt;procedure that was built in the DB (sql server) and get&amp;nbsp;a varibles back to the flow,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is this possible ? if yes, what is the best solution for&amp;nbsp;it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RTDM_User&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 08 Oct 2017 07:50:43 GMT</pubDate>
    <dc:creator>RTDM_User</dc:creator>
    <dc:date>2017-10-08T07:50:43Z</dc:date>
    <item>
      <title>procedures in RTDM</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/procedures-in-RTDM/m-p/402163#M633</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;wanna excute a sql procedure using the RTDM,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/U&gt; - so in order to do it i need to send a varibles from the flow to that&amp;nbsp;&lt;SPAN&gt;procedure that was built in the DB (sql server) and get&amp;nbsp;a varibles back to the flow,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is this possible ? if yes, what is the best solution for&amp;nbsp;it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RTDM_User&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2017 07:50:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/procedures-in-RTDM/m-p/402163#M633</guid>
      <dc:creator>RTDM_User</dc:creator>
      <dc:date>2017-10-08T07:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: procedures in RTDM</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/procedures-in-RTDM/m-p/402653#M636</link>
      <description>&lt;P&gt;Hi RTDM_User,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two options you can use to interact with a database in RTDM. The first option is to use the standard data process node, which can be used to either READ, INSERT or UPDATE data in a table (or view).&amp;nbsp;Since you mention procedures, this is not going to work for you (it can't run execute, it will only do SELECT, INSERT &amp;amp; UPDATE). The second option to interact with a database is to write a custom process in DS2, where you can use FedSQL to connect to a data source.&amp;nbsp;With FedSQL you can for example use SQL pass-through (example:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sastraining/2016/07/20/jedi-sas-tricks-explicit-sql-pass-through-in-ds2/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2016/07/20/jedi-sas-tricks-explicit-sql-pass-through-in-ds2/&lt;/A&gt;) to leverage database functions (like a stored procedure).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not a DS2 expert, but I hope this leads you the right way and maybe someone else in the community has an actual solution in DS2 code for running stored processes already.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are a few other useful DS2 references:&lt;/P&gt;
&lt;P&gt;Mastering the SAS DS2 Procedure: Advanced Data Wrangling Techniques, a book by Mark Jordan:&amp;nbsp;&lt;A href="http://support.sas.com/jordan" target="_blank"&gt;http://support.sas.com/jordan&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;SAS 9.4 FedSQL Language Reference:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/viewer.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/viewer.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;SAS 9.4 DS2 Language Reference:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/ds2ref/68052/HTML/default/viewer.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/ds2ref/68052/HTML/default/viewer.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 10:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/procedures-in-RTDM/m-p/402653#M636</guid>
      <dc:creator>needle</dc:creator>
      <dc:date>2017-10-10T10:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: procedures in RTDM</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/procedures-in-RTDM/m-p/402781#M640</link>
      <description>&lt;P&gt;There is a way to make it work with standard data processes, but with some limitations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll need to create a&amp;nbsp;new database table ("input table") where you'd insert your input parameters for a procedure. Plus some unique request identifier (String) to differentiate between multiple concurrent requests.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you'll need to create a SQL Server view that calls the procedure&amp;nbsp;&lt;STRONG&gt;for every record in the input table,&lt;/STRONG&gt; and returns its result, alongside the original request identifier from the source table.&amp;nbsp; If I'm&amp;nbsp;not mistaken, you may need to use the "OPENQUERY" function in the view (can't say exactly, i'm much more of Oracle guy than sql server).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In RTDM, you can then have a sequence of 3 Data Processes:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Insert&lt;/STRONG&gt; your input values to the input table, and use Event.Identity as a request identifier&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Read&lt;/STRONG&gt; from the view, and filter on the request identifier = Event.Identity as criteria variables.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Delete &lt;/STRONG&gt;a record&amp;nbsp;from the input table (again using Event.Identity as a request identifier).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The catch is that you need to make sure the procedure you are calling doesn't have any unsafe side-effects and is safe if sometimes called extra times repeatedly.&amp;nbsp; With this solution,&amp;nbsp; there will be situations where two or more requests are processed concurrently, and there will be more than one record in the input table - so the procedure will be called extra times. Depending on your use case and the nature&amp;nbsp;of this procedure,&amp;nbsp;it may or may not be OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it's not OK, then the way to go develop is a DS2 or Groovy script process that will call the procedure with explicit SQL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 15:11:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/procedures-in-RTDM/m-p/402781#M640</guid>
      <dc:creator>Dmitry_Alergant</dc:creator>
      <dc:date>2017-10-10T15:11:00Z</dc:date>
    </item>
  </channel>
</rss>

