<?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 STP Server &amp; Java Client in Developers</title>
    <link>https://communities.sas.com/t5/Developers/STP-Server-Java-Client/m-p/2436#M1639</link>
    <description>I am not a SAS programmer, user, or administrator and I know very little about SAS in general (not ideal, but that's how it is right now).   I am developing a Java application which needs to connect to a SAS stored process server (pooled from the metadata server), execute a stored process and handle the results.  Not a web app, just a plain old command line single method java application.  Using the STP web app is not an option, the portal and web layer are not installed.  I was hoping the SAS site would have a complete example of doing this, but I wasn't able to find one.&lt;BR /&gt;
&lt;BR /&gt;
I started with "Connecting with Server Attributes Read from a SAS Metadata Server"&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/dist-obj/javaclnt/javaprog/connfact_omr.html" target="_blank"&gt;http://support.sas.com/rnd/itech/doc9/dev_guide/dist-obj/javaclnt/javaprog/connfact_omr.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Instead of specifying the workspace server's logical name login015Logical, I specified the load balanced stored process server's logical name.  &lt;BR /&gt;
&lt;BR /&gt;
I then narrow the object and get a reference to the stored process server instead of the workspace server:&lt;BR /&gt;
IStoredProcessServer stpServer = IStoredProcessServerHelper.narrow(obj);&lt;BR /&gt;
&lt;BR /&gt;
I then create the context for the stored process (com.sas.iom.SASStoredProcess.IStoredProcessContext), which seems to take the physical locations, not the logical locations&lt;BR /&gt;
&lt;BR /&gt;
StringHolder arg0 = new StringHolder();&lt;BR /&gt;
String[] names = {};&lt;BR /&gt;
String[] values = {};&lt;BR /&gt;
String sessionId = "";&lt;BR /&gt;
String repos = "/var/sasrepo";&lt;BR /&gt;
String process = "test.sas";&lt;BR /&gt;
IStoredProcessContext stpContext= stpServer.CreateContext(repos, process,names, values, sessionId);&lt;BR /&gt;
&lt;BR /&gt;
Following that I execute it with&lt;BR /&gt;
stpContext.Execute(arg0);&lt;BR /&gt;
&lt;BR /&gt;
Now, this works, the stored process is executed from what I can tell... using stpContext.GetFormattedSasLog returns the expected log results.&lt;BR /&gt;
&lt;BR /&gt;
What I am unsure of is how to get the resulting dataset from the stored process.  Using the Workspace server from the original example I would do a executeWithResults and get a ResultSet back or grab a Connection and select results from work.out.  With the IStoredProcessContext object I'm not sure how to go about retreiving results or how/what the stored process coder needs to send the results to within the process.&lt;BR /&gt;
&lt;BR /&gt;
Compounding this problem is there appears to be no documentation for IStoredProcessServer, IStoredProcessContext and their related classes.&lt;BR /&gt;
&lt;BR /&gt;
Am I barking up the wrong tree?  Is there a simpler way to execute processes on a pooled stored process server using the metadata server to get the connection... is there a complete example?  I can imagine people have done this and I am just missing some easier way to do it, but I've gone over all the documentation I can find and am sad to say I'm just not seeing it.</description>
    <pubDate>Wed, 07 Mar 2007 21:33:58 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2007-03-07T21:33:58Z</dc:date>
    <item>
      <title>STP Server &amp; Java Client</title>
      <link>https://communities.sas.com/t5/Developers/STP-Server-Java-Client/m-p/2436#M1639</link>
      <description>I am not a SAS programmer, user, or administrator and I know very little about SAS in general (not ideal, but that's how it is right now).   I am developing a Java application which needs to connect to a SAS stored process server (pooled from the metadata server), execute a stored process and handle the results.  Not a web app, just a plain old command line single method java application.  Using the STP web app is not an option, the portal and web layer are not installed.  I was hoping the SAS site would have a complete example of doing this, but I wasn't able to find one.&lt;BR /&gt;
&lt;BR /&gt;
I started with "Connecting with Server Attributes Read from a SAS Metadata Server"&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/dist-obj/javaclnt/javaprog/connfact_omr.html" target="_blank"&gt;http://support.sas.com/rnd/itech/doc9/dev_guide/dist-obj/javaclnt/javaprog/connfact_omr.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Instead of specifying the workspace server's logical name login015Logical, I specified the load balanced stored process server's logical name.  &lt;BR /&gt;
&lt;BR /&gt;
I then narrow the object and get a reference to the stored process server instead of the workspace server:&lt;BR /&gt;
IStoredProcessServer stpServer = IStoredProcessServerHelper.narrow(obj);&lt;BR /&gt;
&lt;BR /&gt;
I then create the context for the stored process (com.sas.iom.SASStoredProcess.IStoredProcessContext), which seems to take the physical locations, not the logical locations&lt;BR /&gt;
&lt;BR /&gt;
StringHolder arg0 = new StringHolder();&lt;BR /&gt;
String[] names = {};&lt;BR /&gt;
String[] values = {};&lt;BR /&gt;
String sessionId = "";&lt;BR /&gt;
String repos = "/var/sasrepo";&lt;BR /&gt;
String process = "test.sas";&lt;BR /&gt;
IStoredProcessContext stpContext= stpServer.CreateContext(repos, process,names, values, sessionId);&lt;BR /&gt;
&lt;BR /&gt;
Following that I execute it with&lt;BR /&gt;
stpContext.Execute(arg0);&lt;BR /&gt;
&lt;BR /&gt;
Now, this works, the stored process is executed from what I can tell... using stpContext.GetFormattedSasLog returns the expected log results.&lt;BR /&gt;
&lt;BR /&gt;
What I am unsure of is how to get the resulting dataset from the stored process.  Using the Workspace server from the original example I would do a executeWithResults and get a ResultSet back or grab a Connection and select results from work.out.  With the IStoredProcessContext object I'm not sure how to go about retreiving results or how/what the stored process coder needs to send the results to within the process.&lt;BR /&gt;
&lt;BR /&gt;
Compounding this problem is there appears to be no documentation for IStoredProcessServer, IStoredProcessContext and their related classes.&lt;BR /&gt;
&lt;BR /&gt;
Am I barking up the wrong tree?  Is there a simpler way to execute processes on a pooled stored process server using the metadata server to get the connection... is there a complete example?  I can imagine people have done this and I am just missing some easier way to do it, but I've gone over all the documentation I can find and am sad to say I'm just not seeing it.</description>
      <pubDate>Wed, 07 Mar 2007 21:33:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/STP-Server-Java-Client/m-p/2436#M1639</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-03-07T21:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: STP Server &amp; Java Client</title>
      <link>https://communities.sas.com/t5/Developers/STP-Server-Java-Client/m-p/2437#M1640</link>
      <description>Try contacting our Technical Support department.  They may have some starter code for you to try:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/ctx/supportform/index.jsp" target="_blank"&gt;http://support.sas.com/ctx/supportform/index.jsp&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Vince DelGobbo&lt;BR /&gt;
SAS R&amp;amp;D</description>
      <pubDate>Fri, 06 Apr 2007 14:54:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/STP-Server-Java-Client/m-p/2437#M1640</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2007-04-06T14:54:57Z</dc:date>
    </item>
  </channel>
</rss>

