<?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 Stored Process to export a CSV in SAS VA 7.3: how to export to local host? in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Stored-Process-to-export-a-CSV-in-SAS-VA-7-3-how-to-export-to/m-p/417035#M8801</link>
    <description>&lt;P&gt;Hello firends,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote successfully a stored process that from the lasr table behind the report export a list in a csv file that is written on the server.&lt;/P&gt;&lt;P&gt;Now I want to download this file in a folder on my pc or get the possibility to download it from the browser...&lt;/P&gt;&lt;P&gt;I thougth to create in javascript a link to the path of the csv file, but the _webout process the path in the middle server...&lt;/P&gt;&lt;P&gt;How could I do this?&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2017 13:05:32 GMT</pubDate>
    <dc:creator>AsSASsin</dc:creator>
    <dc:date>2017-11-29T13:05:32Z</dc:date>
    <item>
      <title>Stored Process to export a CSV in SAS VA 7.3: how to export to local host?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Stored-Process-to-export-a-CSV-in-SAS-VA-7-3-how-to-export-to/m-p/417035#M8801</link>
      <description>&lt;P&gt;Hello firends,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote successfully a stored process that from the lasr table behind the report export a list in a csv file that is written on the server.&lt;/P&gt;&lt;P&gt;Now I want to download this file in a folder on my pc or get the possibility to download it from the browser...&lt;/P&gt;&lt;P&gt;I thougth to create in javascript a link to the path of the csv file, but the _webout process the path in the middle server...&lt;/P&gt;&lt;P&gt;How could I do this?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 13:05:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Stored-Process-to-export-a-CSV-in-SAS-VA-7-3-how-to-export-to/m-p/417035#M8801</guid>
      <dc:creator>AsSASsin</dc:creator>
      <dc:date>2017-11-29T13:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Stored Process to export a CSV in SAS VA 7.3: how to export to local host?</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Stored-Process-to-export-a-CSV-in-SAS-VA-7-3-how-to-export-to/m-p/417254#M8810</link>
      <description>&lt;P&gt;To get your CSV as a 'file download' (rather than displayed in the browser)&amp;nbsp;you must firstly ensure you don't use the %stpbegin / end macros (as they will play with the output).&amp;nbsp; You must also refrain from sending anything else to the _webout fileref.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can now set the headers (so the browser knows the data received is a file download) and stream your CSV, as per the below.&amp;nbsp; There is no way to set the save location using SAS, the end user has to do that themselves (eg by changing the default 'downloads' folder or manually choosing via the browser dialog).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  rc=stpsrv_header('Content-type','text/plain');
  rc=stpsrv_header('Content-disposition',"attachment; filename=YOURCSVNAME.csv");
run;

data _null_;
  file _webout;
  infile "/yourcsvlocation/your.csv";
  input;
  put _infile_;
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 22:05:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Stored-Process-to-export-a-CSV-in-SAS-VA-7-3-how-to-export-to/m-p/417254#M8810</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2017-11-29T22:05:45Z</dc:date>
    </item>
  </channel>
</rss>

