<?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 CSV file with no columns names but header in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/CSV-file-with-no-columns-names-but-header/m-p/163579#M42410</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to export a SAS table in CSV format (separator is ";") but I need to obtain a file where the 1st line will contain some information such as date, version,... and starting row 2 the data itself without the columns names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The closest I could get is using the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA survey; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; INPUT id sex $ age inc r1 r2 r3 ; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; DATALINES; &lt;BR /&gt; 1&amp;nbsp; F&amp;nbsp; 35 17&amp;nbsp; 7 2 2 &lt;BR /&gt;17&amp;nbsp; M&amp;nbsp; 50 14&amp;nbsp; 5 5 3 &lt;BR /&gt;33&amp;nbsp; F&amp;nbsp; 45&amp;nbsp; 6&amp;nbsp; 7 2 7 &lt;/P&gt;&lt;P&gt;; &lt;BR /&gt;RUN; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods csvall file=C:\myfile.csv' options(delimiter=';');;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=survey noobs label;&lt;BR /&gt;title "29/09/2014;version #3";&lt;BR /&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods csvall close;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I end up with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;29/09/2014;version #3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"id";"sex";"age";"inc";"r1";"r2";"r3"&lt;BR /&gt;1;"F";35;17;7;2;2&lt;BR /&gt;17;"M";50;14;5;5;3&lt;BR /&gt;33;"F";45;6;7;2;7&lt;BR /&gt;49;"M";24;14;7;5;7&lt;BR /&gt;65;"F";52;9;4;7;7&lt;BR /&gt;81;"M";44;11;7;7;7&lt;BR /&gt;2;"F";34;17;6;5;3&lt;BR /&gt;18;"M";40;14;7;5;2&lt;BR /&gt;34;"F";47;6;6;5;6&lt;BR /&gt;50;"M";35;17;5;7;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is that I have a blank line and that columns names are still there. I wish to get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;29/09/2014;version #3&lt;/P&gt;&lt;P&gt;1;"F";35;17;7;2;2&lt;BR /&gt;17;"M";50;14;5;5;3&lt;BR /&gt;33;"F";45;6;7;2;7&lt;BR /&gt;49;"M";24;14;7;5;7&lt;BR /&gt;65;"F";52;9;4;7;7&lt;BR /&gt;81;"M";44;11;7;7;7&lt;BR /&gt;2;"F";34;17;6;5;3&lt;BR /&gt;18;"M";40;14;7;5;2&lt;BR /&gt;34;"F";47;6;6;5;6&lt;BR /&gt;50;"M";35;17;5;7;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help very much apreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nicolas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Sep 2014 08:39:17 GMT</pubDate>
    <dc:creator>ntro</dc:creator>
    <dc:date>2014-09-29T08:39:17Z</dc:date>
    <item>
      <title>CSV file with no columns names but header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/CSV-file-with-no-columns-names-but-header/m-p/163579#M42410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to export a SAS table in CSV format (separator is ";") but I need to obtain a file where the 1st line will contain some information such as date, version,... and starting row 2 the data itself without the columns names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The closest I could get is using the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA survey; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; INPUT id sex $ age inc r1 r2 r3 ; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; DATALINES; &lt;BR /&gt; 1&amp;nbsp; F&amp;nbsp; 35 17&amp;nbsp; 7 2 2 &lt;BR /&gt;17&amp;nbsp; M&amp;nbsp; 50 14&amp;nbsp; 5 5 3 &lt;BR /&gt;33&amp;nbsp; F&amp;nbsp; 45&amp;nbsp; 6&amp;nbsp; 7 2 7 &lt;/P&gt;&lt;P&gt;; &lt;BR /&gt;RUN; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods csvall file=C:\myfile.csv' options(delimiter=';');;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=survey noobs label;&lt;BR /&gt;title "29/09/2014;version #3";&lt;BR /&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods csvall close;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I end up with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;29/09/2014;version #3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"id";"sex";"age";"inc";"r1";"r2";"r3"&lt;BR /&gt;1;"F";35;17;7;2;2&lt;BR /&gt;17;"M";50;14;5;5;3&lt;BR /&gt;33;"F";45;6;7;2;7&lt;BR /&gt;49;"M";24;14;7;5;7&lt;BR /&gt;65;"F";52;9;4;7;7&lt;BR /&gt;81;"M";44;11;7;7;7&lt;BR /&gt;2;"F";34;17;6;5;3&lt;BR /&gt;18;"M";40;14;7;5;2&lt;BR /&gt;34;"F";47;6;6;5;6&lt;BR /&gt;50;"M";35;17;5;7;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is that I have a blank line and that columns names are still there. I wish to get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;29/09/2014;version #3&lt;/P&gt;&lt;P&gt;1;"F";35;17;7;2;2&lt;BR /&gt;17;"M";50;14;5;5;3&lt;BR /&gt;33;"F";45;6;7;2;7&lt;BR /&gt;49;"M";24;14;7;5;7&lt;BR /&gt;65;"F";52;9;4;7;7&lt;BR /&gt;81;"M";44;11;7;7;7&lt;BR /&gt;2;"F";34;17;6;5;3&lt;BR /&gt;18;"M";40;14;7;5;2&lt;BR /&gt;34;"F";47;6;6;5;6&lt;BR /&gt;50;"M";35;17;5;7;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help very much apreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nicolas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 08:39:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/CSV-file-with-no-columns-names-but-header/m-p/163579#M42410</guid>
      <dc:creator>ntro</dc:creator>
      <dc:date>2014-09-29T08:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: CSV file with no columns names but header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/CSV-file-with-no-columns-names-but-header/m-p/163580#M42411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, first off you have typos in that code.&amp;nbsp; Secondly, if you are talking about a file which does not conform to the format of:&lt;/P&gt;&lt;P&gt;&amp;lt;HEADER&amp;gt;,&amp;lt;HEADER&amp;gt;... (optional)&lt;/P&gt;&lt;P&gt;&amp;lt;DATA&amp;gt;,&amp;lt;DATA&amp;gt;...&lt;/P&gt;&lt;P&gt;Then its not a delimited file, but a custom format of your own.&amp;nbsp; You also don't want to "print" a file like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if you really want a file that looks like that (not my recommendation) do:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set survey;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file "s:\temp\rob\myfile.csv";&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _n_=1 then put "29/09/2014;version #3";&lt;/P&gt;&lt;P&gt;&amp;nbsp; else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp=strip(put(id,best.))||';"'||strip(sex)||'";'||strip(put(age,best.))||';'||strip(put(inc,best.))||';'||strip(put(r1,best.))||';'||strip(put(r2,best.))||';'||strip(put(r3,best.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put tmp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 09:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/CSV-file-with-no-columns-names-but-header/m-p/163580#M42411</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-29T09:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: CSV file with no columns names but header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/CSV-file-with-no-columns-names-but-header/m-p/163581#M42412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you RW9. Sorry for the typo. I modified the path when editing the code here and missed the opening quote.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the format needed to load the data back into a custom datawarehouse so not my choice!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your solution is working and I'm fine with it but is there any other possibility that concatening the variables as I have many.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 09:31:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/CSV-file-with-no-columns-names-but-header/m-p/163581#M42412</guid>
      <dc:creator>ntro</dc:creator>
      <dc:date>2014-09-29T09:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: CSV file with no columns names but header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/CSV-file-with-no-columns-names-but-header/m-p/163582#M42413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, sure.&amp;nbsp; Check out this post:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="active_link" href="https://communities.sas.com/message/184971#184971"&gt;https://communities.sas.com/message/184971#184971&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at Tom's suggestion second to last post, select the variables/formats into a macro from the sas variables tables.&amp;nbsp; You can also put dlm=";" on your file statement to get delimiters as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 09:45:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/CSV-file-with-no-columns-names-but-header/m-p/163582#M42413</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-29T09:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: CSV file with no columns names but header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/CSV-file-with-no-columns-names-but-header/m-p/163583#M42414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 10:06:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/CSV-file-with-no-columns-names-but-header/m-p/163583#M42414</guid>
      <dc:creator>ntro</dc:creator>
      <dc:date>2014-09-29T10:06:55Z</dc:date>
    </item>
  </channel>
</rss>

