<?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: PROC IMPORT, GETNAMES, and Blank Variable Name Errors in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251616#M268773</link>
    <description>&lt;P&gt;Not sure why you have DATAROW=2 on both versions, that doesn't look right. &amp;nbsp;Isn't the first row the variable names?&lt;/P&gt;
&lt;P&gt;If you really have 3,400+ columns then you might be exceeding the limits of PROC IMPORT. &amp;nbsp;It does not support line lengths longer than 32,767. &amp;nbsp;So if your average column name is 9 characters then the names plus the commas for 3,400 columns not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read the data without the titles and let SAS assign variable names.&lt;/P&gt;
&lt;P&gt;Read the title line as data and use it to generate rename statment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Feb 2016 19:36:28 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2016-02-22T19:36:28Z</dc:date>
    <item>
      <title>PROC IMPORT, GETNAMES, and Blank Variable Name Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251590#M268767</link>
      <description>&lt;P&gt;I work in an organization where we are given occupational analysis data for each career field in our organization. The file is sent to us in a CSV file with comma delimiters. These datasets are large - up to 7,000 observations and 3400+ variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a SAS script that reads the datasets in as is and then saves it as a SAS database to serve as both an archive and master database. I then have a step that drops all columns with a certain prefix. This is preferrable because while variable names across different files are not always the exact same, their prefixes are. I end up keeping between 80-120 variables for our purposes. I have avoided using the INFILE step because my data are mixed and because variable names are not always consistent, and they are not always in the same order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SAS script I created works wonderful for datasets with CSV files that don't have any spaces in the first row (variable name). But I have recently run into some files with empty spaces in the first row. The error I am getting seems to lie in the GETNAMES option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When GETNAMES=NO&lt;/STRONG&gt;, SAS successfully reads in all (in this case) 3168 variables (the correct number). The obvious limitation is now my data has no variable names so I can't drop the data I need to drop:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import datafile="&amp;amp;path\xxxxx.csv" out=xxxxx.xxxxx&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;dbms=csv replace;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;getnames=no;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;datarow=2;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When GETNAMES=YES,&lt;/STRONG&gt; SAS gets angry:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import datafile="&amp;amp;path\xxxxx.csv" out=xxxxx.xxxxx&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;dbms=csv replace;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;getnames=yes;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;datarow=2;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Despite me setting DBMS=csv, when it encounters two consecutive commas (e.g., empty space) it interprets the second comma as the name of a numeric variable. Then it drops successive "comma variables"&amp;nbsp; and then, in one instance, defines a comma as a character variable and then specifies an invalid variable width:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1882&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informat xxxxx best32. ;&lt;BR /&gt;1883&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informat ","N best32. ;&lt;BR /&gt;1884&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informat ","N best32. ;&lt;BR /&gt;1885&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informat ","N best32. ;&lt;BR /&gt;1886&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informat xxxxx best32. ;&lt;BR /&gt;NOTE: SCL source line.&lt;BR /&gt;1887&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informat ","N $36. ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ____&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 499&lt;BR /&gt;WARNING: Variable ','n has already been defined as numeric.&lt;BR /&gt;ERROR 499-185: Width specified for informat&amp;nbsp; is invalid.&lt;BR /&gt;&lt;BR /&gt;1888&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informat xxxxx best32. ;&lt;BR /&gt;1889&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informat VAR1850 $14. ;&lt;BR /&gt;1890&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informat VAR1851 $17. ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;Output further down assignment formats:&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;5050&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format xxxxx best12. ;&lt;BR /&gt;5051&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format ","N best12. ;&lt;BR /&gt;5052&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format ","N best12. ;&lt;BR /&gt;5053&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format ","N best12. ;&lt;BR /&gt;5054&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format xxxxx best12. ;&lt;BR /&gt;NOTE: SCL source line.&lt;BR /&gt;5055&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format ","N $36. ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ____&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29&lt;BR /&gt;WARNING: Variable ','n has already been defined as numeric.&lt;BR /&gt;ERROR 29-185: Width specified for format&amp;nbsp; is invalid.&lt;BR /&gt;&lt;BR /&gt;5056&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format xxxxx best12. ;&lt;BR /&gt;5057&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format VAR1850 $14. ;&lt;BR /&gt;5058&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format VAR1851 $17. ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, in addition to not correctly recognizing consecutive commas as a blank space but as a variable, it also drops successive "comma variables" and then creates specifies an invalid character format width. The result is that all "comma variables" except the first one labeled as numeric are dropped, reducing my final variable number from 3,168 (correct) to 3,165 (wrong) and the informat/format width error stops any output from occuring. However, for some reason, all columns missing a variable name after the last column with a variable name correctly relabels itself as VARXXXX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI I have removed variable names and replaced them with xxxxx. The data I am working with is rather sensitive and variable names are descriptive.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 18:21:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251590#M268767</guid>
      <dc:creator>rgdfwfw</dc:creator>
      <dc:date>2016-02-22T18:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IMPORT, GETNAMES, and Blank Variable Name Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251597#M268768</link>
      <description>Update: In the original file I did a find and replace for the first row in excel, finding cells with no contents ("") and replacing them with a space (" "), and the second proc import statement now works.&lt;BR /&gt;&lt;BR /&gt;So I suppose the newest question becomes is it possible to make the second statement work without having to do the find and replace step?</description>
      <pubDate>Mon, 22 Feb 2016 18:46:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251597#M268768</guid>
      <dc:creator>rgdfwfw</dc:creator>
      <dc:date>2016-02-22T18:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IMPORT, GETNAMES, and Blank Variable Name Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251600#M268769</link>
      <description>&lt;P&gt;Why are you using PROC IMPORT? &amp;nbsp;If you know what data you are getting then just write your own data step to read the file.&lt;/P&gt;
&lt;P&gt;Do you not know what variables are in the file? &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you not know which are the numeric and which are the character variables?&lt;/P&gt;
&lt;P&gt;Do you not know the proper length to set for the character variables?&lt;/P&gt;
&lt;P&gt;Do you not know which ones require a special INFORMAT or FORMAT (like date or time values)? &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 19:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251600#M268769</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-02-22T19:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IMPORT, GETNAMES, and Blank Variable Name Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251610#M268770</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/56000"&gt;@rgdfwfw﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried changing the value of SAS system option VALIDVARNAME from ANY to V7?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=v7;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This would prevent SAS from accepting commas as variable names. It would transform other column headers into valid variable names, though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you had to insist on VALIDVARNAME=ANY, you could insert the blanks into the first line in a preliminary read/write data step.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 19:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251610#M268770</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-22T19:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IMPORT, GETNAMES, and Blank Variable Name Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251611#M268771</link>
      <description>&lt;P&gt;Hello! Thanks for the fast reply.&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/159"&gt;@Tom&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;1. Why are you using PROC IMPORT? &amp;nbsp;If you know what data you are getting then just write your own data step to read the file.&lt;/P&gt;&lt;P&gt;2. Do you not know what variables are in the file? &amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Do you not know which are the numeric and which are the character variables?&lt;/P&gt;&lt;P&gt;4. Do you not know the proper length to set for the character variables?&lt;/P&gt;&lt;P&gt;5. Do you not know which ones require a special INFORMAT or FORMAT (like date or time values)? &amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;1. I am using PROC IMPORT because I want to create a master database of all variables, and there are 3,500 of them. So I want to, at least initially, import all of them - I am generally satisfied with allowing SAS to assign format and informat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I avoided writing a data step because variable names sometime differ. CSV file #1 may have "SSN," #2 has "SSAN," and CSV #3 may have "ParticipantID." However, item level data in these files start with an identital prefix like "WorkTask_" or "ToolsUsed_" so it is immensely easier to drop all variables with a consistent prefix than use a data step with variable names that change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I (generally) know what variables are in the file, and I know the prefixes of the variables I want to drop. The goal is to create a SAS script able to process several of these CSV datasets. The number and exact name of all variables I want to keep are not the same across multiple CSV files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Yes. However I am satisifed with PROC IMPORT making that determination on this step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Maximum length for character variables is sometimes subject to change, but generally less than 50 characters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;5. Yes, but am okay with PROC IMPORT doing the assignment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my follow up it seems that the issue is there are no spaces between commas in the variable name row. When I do a find and replace and insert a space in "empty" variable name cells in excel my PROC IMPORT step runs perfectly. However I am unsure why SAS is having a hard time understanding that two consecutive commas, space or not, equals an "empty" cell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 19:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251611#M268771</guid>
      <dc:creator>rgdfwfw</dc:creator>
      <dc:date>2016-02-22T19:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IMPORT, GETNAMES, and Blank Variable Name Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251613#M268772</link>
      <description>&lt;P&gt;If you opened the CSV file in Excel then you potentially changed the content. &amp;nbsp;Excel has a nasty habit of converting strings to numbers and dates.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 19:31:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251613#M268772</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-02-22T19:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IMPORT, GETNAMES, and Blank Variable Name Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251616#M268773</link>
      <description>&lt;P&gt;Not sure why you have DATAROW=2 on both versions, that doesn't look right. &amp;nbsp;Isn't the first row the variable names?&lt;/P&gt;
&lt;P&gt;If you really have 3,400+ columns then you might be exceeding the limits of PROC IMPORT. &amp;nbsp;It does not support line lengths longer than 32,767. &amp;nbsp;So if your average column name is 9 characters then the names plus the commas for 3,400 columns not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read the data without the titles and let SAS assign variable names.&lt;/P&gt;
&lt;P&gt;Read the title line as data and use it to generate rename statment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 19:36:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251616#M268773</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-02-22T19:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IMPORT, GETNAMES, and Blank Variable Name Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251621#M268774</link>
      <description>&lt;P&gt;Here is code to read the names from the first row and generate and apply a RENAME command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile=csv out=newfile replace dbms=dlm ;
  delimiter=',';
  getnames=no;
  datarow=2;
run;
filename code temp;
data _null_;
  infile csv dsd obs=1 length=len column=col truncover;
  file code ;
  put 'RENAME';
  length  name $50 old $32 new $80;
  do i=1 by 1 until( col &amp;gt; len);
     input name @ ;
     old = cats('VAR',i);
     new=nliteral(trim(coalescec(name,old)));
     put old '=' new  ;
  end;
  put ';';
  stop;
run;

proc datasets lib=work nolist ;
  modify newfile;
%inc code ;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Feb 2016 20:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/251621#M268774</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-02-22T20:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IMPORT, GETNAMES, and Blank Variable Name Errors</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/479572#M268775</link>
      <description>Very helpful. this reset the system when getnames doesn't work</description>
      <pubDate>Thu, 19 Jul 2018 16:50:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-IMPORT-GETNAMES-and-Blank-Variable-Name-Errors/m-p/479572#M268775</guid>
      <dc:creator>andizhang</dc:creator>
      <dc:date>2018-07-19T16:50:46Z</dc:date>
    </item>
  </channel>
</rss>

