<?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 Exporting a large CSV cuts off variable names in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Exporting-a-large-CSV-cuts-off-variable-names/m-p/887945#M350815</link>
    <description>&lt;P&gt;When I try to export a dataset with 1900 variables as a CSV, the output only contains a certain number of variable names and then the rest are just blanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this code instead of proc export:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;proc transpose data=final(obs=0) out=names ; run;&lt;BR /&gt;data _null_;&lt;BR /&gt;file 'myfile.csv' dsd ;&lt;BR /&gt;set names end=eof;&lt;BR /&gt;put _name_ @;&lt;BR /&gt;if eof then put;&lt;BR /&gt;run;&lt;BR /&gt;data _null_;&lt;BR /&gt;set final ;&lt;BR /&gt;file 'myfile.csv' dsd mod ;&lt;BR /&gt;put (_all_) (+0);&lt;BR /&gt;run;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But it STILL cut off the variable names. How can I fix this?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Aug 2023 20:07:51 GMT</pubDate>
    <dc:creator>afrerichs</dc:creator>
    <dc:date>2023-08-04T20:07:51Z</dc:date>
    <item>
      <title>Exporting a large CSV cuts off variable names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-a-large-CSV-cuts-off-variable-names/m-p/887945#M350815</link>
      <description>&lt;P&gt;When I try to export a dataset with 1900 variables as a CSV, the output only contains a certain number of variable names and then the rest are just blanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this code instead of proc export:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;proc transpose data=final(obs=0) out=names ; run;&lt;BR /&gt;data _null_;&lt;BR /&gt;file 'myfile.csv' dsd ;&lt;BR /&gt;set names end=eof;&lt;BR /&gt;put _name_ @;&lt;BR /&gt;if eof then put;&lt;BR /&gt;run;&lt;BR /&gt;data _null_;&lt;BR /&gt;set final ;&lt;BR /&gt;file 'myfile.csv' dsd mod ;&lt;BR /&gt;put (_all_) (+0);&lt;BR /&gt;run;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But it STILL cut off the variable names. How can I fix this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 20:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-a-large-CSV-cuts-off-variable-names/m-p/887945#M350815</guid>
      <dc:creator>afrerichs</dc:creator>
      <dc:date>2023-08-04T20:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting a large CSV cuts off variable names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-a-large-CSV-cuts-off-variable-names/m-p/887948#M350816</link>
      <description>&lt;P&gt;Tell SAS to use a longer line length.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;file 'myfile.csv' dsd lrecl=1000000;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You must have some really strange variable names.&amp;nbsp;&amp;nbsp;The default record length is 32,767 which for 1,900 means your average variable name must be over 16 characters long!&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1192  data _null_;
1193    x=(32767-1899)/1900;
1194    put x=;
1195  run;

x=16.246315789
&lt;/PRE&gt;
&lt;P&gt;Good luck trying to write any code to use such a dataset.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 20:20:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-a-large-CSV-cuts-off-variable-names/m-p/887948#M350816</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-04T20:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting a large CSV cuts off variable names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-a-large-CSV-cuts-off-variable-names/m-p/887950#M350817</link>
      <description>&lt;P&gt;Thank you! I was able to get it to work. Yes, unfortunately this dataset has crazy variable names.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My next question in case you know the answer, I want the output csv to be named "OUTPUT_File.csv", but it is outputting it as "Output_File.csv". Do you know if there is a way around this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 20:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-a-large-CSV-cuts-off-variable-names/m-p/887950#M350817</guid>
      <dc:creator>afrerichs</dc:creator>
      <dc:date>2023-08-04T20:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting a large CSV cuts off variable names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exporting-a-large-CSV-cuts-off-variable-names/m-p/887952#M350819</link>
      <description>&lt;P&gt;Since the code you posted is going to make a file named myfile.csv you need show what code you actually are running.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the "Output" part is coming from a macro variable of some sort perhaps you just need to add a call to the %UPCASE() macro function?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/446487"&gt;@afrerichs&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you! I was able to get it to work. Yes, unfortunately this dataset has crazy variable names.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My next question in case you know the answer, I want the output csv to be named "OUTPUT_File.csv", but it is outputting it as "Output_File.csv". Do you know if there is a way around this?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 20:42:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exporting-a-large-CSV-cuts-off-variable-names/m-p/887952#M350819</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-04T20:42:05Z</dc:date>
    </item>
  </channel>
</rss>

