<?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: SAS Export blank columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513993#M138566</link>
    <description>Thanks Tom!</description>
    <pubDate>Fri, 16 Nov 2018 17:37:29 GMT</pubDate>
    <dc:creator>PetePatel</dc:creator>
    <dc:date>2018-11-16T17:37:29Z</dc:date>
    <item>
      <title>SAS Export blank columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513942#M138547</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to export a large dataset ('test') from base SAS into a CSV file for modelling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It contains 20k rows and&amp;nbsp;5,000 columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I am using is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc export data=test outfile=&lt;BR /&gt;"C:\Users\pete\Desktop\test.csv"&lt;BR /&gt;dbms=csv replace;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first 1625 column names appear, however the rest are blank (although the values are fully populated).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I be adding an option to write all data to the CSV file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 16:05:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513942#M138547</guid>
      <dc:creator>PetePatel</dc:creator>
      <dc:date>2018-11-16T16:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Export blank columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513955#M138551</link>
      <description>&lt;P&gt;How do you verify that the CSV file has only 1625 columns? It sounds like the somewhat maximum amount of columns that an Excel spreadsheet can comprehend.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 16:20:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513955#M138551</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-11-16T16:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Export blank columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513958#M138553</link>
      <description>&lt;P&gt;I tested it for one row and checked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there another option to export from SAS dataset to CSV?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 16:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513958#M138553</guid>
      <dc:creator>PetePatel</dc:creator>
      <dc:date>2018-11-16T16:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Export blank columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513976#M138557</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/154786"&gt;@PetePatel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I tested it for one row and checked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there another option to export from SAS dataset to CSV?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please look closely at &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;'s question.&lt;/P&gt;
&lt;P&gt;Looking at CSV files with spreadsheets often hides much. For instance Excel, depending on version, has different numbers of columns it can display. If your data set has more variables than the spreadsheet software has available columns than it just plain &lt;STRONG&gt;cannot&lt;/STRONG&gt; display them even if present.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, HOW did you check? Did you open it an spreadsheet? then see above.&lt;/P&gt;
&lt;P&gt;Did you count the number of header items in the CSV?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 16:38:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513976#M138557</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-16T16:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Export blank columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513977#M138558</link>
      <description>&lt;P&gt;That is a lot of variables. Sounds like the list of names was just too long for PROC EXPORT to write to the file.&lt;/P&gt;
&lt;P&gt;Fortunately it is trivial to generate you own CSV file without using PROC EXPORT.&amp;nbsp; Plus it will probably run a little faster.&lt;/P&gt;
&lt;P&gt;First write the header row.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=test(obs=0) out=_names ;
  var _all_;
run;
data _null_;
  file "C:\Users\pete\Desktop\test.csv" dsd lrecl=1000000 ;
  set _names end=eof;
  put _name_ @ ;
  if eof then put;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then append the data:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  file "C:\Users\pete\Desktop\test.csv" dsd lrecl=1000000 MOD ;
  set test;
  put (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Nov 2018 16:44:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513977#M138558</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-11-16T16:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Export blank columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513979#M138559</link>
      <description>&lt;P&gt;I have found that if I open CSV files in a text editor like notepad then&amp;nbsp;I place the cursor on the last column&amp;nbsp;I get a better visual than Excel provides.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 16:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513979#M138559</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-11-16T16:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Export blank columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513993#M138566</link>
      <description>Thanks Tom!</description>
      <pubDate>Fri, 16 Nov 2018 17:37:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/513993#M138566</guid>
      <dc:creator>PetePatel</dc:creator>
      <dc:date>2018-11-16T17:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Export blank columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/514219#M138654</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know if there is a way to encode to UTF-8 within this code? This is the format I require for a program I am using to import the data into.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 10:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Export-blank-columns/m-p/514219#M138654</guid>
      <dc:creator>PetePatel</dc:creator>
      <dc:date>2018-11-18T10:34:57Z</dc:date>
    </item>
  </channel>
</rss>

