DATA Step, Macro, Functions and more

Import .XLS extra empty column

Reply
Regular Learner
Posts: 1

Import .XLS extra empty column

Dear all,

 

When I try to import the attached xls file, I get the empty O column....how knows why? how I get rid of it?

 

Many thanks

 

Roger

PROC Star
Posts: 1,558

Re: Import .XLS extra empty column

Something must have been typed in it at some point.

 

Just drop it:

 

proc import out=TABLE(drop=O)  ...

 

 

Super User
Posts: 9,671

Re: Import .XLS extra empty column

proc import datafile='/folders/myfolders/health_exam_results.xls' 
out=have 
replace 
dbms=xls;
range='health_exam_results$A1:N100';
run;
Super User
Posts: 10,473

Re: Import .XLS extra empty column

The "WHY" in a bit more detail than @ChrisNZ mentions is that if a column or row in Excel has a value entered in a cell and then the value is deleted Excel "remembers" the column or row has been used. So when you ask Excel to tell you what is in the data via Proc Import it tells the data linkage that column has data.

 

You might also want to check for entire rows at the end of your data set without values.

Ask a Question
Discussion stats
  • 3 replies
  • 236 views
  • 0 likes
  • 4 in conversation