<?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: How to export large number of variables to csv without wrapping the lines in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378953#M91140</link>
    <description>&lt;P&gt;Your code looks good or try&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3" color="#0000ff" face="Courier New"&gt;file&lt;/FONT&gt; &lt;FONT size="3" color="#800080" face="Courier New"&gt;"c:\work\out1.csv"&lt;/FONT&gt; &lt;FONT size="3" color="#0000ff" face="Courier New"&gt;dsd&lt;/FONT&gt; &lt;FONT size="3" color="#0000ff" face="Courier New"&gt;dlm&lt;/FONT&gt;&lt;FONT size="3" face="Courier New"&gt;=&lt;/FONT&gt;&lt;FONT size="3" color="#800080" face="Courier New"&gt;'09'x&lt;/FONT&gt; recfm=n ;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jul 2017 12:45:51 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-07-25T12:45:51Z</dc:date>
    <item>
      <title>How to export large number of variables to csv without wrapping the lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378939#M91133</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;I need to export SAS&amp;nbsp;dataset that exceeds linesize 32767&amp;nbsp;to csv.&lt;/P&gt;
&lt;P&gt;How can I do it?&lt;/P&gt;
&lt;P&gt;I use SAS 9.4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code is below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks,&lt;/P&gt;
&lt;P&gt;Oleg&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;array&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; MY_VARIABLE_NAME_[&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;] $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;100&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;retain&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; MY_VARIABLE_NAME_ &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;transpose&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=test (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;obs&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=names;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; _all_;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; names ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;file&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"c:\work\out1.csv"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dsd&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dlm&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'09'x&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;lrecl&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;500000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; _name_ @;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;file&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"c:\work\out1.csv"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dsd&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dlm&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'09'x&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;lrecl&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;500000&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;MOD&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_all_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) (:) ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 12:17:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378939#M91133</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2017-07-25T12:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to export large number of variables to csv without wrapping the lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378950#M91139</link>
      <description>&lt;P&gt;And where is your problem? Your code worked well when I tested it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the "code" subwindows for posting code (6th and 7th button right on top of the main posting window) to avoid reformatting of some character sequences into smileys and artificial linefeeds in the code.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 12:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378950#M91139</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-25T12:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to export large number of variables to csv without wrapping the lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378953#M91140</link>
      <description>&lt;P&gt;Your code looks good or try&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3" color="#0000ff" face="Courier New"&gt;file&lt;/FONT&gt; &lt;FONT size="3" color="#800080" face="Courier New"&gt;"c:\work\out1.csv"&lt;/FONT&gt; &lt;FONT size="3" color="#0000ff" face="Courier New"&gt;dsd&lt;/FONT&gt; &lt;FONT size="3" color="#0000ff" face="Courier New"&gt;dlm&lt;/FONT&gt;&lt;FONT size="3" face="Courier New"&gt;=&lt;/FONT&gt;&lt;FONT size="3" color="#800080" face="Courier New"&gt;'09'x&lt;/FONT&gt; recfm=n ;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 12:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378953#M91140</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-07-25T12:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to export large number of variables to csv without wrapping the lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378954#M91141</link>
      <description>&lt;P&gt;When I view the output csv in a file manager or try open it in excel the recordes are wrapped when them exceed 32767 characters.&lt;/P&gt;
&lt;P&gt;That is the problem.&lt;/P&gt;
&lt;P&gt;I do not know how to avoid it.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 12:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378954#M91141</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2017-07-25T12:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to export large number of variables to csv without wrapping the lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378961#M91145</link>
      <description>&lt;P&gt;recfm=n does not solves the problem.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 12:56:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378961#M91145</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2017-07-25T12:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to export large number of variables to csv without wrapping the lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378964#M91148</link>
      <description>&lt;P&gt;Why are you specifying:&lt;/P&gt;
&lt;PRE&gt;data _null_;
set names ;
file "c:\work\out1.csv" dsd dlm='09'x lrecl=500000 ;
&lt;/PRE&gt;
&lt;P&gt;dlm='09'x? &amp;nbsp;That is a tab character. &amp;nbsp;CSV means&amp;nbsp;&lt;STRONG&gt;Comma&lt;/STRONG&gt; Separated Variable file. &amp;nbsp;This is why you have issues, Excel will open a CSV and parse it, however it does not recognise a tab delimited file. &amp;nbsp;Also, text editors will wrap lines and such like as part of their options. &amp;nbsp;So step one, be clear about what you want the output to llok like, if its CSV, use a Comma between data items, if its tab then don't call it CSV, and when opening in Excel you will need to do text to columns and use tab as delimiter.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 13:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378964#M91148</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-25T13:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to export large number of variables to csv without wrapping the lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378965#M91149</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18026"&gt;@Oleg_L&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;When I view the output csv in a file manager or try open it in excel the recordes are wrapped when them exceed 32767 characters.&lt;/P&gt;
&lt;P&gt;That is the problem.&lt;/P&gt;
&lt;P&gt;I do not know how to avoid it.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's cleary the problem of the file manager or Excel. I just checked my results file with notepad++, and it has 2 lines of length 101000.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 13:02:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378965#M91149</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-25T13:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to export large number of variables to csv without wrapping the lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378987#M91160</link>
      <description>&lt;P&gt;Thanks a lot. You are right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oleg&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 13:27:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378987#M91160</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2017-07-25T13:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to export large number of variables to csv without wrapping the lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378988#M91161</link>
      <description>That's right. &lt;BR /&gt;Thank you.&lt;BR /&gt;&lt;BR /&gt;Oleg</description>
      <pubDate>Tue, 25 Jul 2017 13:28:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378988#M91161</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2017-07-25T13:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to export large number of variables to csv without wrapping the lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378997#M91169</link>
      <description>&lt;P&gt;Just for fun:&lt;/P&gt;
&lt;P&gt;I changed the delimiter to a comma, and opened the resulting file with LibreOffice and Excel.&lt;/P&gt;
&lt;P&gt;Excel wrapped the lines, while LibreOffice opened the file as is without any problems (last columns 'ALK' and 'ALL', so all columns were imported).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Draw your own conclusions.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 13:41:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/378997#M91169</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-25T13:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to export large number of variables to csv without wrapping the lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/379076#M91202</link>
      <description>I changed file extension to txt and opened the result with Excel through text import wizard. Excel opened the file fine this way, while there was a problem to open via text to columns.</description>
      <pubDate>Tue, 25 Jul 2017 15:19:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-export-large-number-of-variables-to-csv-without-wrapping/m-p/379076#M91202</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2017-07-25T15:19:15Z</dc:date>
    </item>
  </channel>
</rss>

