<?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: Return SAS Dataset from Stored Process in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Return-SAS-Dataset-from-Stored-Process/m-p/80021#M3537</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; If I had to do this, I would send it as a package. In a previous posting, the Tech Support note put multiple different outputs in the package, including a SAS dataset. I think it is a far "cleaner" method to return results to the stored process consumer.&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Sep 2012 18:33:32 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2012-09-28T18:33:32Z</dc:date>
    <item>
      <title>Return SAS Dataset from Stored Process</title>
      <link>https://communities.sas.com/t5/Developers/Return-SAS-Dataset-from-Stored-Process/m-p/80020#M3536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Short version:&lt;/P&gt;&lt;P&gt;What are the "best" way(s) to have a stored process called through SPWA return a SAS dataset to the user (as an attachment)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Long version:&lt;/P&gt;&lt;P&gt;I have a big SAS dataset, and want to write a stored process that will let users build their own data extracts.&amp;nbsp; Basically it will be a query tool.&amp;nbsp; User will pass a few parameters for a WHERE statement, and specify to return the file as a csv, .xls, or .sas7bdat.&amp;nbsp; When the stored process runs, it should pop up the open/save dialog box.&amp;nbsp; Stored Proces will be called through SPWA. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the csv file I assume I will just use ods CSV writing to _webout (after the appropriate stpsrv_header calls).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And since I don't need any formatting in the Excel sheet, I think for Excel my first shot would be just returning a csv file, with an .xls extension and stpsrv_header telling IE to open it in Excel.&amp;nbsp; I don't need any of the pretty reporting stuff that comes with tagsets.ExcelXP, as this is data, not a report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I'm not sure how to send back a SAS dataset.&amp;nbsp; One thought was to try using a data _null_ step to stream back the .sas7bdat file, as in: &lt;A href="http://support.sas.com/kb/6/588.html"&gt;http://support.sas.com/kb/6/588.html&lt;/A&gt;.&amp;nbsp; I've used that approach for streaming a pdf report, and it has worked well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But maybe I would be better off looking into how to send this as a package instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would appreciate any suggestions/recommendations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 18:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Return-SAS-Dataset-from-Stored-Process/m-p/80020#M3536</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2012-09-28T18:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Return SAS Dataset from Stored Process</title>
      <link>https://communities.sas.com/t5/Developers/Return-SAS-Dataset-from-Stored-Process/m-p/80021#M3537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; If I had to do this, I would send it as a package. In a previous posting, the Tech Support note put multiple different outputs in the package, including a SAS dataset. I think it is a far "cleaner" method to return results to the stored process consumer.&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 18:33:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Return-SAS-Dataset-from-Stored-Process/m-p/80021#M3537</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-09-28T18:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Return SAS Dataset from Stored Process</title>
      <link>https://communities.sas.com/t5/Developers/Return-SAS-Dataset-from-Stored-Process/m-p/80022#M3538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quentin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a way I found after looking through lots of info on it through the internet.&lt;/P&gt;&lt;P&gt;I use the session headers to return a dataset from a permanent library. The dataset is created from another SP that is run before this one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="2854" alt="sas.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/2854_sas.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;The template is used to keep quotes out of the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can run this SP through a browser with a url like:&lt;/P&gt;&lt;P&gt;&lt;A href="http://yourSPserver:8080/SASStoredProcess/do?program=%2FShared+Data%2FYourFolder%2FExportQCResults"&gt;http://yourSPserver:8080/SASStoredProcess/do?_program=%2FShared+Data%2FYourFolder%2FExportQCResults&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Charlie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 15:45:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Return-SAS-Dataset-from-Stored-Process/m-p/80022#M3538</guid>
      <dc:creator>macroCharlie</dc:creator>
      <dc:date>2012-12-18T15:45:10Z</dc:date>
    </item>
  </channel>
</rss>

