<?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: Convert PLSql components into a SAS program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362238#M85567</link>
    <description>As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; says, you need to use explicit SQL pass thru from SAS. ASFAIK SAS implicit pass thru cannot call UDF's. &lt;BR /&gt;If you wish to SAS SQL skip calling the function. To me it looks like it could be solved by using the products table in a join instead. Probably my ignorance of PLSQL, but where does b.categ_id and price_id come from?</description>
    <pubDate>Sat, 27 May 2017 21:34:00 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2017-05-27T21:34:00Z</dc:date>
    <item>
      <title>Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362165#M85527</link>
      <description>Hi,&lt;BR /&gt;I have two quires in Oracle. 1st one is a main query. It contains joins on multiple tables and in this one of the table column value is passing into the Oracle function and it returns value to the main query.&lt;BR /&gt;&lt;BR /&gt;Please suggest me how can write passing value into a Oracle function and returning values into a main query in SAS. Thanks InAdvance</description>
      <pubDate>Sat, 27 May 2017 10:27:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362165#M85527</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2017-05-27T10:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362167#M85528</link>
      <description>Please shaee an example on how you this today, as simplified as possible.&lt;BR /&gt;Also, would you like to populate the paramter?</description>
      <pubDate>Sat, 27 May 2017 12:01:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362167#M85528</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-05-27T12:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362175#M85533</link>
      <description>&lt;P&gt;Search SQL Pass Thru&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 14:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362175#M85533</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-27T14:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362220#M85566</link>
      <description>&lt;P&gt;I have join as below.&lt;/P&gt;&lt;P&gt;QUERY:&lt;/P&gt;&lt;P&gt;select a.country_name,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; b.state_name,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c.city_name,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; d.product_type,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; call_func(d.product_id) as product_name&amp;nbsp;&lt;/P&gt;&lt;P&gt;from country a,state b,city c,product_info d&lt;/P&gt;&lt;P&gt;where a.country_id=b.country_id and&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b.state_id=c.state_id and&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c.product_type_id=d.&lt;SPAN&gt;product_type_id;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the above quey tables are taken from different users.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FUNCTION:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;CREATE or REPLACE FUNCTION call_func(product_id IN NUMBER) 
   RETURN VARCHAR2 
   IS acc_bal NUMBER(11,2);
&lt;SPAN class="italic"&gt;   BEGIN &lt;/SPAN&gt;
&lt;SPAN class="italic"&gt;      SELECT a.product_name as produc_name &lt;/SPAN&gt;
&lt;SPAN class="italic"&gt;      INTO product_name &lt;/SPAN&gt;
&lt;SPAN class="italic"&gt;      FROM products a,categ b,price c&lt;/SPAN&gt;
&lt;SPAN class="italic"&gt;      WHERE a.product_id = product_id&lt;BR /&gt;            and a.categ_id=b.categ_id&lt;BR /&gt;&lt;/SPAN&gt;            and b.price_id=c.price_id;
&lt;SPAN class="italic"&gt;      RETURN(product_name); &lt;/SPAN&gt;
&lt;SPAN class="italic"&gt;    END;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Please ignore in case of any syntax errors but query pupose is same.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please let me know how can I do in SAS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As of now, we copied required database tables in SAS and then doing SAS joins in proc sql.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So please suggest me in which ways how can i achieve above one.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks In Advance.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 18:09:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362220#M85566</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2017-05-27T18:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362238#M85567</link>
      <description>As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; says, you need to use explicit SQL pass thru from SAS. ASFAIK SAS implicit pass thru cannot call UDF's. &lt;BR /&gt;If you wish to SAS SQL skip calling the function. To me it looks like it could be solved by using the products table in a join instead. Probably my ignorance of PLSQL, but where does b.categ_id and price_id come from?</description>
      <pubDate>Sat, 27 May 2017 21:34:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362238#M85567</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-05-27T21:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362245#M85569</link>
      <description>&lt;P&gt;This post has a clear explanation of how to run unmodified Oracle SQL in SAS:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-help-in-converstion-of-oracle-to-AS/m-p/358926#M23625" target="_blank"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/Urgent-help-in-converstion-of-oracle-to-AS/m-p/358926#M23625&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2017 00:08:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362245#M85569</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-05-28T00:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362251#M85570</link>
      <description>Hi Linush, thanks for your reply. If input tables exist in different databases and those tables are involved in joining condition.inthese case how can I use explicit SQL pass through.Thanks.</description>
      <pubDate>Sun, 28 May 2017 01:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362251#M85570</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2017-05-28T01:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362252#M85571</link>
      <description>&lt;P&gt;The same way you did before. It happens on the server, so if the server could run the code before it still can now.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your data structure has changed that's a different story.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2017 02:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362252#M85571</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-28T02:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362254#M85573</link>
      <description>Thanks Reza, Just want to confirm you one thing, Can I include Oracle function query in place of call_func(d.product_id) as product_name. I hope in Oracle we can perform select clause in place of column name in Select statement. Please advice.</description>
      <pubDate>Sun, 28 May 2017 02:33:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362254#M85573</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2017-05-28T02:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362256#M85574</link>
      <description>&lt;P&gt;If it works on the server it will work in pass through. Either way, test it out, very easy to test.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2017 03:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362256#M85574</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-28T03:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362465#M85632</link>
      <description>&lt;P&gt;Hi Linush,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if I have only one PL/SQL procedure or function then I can call as mentioned below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;&lt;BR /&gt;connect to oracle (user="oracleUserName" password="pass" path="serverPath" CONNECTION=GLOBAL CONNECTION_GROUP = SASAML);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; execute( execute MyPackage.MyProcedure(&amp;amp;param1, &amp;amp;param2) ) by oracle;&lt;BR /&gt;disconnect from oracle;&lt;BR /&gt;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you see my query, Scenario is different.&lt;/P&gt;&lt;P&gt;For example, I have 10 variables in select clause and one of the variable value is passing to Oracle function and then doing&lt;/P&gt;&lt;P&gt;some business logic overe there and function returns back&amp;nbsp;value into main query and rest of 9 columns are populated directly from other 9 tables by joining the tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex: select a,b,c,call_func(d) e,f,g from s1,s2......etc..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggest me how can i achieve this in sas.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 11:05:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362465#M85632</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2017-05-29T11:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362535#M85658</link>
      <description>&lt;P&gt;Don't use EXECUTE just use SELECT ... FROM CONNECTION TO ...&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select * from connection to oracle
(/* Place ORACLE code inside the () */
select ......
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 May 2017 16:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362535#M85658</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-05-29T16:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362540#M85659</link>
      <description>You got the answer from &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;.&lt;BR /&gt;The from connection to construct is also considered as explicit SQL pass through, and is used when you want to return something to the SAS session.</description>
      <pubDate>Mon, 29 May 2017 16:37:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362540#M85659</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-05-29T16:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert PLSql components into a SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362569#M85667</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/134610"&gt;@Banu&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;With pass-through SQL you can run anything that works directly in Oracle (i.e. using SQL Developer) out of SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS sends the code in the pass-through block "as-is" to Oracle for exection. So if your code works out of SQL Developer then it will work out of a pass-through block in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want SAS to execute something in Oracle without returning a result then wrap the Oracle code into an EXECUTE() block, else if you want a result set back then use SELECT * from connection to &amp;lt;oracle&amp;gt; ( &amp;lt;your Oracle SQL&amp;gt; );&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 23:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-PLSql-components-into-a-SAS-program/m-p/362569#M85667</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-05-29T23:07:21Z</dc:date>
    </item>
  </channel>
</rss>

