<?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: CSV export file in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545727#M8069</link>
    <description>&lt;P&gt;Please try the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export data=prog269_ctrl2 dbms=tab label outfile="1.txt" replace;
putnames=yes;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 25 Mar 2019 10:50:37 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2019-03-25T10:50:37Z</dc:date>
    <item>
      <title>CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545724#M8066</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am exporting one csv file with text extension.&amp;nbsp;&lt;/P&gt;&lt;P&gt;exmple:&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc export data=prog dbms=csv label outfile="1.txt" replace;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but, I am getting variables and values with double quotes. Can we remove these double quotes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also tried one way&lt;/P&gt;&lt;P&gt;filename file_1 "/location/12.txt";&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;set program;&lt;/P&gt;&lt;P&gt;file file_1 dlm=',';&lt;BR /&gt;put 'var1,var2,var3'&lt;BR /&gt;#2 (_all_)(:);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but in this case, when i am opening the file, it is appearing in one line in notepad. i want the file top be show variables in first line and values in second line. can you please provide some guidance?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also used&amp;nbsp; ods csv file="//location/1.txt";&lt;BR /&gt;ods csv options(sheet_name="tes" flow='tables");&lt;BR /&gt;proc print data=programnoobs;&lt;BR /&gt;run;&lt;BR /&gt;ods csv close;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But again, variable and values are appearing with double quotation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the output in below format. first line variable and second line values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;var1,var2,var3&lt;/P&gt;&lt;P&gt;111,aaa,vvv&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 11:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545724#M8066</guid>
      <dc:creator>deepakkailay</dc:creator>
      <dc:date>2019-03-25T11:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545727#M8069</link>
      <description>&lt;P&gt;Please try the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export data=prog269_ctrl2 dbms=tab label outfile="1.txt" replace;
putnames=yes;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Mar 2019 10:50:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545727#M8069</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-03-25T10:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545734#M8073</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;thanks for your reply. It will not resolve the double quotes. I need the file to be have comma separated value and variables&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 10:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545734#M8073</guid>
      <dc:creator>deepakkailay</dc:creator>
      <dc:date>2019-03-25T10:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545736#M8074</link>
      <description>&lt;P&gt;I need the output in this format first line variables and second line values. example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var1,var2,var3&lt;/P&gt;&lt;P&gt;111,aaa,vvv&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 10:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545736#M8074</guid>
      <dc:creator>deepakkailay</dc:creator>
      <dc:date>2019-03-25T10:59:52Z</dc:date>
    </item>
    <item>
      <title>put statement is writing to same line</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545739#M8080</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;i have used below code:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;filename file_1 "location/1.txt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;set prior_ds;&lt;/P&gt;&lt;P&gt;file file_1 dlm=',';&lt;BR /&gt;&lt;BR /&gt;put 'Source,val1,val2'&lt;BR /&gt;#2 (_all_)(:);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it is writing the variable name i.e source,val1,val2 and the values to the same line .&lt;/P&gt;&lt;P&gt;can you please suggest how i can put values to second line.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 11:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545739#M8080</guid>
      <dc:creator>deepakkailay</dc:creator>
      <dc:date>2019-03-25T11:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545742#M8075</link>
      <description>&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;export&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;prog269_ctrl2 dbms&lt;SPAN class="token operator"&gt;=dlm&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;label&lt;/SPAN&gt; outfile&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"1.txt"&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;replace&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;BR /&gt;delimiter=',';&lt;/SPAN&gt;
putnames&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;yes&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can try the delimiter as above&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 11:08:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545742#M8075</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-03-25T11:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545743#M8076</link>
      <description>&lt;P&gt;I want the variables to be shown as label values. but it is showing the variables labels in double quotes. how can i remove it?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 11:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545743#M8076</guid>
      <dc:creator>deepakkailay</dc:creator>
      <dc:date>2019-03-25T11:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545744#M8077</link>
      <description>&lt;P&gt;We need to mention the putnames=no;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export data=prog269_ctrl2 dbms=dlm label outfile="1.txt" replace;delimiter=',';
putnames=no;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Mar 2019 11:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545744#M8077</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-03-25T11:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545746#M8078</link>
      <description>&lt;P&gt;i am getting this message after using putname=no;&lt;/P&gt;&lt;P&gt;WARNING: The LABEL option will be ignored when PUTNAMES=NO.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also, it is creating file without variable names but i need the variable names.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 11:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545746#M8078</guid>
      <dc:creator>deepakkailay</dc:creator>
      <dc:date>2019-03-25T11:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545758#M8079</link>
      <description>&lt;P&gt;This should work&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;export&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;prog269_ctrl2 dbms&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;dlm outfile&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"1.txt"&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;replace&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;delimiter&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;','&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Mar 2019 11:49:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545758#M8079</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-03-25T11:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: put statement is writing to same line</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545759#M8081</link>
      <description>&lt;P&gt;Use the code window - its the {i} above post area to post code:&lt;/P&gt;
&lt;PRE&gt;filename file_1 "location/1.txt;

data _null_;  
  set prior_ds;
  file file_1 dlm=',';
  if _n_=1 then put 'Source,val1,val2';
  put (_all_);
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Mar 2019 11:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545759#M8081</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-25T11:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545762#M8082</link>
      <description>&lt;P&gt;A CSV file will have double quotes in if the data contains the delimiter, consider:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Somevar,Somethingelse,A line with a comma, in,something else&lt;/PRE&gt;
&lt;P&gt;If that is read in the "A line with a comma, in" actually looks like two variables as the comma delimiter appears in the string.&amp;nbsp; To counteract this, SAS (and all other implementations such as Excel) will quote that string to look:&lt;/P&gt;
&lt;PRE&gt;Somevar,Somethingelse,"A line with a comma, in",something else&lt;/PRE&gt;
&lt;P&gt;So it is clear that the comma there is part of a text string not a delimiter.&amp;nbsp; This is standard behaviour, and if your data contains the delimiter, then that should be how it is presented.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 11:56:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545762#M8082</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-25T11:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: put statement is writing to same line</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545764#M8084</link>
      <description>&lt;P&gt;put (_all_) is erroring out. If i am using _all_ then it is giving results as var1=111 .&lt;/P&gt;&lt;P&gt;But again, the value and variables are showing in the same line in notepad.&lt;/P&gt;&lt;P&gt;but I need the values and variables in separate lines.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 12:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545764#M8084</guid>
      <dc:creator>deepakkailay</dc:creator>
      <dc:date>2019-03-25T12:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545765#M8085</link>
      <description>&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i need the output in this way:&lt;/P&gt;&lt;P&gt;first line variable list and second line value with comma separated. Is there a way to get this output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;var1,var2,var3&lt;/P&gt;&lt;P&gt;111,aaa,vvv&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 12:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545765#M8085</guid>
      <dc:creator>deepakkailay</dc:creator>
      <dc:date>2019-03-25T12:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545766#M8086</link>
      <description>&lt;P&gt;Please check the below example , the same code is generating the expected output.&lt;/P&gt;
&lt;P&gt;Could you please check how your data is different from sashelp.class&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 dbms=dlm  outfile="1.txt" replace;
delimiter=',';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Mar 2019 12:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545766#M8086</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-03-25T12:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545768#M8088</link>
      <description>&lt;P&gt;Yes, simply:&lt;/P&gt;
&lt;PRE&gt;filename file_1 "&amp;amp;_sasws_./1.txt";

data _null_;  
  set sashelp.class;
  file file_1 dlm=',';
  if _n_=1 then put 'name,sex,age,height,weight';
  put name sex age height weight;
run;

filename file_1 clear;&lt;/PRE&gt;
&lt;P&gt;Note I use a defaut dataset here, however it will work fine with yours, just update it, and do bear in mind that your code presented had errors - filename missing quote for instance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should work fine, though be aware that if your data contains the delimiter it will be quoted - this is a must, otherwise the datafile will be wrong and not usable as previously mentioned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 12:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545768#M8088</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-25T12:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545792#M8093</link>
      <description>&lt;P&gt;I need to use the label option with proc export. But if i use label option then it is showing variables in double quotes.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 13:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545792#M8093</guid>
      <dc:creator>deepakkailay</dc:creator>
      <dc:date>2019-03-25T13:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: put statement is writing to same line</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545805#M8094</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/232784"&gt;@deepakkailay&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;put (_all_) is erroring out. If i am using _all_ then it is giving results as var1=111 .&lt;/P&gt;
&lt;P&gt;But again, the value and variables are showing in the same line in notepad.&lt;/P&gt;
&lt;P&gt;but I need the values and variables in separate lines.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;DO NOT use notepad for the display of such datafiles. Windows notepad can't handle non-Windows text files properly.&lt;/P&gt;
&lt;P&gt;Use notepad++ instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UNIX uses a single LF character for line breaks, while notepad expects the Windows-typical CRLF combo.&lt;/P&gt;
&lt;P&gt;Text files from SAS UE will be in UNIX format, unless you specify a &lt;FONT face="courier new,courier"&gt;termstr=CRLF&lt;/FONT&gt; option in the &lt;FONT face="courier new,courier"&gt;file&lt;/FONT&gt; statement.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 13:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545805#M8094</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-03-25T13:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545809#M8095</link>
      <description>&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I am opening the file in notepad++ or in worddoc, then it is opening in two lines.&lt;/P&gt;&lt;P&gt;But If I am opening in notepad then it is showing in one line. Why is it so?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 13:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545809#M8095</guid>
      <dc:creator>deepakkailay</dc:creator>
      <dc:date>2019-03-25T13:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: CSV export file</title>
      <link>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545815#M8098</link>
      <description>&lt;P&gt;That is a bug in PROC EXPORT's internal code.&amp;nbsp; You cannot change how it works.&lt;/P&gt;
&lt;P&gt;Fortunately to generate a CSV file you don't need to use PROC EXPORT. You can do it with a simple data step.&lt;/P&gt;
&lt;P&gt;To just write the data without a header row use something like this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename csv 'myfile.csv' termstr=crlf;
data _null_;
  set sashelp.class ;
  file csv dsd ;
  put (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is method that uses PROC TRANSPOSE and an extra data step to write the header row.&amp;nbsp; Make sure to use the MOD option on the FILE statement when appending the data rows.&amp;nbsp; Note that if the dataset does not have labels then the _LABEL_ variable will not be generated by PROC TRANSPOSE.&amp;nbsp; Also if the variable does not have a label then the _LABEL_ variable will be empty.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename csv 'myfile.csv' termstr=crlf;
proc transpose data=sashelp.class(obs=0) out=names;
  var _all_;
run;
data _null_;
  file csv dsd;
  length _name_ $32 _label_ $256;
  set names end=eof;
  _label_=coalescec(_label_,_name_);
  put _label_ @;
  if eof then put;
run;
data _null_;
  file csv dsd mod;
  set sashelp.class ;
  put (_all_) (+0);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also note that you could just post-process the file that PROC EXPORT generate and let SAS remove any unneeded quotes. (Quotes needed to make sure lines can be parsed will be re-generated.)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename csv temp;
proc export data=sashelp.class dbms=csv
  outfile=csv replace
  label
;
run;
data _null_;
  infile csv obs=2;
  input ;
  put _infile_;
run;
filename newcsv temp;
data _null_;
  infile csv dsd truncover length=len column=col ;
  file newcsv dsd ;
  do until(col&amp;gt;len);
    input val :$32767. @;
    put val @;
  end;
  put;
run;
data _null_;
  infile newcsv obs=2;
  input ;
  put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Generated by LABEL option in PROC EXPORT:

"Name","Sex","Age","Height","Weight"
Alfred,M,14,69,112.5

Result of post-processing step:

Name,Sex,Age,Height,Weight
Alfred,M,14,69,112.5

&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 14:38:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/CSV-export-file/m-p/545815#M8098</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-25T14:38:33Z</dc:date>
    </item>
  </channel>
</rss>

