BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Greetings,

I have 6 csv files containing 14 columns that I'm combining into one sas dataset.
If I do files 1-5, all 14 columns are picked up. If I do all 6, I get the following message: "Number of names found is greater than number of variables found." My resulting dataset only contains 13 columns. The last column is dropped.

I've isolated the problem to the 6th file but cannot figure out what this message means. All 6 files have 14 columns and they are all spelled the same. I've searched this site but haven't found anything that details the message.

This is my code

PROC IMPORT OUT= testcsv.csvtest
DATAFILE= "E:\folder1\csv_1.csv"
DATAFILE= "E:\folder1\csv_2.csv"
DATAFILE= "E:\folder1\csv_3.csv"
DATAFILE= "E:\folder1\csv_4.csv"
DATAFILE= "E:\folder1\csv_5.csv"
DATAFILE= "E:\folder1\csv_6.csv"
DBMS=CSV REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;

Thanks for looking.
1 REPLY 1
Doc_Duke
Rhodochrosite | Level 12
Some things to try.

-- just bring in the 6th file.
-- look at the 6th file with a hex editor. There may be something in there that you can't see with notepad or Word.
-- along the lines of hidden characters, I've had users embed a in the middle of a column and it messed up lots of stuff.
-- did the 6th file come from a Unix source; you could be missing a part of the end-of-line character.
-- it could be the very last row in the 5th file. If it is missing the last field, that might be it.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1841 views
  • 0 likes
  • 2 in conversation