<?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 Get SAS Stored procedure output in excel automatically while running from web portal in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325182#M5200</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm developing sas stored procedures to get attached in web portal to display data automatically in Excel. But i am getting error while running this code. Can anyone help me with the code which i can include in my stored procedure to get output automatically in excel ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Good luck to me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2017 06:10:33 GMT</pubDate>
    <dc:creator>v9dduhan</dc:creator>
    <dc:date>2017-01-17T06:10:33Z</dc:date>
    <item>
      <title>Get SAS Stored procedure output in excel automatically while running from web portal</title>
      <link>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325182#M5200</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm developing sas stored procedures to get attached in web portal to display data automatically in Excel. But i am getting error while running this code. Can anyone help me with the code which i can include in my stored procedure to get output automatically in excel ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Good luck to me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 06:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325182#M5200</guid>
      <dc:creator>v9dduhan</dc:creator>
      <dc:date>2017-01-17T06:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get SAS Stored procedure output in excel automatically while running from web portal</title>
      <link>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325189#M5201</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114040"&gt;@v9dduhan&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But i am getting error while running this code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And a sack of rice dropped in China.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to be MUCH more specific to get help.&lt;/P&gt;
&lt;P&gt;- log (excerpt) with code and ERROR(s)&lt;/P&gt;
&lt;P&gt;- what are you trying to achieve in detail?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; (Loading in Excel through Add-In, automatic creation of Excel file, ...)&lt;/P&gt;
&lt;P&gt;- what is your SAS setup (1-2-3 tier, involved operating systems)?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 07:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325189#M5201</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-17T07:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get SAS Stored procedure output in excel automatically while running from web portal</title>
      <link>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325191#M5202</link>
      <description>&lt;P&gt;Here is code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%global&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; make;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%global&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; type;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; t1 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; *&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.cars&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; make = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;make."&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; type = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;type."&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tagsets.ExcelXP &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;file&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'c:\test1.xlsx'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;report&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=work.t1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;This is error:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;27&lt;/P&gt;&lt;P&gt;28 ods tagsets.ExcelXP file='c:\test1.xlsx';&lt;/P&gt;&lt;P&gt;NOTE: Writing TAGSETS.EXCELXP Body file: c:\test1.xlsx&lt;/P&gt;&lt;P&gt;ERROR: Insufficient authorization to access /sas/EBIServer/Lev2/SASApp_Prod/c:\test1.xlsx.&lt;/P&gt;&lt;P&gt;ERROR: No body file. TAGSETS.EXCELXP output will not be created.&lt;/P&gt;&lt;P&gt;29 proc report data=work.t1;&lt;/P&gt;&lt;P&gt;30 run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get output in temporary excel file on same system from which this stored procedure invoked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here i'm just testing using "C:" drive of my system, but this should be temporary file location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggession ?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 08:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325191#M5202</guid>
      <dc:creator>v9dduhan</dc:creator>
      <dc:date>2017-01-17T08:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get SAS Stored procedure output in excel automatically while running from web portal</title>
      <link>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325192#M5203</link>
      <description>&lt;P&gt;-&amp;gt;&amp;nbsp; ERROR: Insufficient authorization to access /sas/EBIServer/Lev2/SASApp_Prod/c:\test1.xlsx.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you have at least a 2-tier SAS setup (server and client), and the server runs on UNIX.&lt;/P&gt;
&lt;P&gt;The working directory for the SAS server process is /sas/EBIServer/Lev2/SASApp_Prod, and a normal user (or sassrv, which runs pooled servers like the stored process server) must not have write access there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Necessary actions by you:&lt;/P&gt;
&lt;P&gt;- define (or have defined) a location &lt;STRONG&gt;on the server&lt;/STRONG&gt; where such temporary files can be written. Make sure that the users involved have write permisison there&lt;/P&gt;
&lt;P&gt;- use UNIX style filename/pathname syntax. Look here: &lt;A href="https://en.wikipedia.org/wiki/Unix_filesystem" target="_blank"&gt;https://en.wikipedia.org/wiki/Unix_filesystem&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;- after creating the file, you need to download it to your PC. WinSCP is a tool for this. Or you create the STP in a way that it sends the ouput directly, using proper HTML code, so the browser knows what to do with the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 08:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325192#M5203</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-17T08:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get SAS Stored procedure output in excel automatically while running from web portal</title>
      <link>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325233#M5204</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;for making me understand the problem and structure. Can you please help with the code as well through which i can send output directly to location. I am not good in html coding, but i will try. can you give me general structure in stored procedure perspective which will send output to location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 10:49:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325233#M5204</guid>
      <dc:creator>v9dduhan</dc:creator>
      <dc:date>2017-01-17T10:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get SAS Stored procedure output in excel automatically while running from web portal</title>
      <link>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325244#M5205</link>
      <description>&lt;P&gt;First of all, get a simple step running before trying your hand at stored processes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One location that is surely writable by you is your UNIX home directory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So modify your code like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods tagsets.ExcelXP file='$HOME/test1.xml';

proc report data=work.t1;
run;

ods tagsets.excelxp close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Once that step runs without ERRORs or WARNINGs, start WinSCP or similar, log on to the SAS server (using ypur SAS credentials), and you'll find the test1.xml.&lt;/P&gt;
&lt;P&gt;(I used .xml because tagsets.excelxp creates a XML file, and Excel from 2010 on complains if the filename extension does not match the contents)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 11:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325244#M5205</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-17T11:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get SAS Stored procedure output in excel automatically while running from web portal</title>
      <link>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325246#M5206</link>
      <description>&lt;P&gt;Still getting error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: The address space has used a maximum of 1148K below the line and 57760K above the line.&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;24 %let _odsdest=excel;&lt;/P&gt;&lt;P&gt;25&lt;/P&gt;&lt;P&gt;26 ods tagsets.ExcelXP file='$HOME/test1.xml';&lt;/P&gt;&lt;P&gt;NOTE: Writing TAGSETS.EXCELXP Body file: $HOME/test1.xml&lt;/P&gt;&lt;P&gt;ERROR: A component of /usr/lpp/SAS_R93M2/config/Lev2/SASApp_SYSA/$HOME is not a directory.&lt;/P&gt;&lt;P&gt;ERROR: No body file. TAGSETS.EXCELXP output will not be created.&lt;/P&gt;&lt;P&gt;27 title 'SASHELP.Class';&lt;/P&gt;&lt;P&gt;28 proc report data=work.t1;&lt;/P&gt;&lt;P&gt;29 run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 11:43:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325246#M5206</guid>
      <dc:creator>v9dduhan</dc:creator>
      <dc:date>2017-01-17T11:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get SAS Stored procedure output in excel automatically while running from web portal</title>
      <link>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325251#M5207</link>
      <description>&lt;P&gt;You have switched context&lt;/P&gt;
&lt;P&gt;/usr/lpp/SAS_R93M2/config/Lev2/SASApp_SYSA/ points to a different directory than that in your first post.&lt;/P&gt;
&lt;P&gt;That's not your EBIServer context.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 11:50:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/325251#M5207</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-17T11:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get SAS Stored procedure output in excel automatically while running from web portal</title>
      <link>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/327472#M5208</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;You need to direct the output to the reserved _WEBOUT FILEREF. &amp;nbsp;Review page 18 of this paper:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings15/SAS1700-2015.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings15/SAS1700-2015.pdf&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Then try something like this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods _all_ close;

%let RV=%sysfunc(appsrv_header(Content-type,application/vnd.ms-excel));
%let RV=%sysfunc(appsrv_header(Content-disposition,attachment; filename="t1.xml"));

ods tagsets.ExcelXP file=_webout;
  proc report data=work.t1 nowd; run; quit;
ods tagsets.ExcelXP close;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 18:07:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Get-SAS-Stored-procedure-output-in-excel-automatically-while/m-p/327472#M5208</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2017-01-25T18:07:43Z</dc:date>
    </item>
  </channel>
</rss>

