<?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 write to .csv file with flipped order in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/write-to-csv-file-with-flipped-order/m-p/155541#M262848</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;I have a dataset with 2 observations. I want to write them to a .csv file with the second observation first and the first observation second. E.g. my data looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var1&amp;nbsp;&amp;nbsp; var2&amp;nbsp;&amp;nbsp; var3&amp;nbsp;&amp;nbsp; var4&lt;/P&gt;&lt;P&gt;b1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b4&lt;/P&gt;&lt;P&gt;a1&amp;nbsp;&amp;nbsp;&amp;nbsp; a2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want my .csv looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a1,a2,a3,a4&lt;/P&gt;&lt;P&gt;b1,b2,b3,b4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried 'put' statement with _ALL_ instead of listing the variable names explicitly because there are thousands of variables, it writes 'var1=xxxxx&amp;nbsp;&amp;nbsp; var2=xxxxx' which I don't like. I only want the values to be written in the .csv file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 May 2014 19:00:08 GMT</pubDate>
    <dc:creator>swimmer</dc:creator>
    <dc:date>2014-05-12T19:00:08Z</dc:date>
    <item>
      <title>write to .csv file with flipped order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/write-to-csv-file-with-flipped-order/m-p/155541#M262848</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;I have a dataset with 2 observations. I want to write them to a .csv file with the second observation first and the first observation second. E.g. my data looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var1&amp;nbsp;&amp;nbsp; var2&amp;nbsp;&amp;nbsp; var3&amp;nbsp;&amp;nbsp; var4&lt;/P&gt;&lt;P&gt;b1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b4&lt;/P&gt;&lt;P&gt;a1&amp;nbsp;&amp;nbsp;&amp;nbsp; a2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want my .csv looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a1,a2,a3,a4&lt;/P&gt;&lt;P&gt;b1,b2,b3,b4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried 'put' statement with _ALL_ instead of listing the variable names explicitly because there are thousands of variables, it writes 'var1=xxxxx&amp;nbsp;&amp;nbsp; var2=xxxxx' which I don't like. I only want the values to be written in the .csv file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 19:00:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/write-to-csv-file-with-flipped-order/m-p/155541#M262848</guid>
      <dc:creator>swimmer</dc:creator>
      <dc:date>2014-05-12T19:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: write to .csv file with flipped order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/write-to-csv-file-with-flipped-order/m-p/155542#M262849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would sort the data so that it is in the order you want and then try proc export.&lt;/P&gt;&lt;P&gt;If you want to reverse the order of the data set;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order= _n_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=want out=sorted(drop=order); by descenting order; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then export to csv.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 19:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/write-to-csv-file-with-flipped-order/m-p/155542#M262849</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-05-12T19:40:46Z</dc:date>
    </item>
  </channel>
</rss>

