<?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 HOW TO EXPORT CSV FILE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716188#M221294</link>
    <description>&lt;P&gt;Hello eveyone,&lt;/P&gt;&lt;P&gt;I am learning sas and I have seen to export the data into csv format using "Proc export" and "ODS CSV OR ODS CSVALL" code in the sas. But when I want to have to perfect format like below image. In the below image you can find that what I got&amp;nbsp; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="This is what I get" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54243iF42397DAE170E6A6/image-size/large?v=v2&amp;amp;px=999" role="button" title="FILE_CSV.PNG" alt="This is what I get" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;This is what I get&lt;/span&gt;&lt;/span&gt;Fig 1.I don't want this type of CSV file&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="But I want the CSV file in this format" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54244i47966EBB87DE5E65/image-size/large?v=v2&amp;amp;px=999" role="button" title="CSV_FILE.PNG" alt="But I want the CSV file in this format" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;But I want the CSV file in this format&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Fig2. I want this type of CSV file format.&lt;/P&gt;&lt;P&gt;So instead of Fig1 I want fig2 type of CSV format.&lt;/P&gt;&lt;P&gt;Any suggestion would be commendable.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Feb 2021 19:20:17 GMT</pubDate>
    <dc:creator>shailaja3</dc:creator>
    <dc:date>2021-02-02T19:20:17Z</dc:date>
    <item>
      <title>HOW TO EXPORT CSV FILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716188#M221294</link>
      <description>&lt;P&gt;Hello eveyone,&lt;/P&gt;&lt;P&gt;I am learning sas and I have seen to export the data into csv format using "Proc export" and "ODS CSV OR ODS CSVALL" code in the sas. But when I want to have to perfect format like below image. In the below image you can find that what I got&amp;nbsp; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="This is what I get" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54243iF42397DAE170E6A6/image-size/large?v=v2&amp;amp;px=999" role="button" title="FILE_CSV.PNG" alt="This is what I get" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;This is what I get&lt;/span&gt;&lt;/span&gt;Fig 1.I don't want this type of CSV file&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="But I want the CSV file in this format" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54244i47966EBB87DE5E65/image-size/large?v=v2&amp;amp;px=999" role="button" title="CSV_FILE.PNG" alt="But I want the CSV file in this format" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;But I want the CSV file in this format&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Fig2. I want this type of CSV file format.&lt;/P&gt;&lt;P&gt;So instead of Fig1 I want fig2 type of CSV format.&lt;/P&gt;&lt;P&gt;Any suggestion would be commendable.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 19:20:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716188#M221294</guid>
      <dc:creator>shailaja3</dc:creator>
      <dc:date>2021-02-02T19:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO EXPORT CSV FILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716198#M221296</link>
      <description>&lt;P&gt;You have posted two photographs of some spreadsheet application.&lt;/P&gt;
&lt;P&gt;A CSV file is a TEXT file. Please post examples of the TEXT file you generated and explain how you need it to be different.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please copy and paste the first few lines of text from the CSV file into the box that opens when you click on the &amp;lt; / &amp;gt; icon in the forum editor so that its exact formatting will be preserved.&amp;nbsp; Do not post photographs or screen grabs.&amp;nbsp; Open the CSV file with a text editor or just read it with a SAS data step like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile 'myfile.csv' obs=5 ;
  input;
  put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And copy the text from the SAS log.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 20:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716198#M221296</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-02T20:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO EXPORT CSV FILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716208#M221301</link>
      <description>Okay, Could you tell me where to mention the sas table to be converted as exact csv file?&lt;BR /&gt;I see infile is the path where we save the csv file then how do where do we take the sas table to be converted?&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Feb 2021 20:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716208#M221301</guid>
      <dc:creator>shailaja3</dc:creator>
      <dc:date>2021-02-02T20:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO EXPORT CSV FILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716221#M221308</link>
      <description>&lt;P&gt;What CODE are you running?&amp;nbsp; PROC EXPORT uses the DATA= option to tell it which dataset you want to export.&lt;/P&gt;
&lt;P&gt;ODS CSV just directs any output, so just run PROC PRINT to print the data you want. PROC PRINT also has a DATA= option.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 21:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716221#M221308</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-02T21:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO EXPORT CSV FILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716222#M221309</link>
      <description>&lt;P&gt;The different methods have different best use cases.&lt;/P&gt;
&lt;P&gt;ODS allows you to pipe different outputs to different files/sheets, add styles, graphs and formatting all within the same document (RTF, Word, PowerPoint).&lt;/P&gt;
&lt;P&gt;Exports (PROC EXPORT) are just data dumps and it seems you want a data dump so ODS isn't your best choice in that case.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So use PROC EXPORT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export data=sashelp.class outfile='/folders/myfolders/demo.csv' dbms=csv replace;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Change the path and data set as necessary.&amp;nbsp;&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;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/360246"&gt;@shailaja3&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Okay, Could you tell me where to mention the sas table to be converted as exact csv file?&lt;BR /&gt;I see infile is the path where we save the csv file then how do where do we take the sas table to be converted?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 21:06:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716222#M221309</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-02-02T21:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO EXPORT CSV FILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716229#M221313</link>
      <description>&lt;P&gt;This is because the "c" in csv stands for "comma" (which &lt;EM&gt;is&lt;/EM&gt; the standard), and SAS writes that to the file, while Excel thinks it only means "character", and uses a semicolon. By manually importing into Excel, and specifying the comma as separator, you will get it right.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2021 21:14:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-EXPORT-CSV-FILE/m-p/716229#M221313</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-02T21:14:48Z</dc:date>
    </item>
  </channel>
</rss>

