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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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