<?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: UDF to be used in SQL from a Java Class. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/UDF-to-be-used-in-SQL-from-a-Java-Class/m-p/303768#M312435</link>
    <description>&lt;P&gt;I should have been more clear..The Concat was an example of how we want to use a Java Class.&lt;/P&gt;&lt;P&gt;We have a functionality that we would like to use in SAS and is not provided as a Function in SAS or Database layer.&lt;/P&gt;&lt;P&gt;All the logic has been written in Java and rather than having the logic recreated at each edge point(Oracle, DB2, Teradata, Hive&amp;nbsp;etc)&lt;/P&gt;&lt;P&gt;we would like to create a UDF based on this Java Class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am aware we can call Java objects in SAS but have not come across any documentation where we can create a UDF using a Java Class(jar).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prashant.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2016 13:09:59 GMT</pubDate>
    <dc:creator>pprashantj</dc:creator>
    <dc:date>2016-10-11T13:09:59Z</dc:date>
    <item>
      <title>UDF to be used in SQL from a Java Class.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UDF-to-be-used-in-SQL-from-a-Java-Class/m-p/303590#M312433</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a UDF from a Java class which can be used in a SQL statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For eg:&lt;/P&gt;&lt;P&gt;I have an Employee table in DB2 and Oracle.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Columns: EMP_ID, FRST_NM, LST_NM, DEPT_ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Java calss which concatenates FRST_NM and LST_NM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;package com.udf&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;public class &lt;/SPAN&gt;Concat {&lt;BR /&gt;    &lt;SPAN&gt;public &lt;/SPAN&gt;String &lt;SPAN&gt;concat&lt;/SPAN&gt;(String in1&lt;SPAN&gt;, &lt;/SPAN&gt;String in2)&lt;BR /&gt;    {&lt;BR /&gt;        &lt;SPAN&gt;return &lt;/SPAN&gt;in1 + &lt;SPAN&gt;" " &lt;/SPAN&gt;+ in2&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to be able to call this concat in any SQL:&lt;/P&gt;&lt;P&gt;Select &amp;nbsp;EMP_ID, concat(FRST_NM, LST_NM) from Employee; -- DB2&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Select &amp;nbsp;EMP_ID, concat(FRST_NM, LST_NM) from Employee; --&amp;nbsp;Oracle&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is this possible?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If yes how would i create a UDF "Concat" from this java class?&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Prashant.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2016 16:21:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UDF-to-be-used-in-SQL-from-a-Java-Class/m-p/303590#M312433</guid>
      <dc:creator>pprashantj</dc:creator>
      <dc:date>2016-10-10T16:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: UDF to be used in SQL from a Java Class.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UDF-to-be-used-in-SQL-from-a-Java-Class/m-p/303678#M312434</link>
      <description>&lt;P&gt;The functionality (concat) you want is easily accessible in SAS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using java class functions in SQL on the other hand I'm not sure about. Can you explain a bit more about what you're trying to do? I assume it's make the same code run on both Oracle and SAS without having to make manual changes?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2016 22:39:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UDF-to-be-used-in-SQL-from-a-Java-Class/m-p/303678#M312434</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-10T22:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: UDF to be used in SQL from a Java Class.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UDF-to-be-used-in-SQL-from-a-Java-Class/m-p/303768#M312435</link>
      <description>&lt;P&gt;I should have been more clear..The Concat was an example of how we want to use a Java Class.&lt;/P&gt;&lt;P&gt;We have a functionality that we would like to use in SAS and is not provided as a Function in SAS or Database layer.&lt;/P&gt;&lt;P&gt;All the logic has been written in Java and rather than having the logic recreated at each edge point(Oracle, DB2, Teradata, Hive&amp;nbsp;etc)&lt;/P&gt;&lt;P&gt;we would like to create a UDF based on this Java Class.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am aware we can call Java objects in SAS but have not come across any documentation where we can create a UDF using a Java Class(jar).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prashant.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 13:09:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UDF-to-be-used-in-SQL-from-a-Java-Class/m-p/303768#M312435</guid>
      <dc:creator>pprashantj</dc:creator>
      <dc:date>2016-10-11T13:09:59Z</dc:date>
    </item>
  </channel>
</rss>

