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
Something must have been typed in it at some point.
Just drop it:
proc import out=TABLE(drop=O) ...
proc import datafile='/folders/myfolders/health_exam_results.xls'
out=have
replace
dbms=xls;
range='health_exam_results$A1:N100';
run;
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.
@ballardw that was a very good explanation. I just created new excel sheet and no issues so far. Even i was having blank columns while importing because i highlight whole row.
After creating new excel , everything is okay.
many thanks for explaining WHY?
regards
Sandeep
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.