12-15-2011 02:07 PM
I have a csv file with 214 columns. SAS is only reading the the first 125. the log says "Number of names found is greater than number of variables found." I have imported this file numerous times using the same code I'm using today but this is the first time i've done it using version 9.3. Am I missing something?
proc import datafile="G:\Departments\Research\test scores\GT\1112\GIFT.csv"
12-15-2011 02:34 PM
Without seeing the file one can only guess. My first guess would be that the file begins with some incomplete records. I would try adding a guessingrows=32000; statement and see if that corrects the situation.
12-15-2011 02:51 PM
Could also be a record length issue. You could, I think, assign the file with a filename statement and set lrecl to some very large number. What does proc import curently show it to be set at in your log? And, in reality, how wide is the longest record in the file?
11-14-2013 12:31 PM
I have experienced this unhelpful message: it occurs for me when the number of characters in the first line of the file (variable names) in longer than ~32,000. Essentially, it reads those first 32k characters and those variables names come through to the SAS dataset correctly. SAS gives up for the other variable names and just names them var0001....
One work around for this is to -cut- up the input text file by columns using a command line tool (e.g. cut in linux) so that SAS can read in the manageable chunks, then merge those SAS datasets together. SAS doesn't hit a limit with my data in terms of having that number of variables, just a flawed proc import.
PS. I'm using SAS 9.3