<?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: Writing a stored process for Generated Web Service (SAS BI Web Services) in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Writing-a-stored-process-for-Generated-Web-Service-SAS-BI-Web/m-p/62495#M3161</link>
    <description>No. &lt;BR /&gt;
&lt;BR /&gt;
The link you provided gives me an idea of how to expose a sproc as a "Generated web service". But I am looking to find out how to the sproc needs to be written to read the input parameters.&lt;BR /&gt;
&lt;BR /&gt;
For example, in the documentation for XMLA web services the suggestion is to write the sproc something like this - &lt;BR /&gt;
&lt;BR /&gt;
----------------------------------&lt;BR /&gt;
%put &amp;amp;tablename&lt;BR /&gt;
&lt;BR /&gt;
libname _WEBOUT xml xmlmeta = &amp;amp;_XMLSCHEMA;&lt;BR /&gt;
libname instream xml;&lt;BR /&gt;
&lt;BR /&gt;
proc means data=instream.&amp;amp;tablename&lt;BR /&gt;
   output out=_WEBOUT.mean;&lt;BR /&gt;
run;&lt;BR /&gt;
-------------------------------&lt;BR /&gt;
&lt;BR /&gt;
is this how we would write the sproc to be callable from a Generated web service?</description>
    <pubDate>Mon, 01 Mar 2010 01:29:24 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-03-01T01:29:24Z</dc:date>
    <item>
      <title>Writing a stored process for Generated Web Service (SAS BI Web Services)</title>
      <link>https://communities.sas.com/t5/Developers/Writing-a-stored-process-for-Generated-Web-Service-SAS-BI-Web/m-p/62493#M3159</link>
      <description>Hi,&lt;BR /&gt;
    In the documentation for SAS BI WebServices for XMLA (http://support.sas.com/documentation/cdl/en/wbsvcdg/61496/HTML/default/sample.htm) there is a good explanation of how to write a stored process for an XMLA web service. But we are looking to expose the sproc as a Generated Web Service (the new way in 9.2). I am looking to understand how to write the sproc if its going to be exposed as a "Generated web service".&lt;BR /&gt;
&lt;BR /&gt;
I also searched in the "samples" database but had no luck. Did anyone try to expose a stored process as a Generated web service? If so, can you share some sample code? Essentially, I would like to understand what magic needs to be done in the sproc to read the input parameters and send the output parameters.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Sudhir</description>
      <pubDate>Fri, 26 Feb 2010 20:11:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Writing-a-stored-process-for-Generated-Web-Service-SAS-BI-Web/m-p/62493#M3159</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-02-26T20:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Writing a stored process for Generated Web Service (SAS BI Web Services)</title>
      <link>https://communities.sas.com/t5/Developers/Writing-a-stored-process-for-Generated-Web-Service-SAS-BI-Web/m-p/62494#M3160</link>
      <description>This link is right below the one you referenced:&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Using Generated Web Services&lt;/B&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/wbsvcdg/61496/HTML/default/a003257649.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/wbsvcdg/61496/HTML/default/a003257649.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Does that provide the information that you need?&lt;BR /&gt;
&lt;BR /&gt;
Vince DelGobbo&lt;BR /&gt;
SAS R&amp;amp;D</description>
      <pubDate>Fri, 26 Feb 2010 20:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Writing-a-stored-process-for-Generated-Web-Service-SAS-BI-Web/m-p/62494#M3160</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2010-02-26T20:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Writing a stored process for Generated Web Service (SAS BI Web Services)</title>
      <link>https://communities.sas.com/t5/Developers/Writing-a-stored-process-for-Generated-Web-Service-SAS-BI-Web/m-p/62495#M3161</link>
      <description>No. &lt;BR /&gt;
&lt;BR /&gt;
The link you provided gives me an idea of how to expose a sproc as a "Generated web service". But I am looking to find out how to the sproc needs to be written to read the input parameters.&lt;BR /&gt;
&lt;BR /&gt;
For example, in the documentation for XMLA web services the suggestion is to write the sproc something like this - &lt;BR /&gt;
&lt;BR /&gt;
----------------------------------&lt;BR /&gt;
%put &amp;amp;tablename&lt;BR /&gt;
&lt;BR /&gt;
libname _WEBOUT xml xmlmeta = &amp;amp;_XMLSCHEMA;&lt;BR /&gt;
libname instream xml;&lt;BR /&gt;
&lt;BR /&gt;
proc means data=instream.&amp;amp;tablename&lt;BR /&gt;
   output out=_WEBOUT.mean;&lt;BR /&gt;
run;&lt;BR /&gt;
-------------------------------&lt;BR /&gt;
&lt;BR /&gt;
is this how we would write the sproc to be callable from a Generated web service?</description>
      <pubDate>Mon, 01 Mar 2010 01:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Writing-a-stored-process-for-Generated-Web-Service-SAS-BI-Web/m-p/62495#M3161</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-01T01:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Writing a stored process for Generated Web Service (SAS BI Web Services)</title>
      <link>https://communities.sas.com/t5/Developers/Writing-a-stored-process-for-Generated-Web-Service-SAS-BI-Web/m-p/62496#M3162</link>
      <description>Hi:&lt;BR /&gt;
  SAS Stored Process input parameters are surfaced to your SAS session as GLOBAL SAS Macro variables. So, your stored process needs to use SAS Macro variables in an appropriate manner.&lt;BR /&gt;
&lt;BR /&gt;
  For example, &amp;amp;TABLENAME in the code you show is a Macro variable, whose value will be supplied either from a %LET statement in the Stored Process code; from a CALL SYMPUT  in the Stored Process code or from an INPUT parameter value  for which the user is prompted in one of the prompting interfaces in either a client application or from a default which is set in the stored process parameter registration process. &lt;BR /&gt;
 &lt;BR /&gt;
To understand how to write a stored process, you can review the developer's documentation:&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/index.html" target="_blank"&gt;http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/index.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/program.html" target="_blank"&gt;http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/program.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/stpmacro.html" target="_blank"&gt;http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/stpmacro.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/stpsamp.html" target="_blank"&gt;http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/stpsamp.html&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
And, to understand how to use SAS Macro variables in a SAS Stored Process, these papers might prove useful:&lt;BR /&gt;
&lt;A href="http://www.nesug.org/Proceedings/nesug07/ap/ap22.pdf" target="_blank"&gt;http://www.nesug.org/Proceedings/nesug07/ap/ap22.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/forum2007/023-2007.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2007/023-2007.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/forum2008/024-2008.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/024-2008.pdf&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
The difference between surfacing a stored process in a client application and a web service does require some adjustment in your code. For example, it is explained here:&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/websrvcs/program.html" target="_blank"&gt;http://support.sas.com/rnd/itech/doc9/dev_guide/websrvcs/program.html&lt;/A&gt;&lt;BR /&gt;
          &lt;BR /&gt;
&lt;B&gt;Quoted from above page:&lt;BR /&gt;
" The following list explains unique details about Web service stored processes: &lt;BR /&gt;
-- The data returned by the stored process must be XML.&lt;BR /&gt;
&lt;BR /&gt;
--The %STPBEGIN or %STPEND macros are not used with Web service stored processes. These macros set up ODS statements for the stored process, but Web services do not use ODS.&lt;BR /&gt;
&lt;BR /&gt;
--Web service stored processes produce streaming results, which means that the SAS program writes output to _WEBOUT, typically by using the following LIBNAME statement:    libname _WEBOUT xml xmlmeta=&amp;amp;_XMLSCHEMA;&lt;BR /&gt;
                  &lt;BR /&gt;
-- The _XMLSCHEMA macro is unique to Web services. This macro is passed to the SAS program when it is invoked from the Web service. The _XMLSCHEMA macro is set to one of three values depending on the Content property that gets passed to the Execute call. &lt;BR /&gt;
&lt;BR /&gt;
-- Input streams are unique to Web services. Input streams are filerefs that contain XML. "&lt;/B&gt;&lt;BR /&gt;
 &lt;BR /&gt;
So in a sense, in order to understand how to write a stored process for a generated web service you need to:&lt;BR /&gt;
1) understand some of SAS Macro facility basics (the paper is a good resource: &lt;A href="http://www2.sas.com/proceedings/sugi28/056-28.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi28/056-28.pdf&lt;/A&gt; )&lt;BR /&gt;
2) understand the basics of how macro variables will contain the stored process input parameter values&lt;BR /&gt;
3) understand how to write a "regular" stored process (perhaps test your stored process in a client application like EG)&lt;BR /&gt;
4) then apply the changes quoted above to your code for the web services stored process usage. (Such as adding &amp;amp;_XMLSCHEMA and using _webout appropriately and making sure that the results are streamed back to the web service.)&lt;BR /&gt;
   &lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 01 Mar 2010 04:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Writing-a-stored-process-for-Generated-Web-Service-SAS-BI-Web/m-p/62496#M3162</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-03-01T04:15:34Z</dc:date>
    </item>
  </channel>
</rss>

