BookmarkSubscribeRSS Feed
Roger12
Calcite | Level 5

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

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

Something must have been typed in it at some point.

 

Just drop it:

 

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

 

 

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

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.

samgautam007
Fluorite | Level 6

@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

Man Happy

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

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
  • 4 replies
  • 2707 views
  • 1 like
  • 5 in conversation