<?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: export to CSV using macro in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527107#M5223</link>
    <description>What version of SAS are you using that you don't have SASHELP installed? Check your version with:&lt;BR /&gt;&lt;BR /&gt;proc product_status;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can replace my paths and data set names with your own paths and datasets then to run the demo, sashelp.class should be safe. &lt;BR /&gt;&lt;BR /&gt;If you're using WPS then obviously this won't work.</description>
    <pubDate>Mon, 14 Jan 2019 20:39:22 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-01-14T20:39:22Z</dc:date>
    <item>
      <title>export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527059#M5200</link>
      <description>&lt;P&gt;I would like to export to csv file using the SAS utility macro %DS2CSV Macro. i am not able to download this macro. Where may I find it? I am using Enterprise Guide.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 19:43:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527059#M5200</guid>
      <dc:creator>kfluegge</dc:creator>
      <dc:date>2019-01-14T19:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527063#M5202</link>
      <description>It's usually installed by default. I just tried and I can call it, and I haven't changed my base installation since it was updated a few weeks ago.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Jan 2019 19:49:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527063#M5202</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-14T19:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527070#M5207</link>
      <description>&lt;P&gt;It should be installed by default?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 19:57:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527070#M5207</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-14T19:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527074#M5209</link>
      <description>&lt;P&gt;I see it on Unix at&lt;/P&gt;
&lt;PRE&gt;.../sas9.4/SASFoundation/9.4/sasautos/ds2csv.sas&lt;/PRE&gt;
&lt;P&gt;And on Windows (PC) at&lt;/P&gt;
&lt;PRE&gt;...\SASHome\SASFoundation\9.4\core\sasmacro\ds2csv.sas
&lt;/PRE&gt;
&lt;P&gt;I think this macro was original generated for SAS/Intrnet so you might need to have that licensed to have it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that it is trivial to write a CSV file without the macro.&amp;nbsp; There are many posts on that topic in these forums.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 20:03:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527074#M5209</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-01-14T20:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527078#M5211</link>
      <description>&lt;PRE&gt;&lt;FONT size="4" color="#993366"&gt;&lt;STRONG&gt;/*Method 1*/&lt;/STRONG&gt;&lt;/FONT&gt;
proc export data=sashelp.retail outfile='/folders/myfolders/demo1.csv' dbms=csv replace;run;


&lt;STRONG&gt;&lt;FONT size="4" color="#993366"&gt;/*Method 2*/&lt;/FONT&gt;&lt;/STRONG&gt;
ods csvall file='/folders/myfolders/demo2.csv';

proc print data=sashelp.retail noobs ;
run;

ods csvall;

&lt;FONT size="4" color="#993366"&gt;&lt;STRONG&gt;/*Method 3*/&lt;/STRONG&gt;&lt;/FONT&gt;
%ds2csv (data=sashelp.retail, runmode=b,  csvfile=/folders/myfolders/retail.csv);
&lt;/PRE&gt;
&lt;P&gt;All three of these work out of the box for me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 20:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527078#M5211</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-14T20:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527103#M5221</link>
      <description>&lt;P&gt;When I use method 1, I receive the message saying "ERROR: Physical file does not exist."&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 20:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527103#M5221</guid>
      <dc:creator>kfluegge</dc:creator>
      <dc:date>2019-01-14T20:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527107#M5223</link>
      <description>What version of SAS are you using that you don't have SASHELP installed? Check your version with:&lt;BR /&gt;&lt;BR /&gt;proc product_status;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can replace my paths and data set names with your own paths and datasets then to run the demo, sashelp.class should be safe. &lt;BR /&gt;&lt;BR /&gt;If you're using WPS then obviously this won't work.</description>
      <pubDate>Mon, 14 Jan 2019 20:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527107#M5223</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-14T20:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527110#M5224</link>
      <description>&lt;P&gt;My product version is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Base SAS Software ...&lt;BR /&gt;Custom version information: 9.4_M4&lt;BR /&gt;Image version information: 9.04.01M4P110916&lt;BR /&gt;For SAS/STAT ...&lt;BR /&gt;Custom version information: 14.2&lt;BR /&gt;For SAS/GRAPH ...&lt;BR /&gt;Custom version information: 9.4_M4&lt;BR /&gt;For SAS Integration Technologies ...&lt;BR /&gt;Custom version information: 9.4_M4&lt;BR /&gt;For High Performance Suite ...&lt;BR /&gt;Custom version information: 2.2_M5&lt;BR /&gt;For SAS/ACCESS Interface to PC Files ...&lt;BR /&gt;Custom version information: 9.4_M4&lt;BR /&gt;For SAS/ACCESS Interface to ODBC ...&lt;BR /&gt;Custom version information: 9.4_M4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I replace your paths with my own and receive the message "ERROR: Physical file does not exist, c:\folders\myfolders\demo1.csv."&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 20:46:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527110#M5224</guid>
      <dc:creator>kfluegge</dc:creator>
      <dc:date>2019-01-14T20:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527111#M5225</link>
      <description>I suspect that path doesn't exist on your computer unless you created it. Please post the exact log and code you used.&lt;BR /&gt;&lt;BR /&gt;If you're using SAS EG, you may only be able to write to the server as well, if your system is locked down. &lt;BR /&gt;</description>
      <pubDate>Mon, 14 Jan 2019 20:48:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527111#M5225</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-14T20:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527116#M5228</link>
      <description>&lt;P&gt;The full code is below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%LET CONDITION=HF; 											
%LET YEAR=1216;												
%LET PATH1= \\naslocshare240\agencyshare\SPARCS Hospital Readmissions;      				
LIBNAME RAW "&amp;amp;PATH1"; 											

libname sp0717 odbc noprompt="SERVER=SQLIT06C\IT06C;DRIVER=SQL Server Native Client 11.0;
Trusted_Connection=YES;DATABASE=SPARCS_MHYEPI_201707" schema='dua1309iden'; 

libname sp0118 odbc noprompt="SERVER=SQLIT06C\IT06C;DRIVER=SQL Server Native Client 11.0;
Trusted_Connection=YES;DATABASE=SPARCS_MHYEPI_201801" schema='dua1309iden';

proc format;
value raceethf    1='Hispanic'
		  2='NH White'
		  3='NH Black'
		  4='NH Asian/Pacific Islander'
		  5='NH Other';
run;

*Read in data from 2012-2016;
data IP_&amp;amp;YEAR;
set 
sp0717.IPSPC12_0717
sp0118.IPSPC13_0118 
sp0118.IPSPC14_0118
sp0118.IPSPC15_0118
sp0118.IPSPC16_0118;

run;

proc export data=IP_&amp;amp;YEAR outfile='R:\SPARCS Hospital Readmissions\AAMC Deliverables\all\inpatient.csv' dbms=csv replace;run;&lt;/PRE&gt;&lt;P&gt;The log is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ERROR: Physical file does not exist, R:\SPARCS Hospital Readmissions\AAMC Deliverables\all\inpatient.csv.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 1 observations read from the data set WORK.IP_1216.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.04 seconds
      

0 records created in R:\SPARCS Hospital Readmissions\AAMC Deliverables\all\inpatient.csv from IP_1216.
  
  
NOTE: "R:\SPARCS Hospital Readmissions\AAMC Deliverables\all\inpatient.csv" file was successfully created.
NOTE: PROCEDURE EXPORT used (Total process time):
      real time           0.14 seconds
      cpu time            0.15 seconds&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Jan 2019 20:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527116#M5228</guid>
      <dc:creator>kfluegge</dc:creator>
      <dc:date>2019-01-14T20:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527142#M5233</link>
      <description>Yeah, you're running on a server so it can't write to a network drive or your hard drive. You'll have to export it to a server and then download the file or have a shared location set up, that both your server and desktop can access.</description>
      <pubDate>Mon, 14 Jan 2019 21:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527142#M5233</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-14T21:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527155#M5237</link>
      <description>&lt;P&gt;Why would you use an UNC for the LIBNAME statement but try to use a drive letter for that filename?&lt;/P&gt;
&lt;P&gt;Your SAS server probably does not have that drive mapped to that letter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are the both supposed to pointing to the same place?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET PATH1= \\naslocshare240\agencyshare\SPARCS Hospital Readmissions;      				
LIBNAME RAW "&amp;amp;PATH1"; 	
...
outfile="&amp;amp;path1\AAMC Deliverables\all\inpatient.csv"
...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Jan 2019 21:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527155#M5237</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-01-14T21:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527285#M5254</link>
      <description>&lt;P&gt;How do I export to a server?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 13:30:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527285#M5254</guid>
      <dc:creator>kfluegge</dc:creator>
      <dc:date>2019-01-15T13:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527291#M5255</link>
      <description>&lt;P&gt;yes, they are pointing to the same place.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 13:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527291#M5255</guid>
      <dc:creator>kfluegge</dc:creator>
      <dc:date>2019-01-15T13:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: export to CSV using macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527366#M5278</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120373"&gt;@kfluegge&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;yes, they are pointing to the same place.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So if the LIBNAME works then try using the same path as part of the filename you are trying to create instead of trying to use a drive letter that might not exist on the machine where SAS is running.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also check that you have WRITE access to that location.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 16:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/export-to-CSV-using-macro/m-p/527366#M5278</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-01-15T16:29:35Z</dc:date>
    </item>
  </channel>
</rss>

