BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Walternate
Obsidian | Level 7

Hi,

 

I am using a very basic libname xlsx step to read in a set of Excel files:

 

%let datafile = mypath\myfile.myext

 

libname xl xlsx "&Datafile.";

%let keeplist = v1 v2 'Variable 3'n 'Variable 4'n;


data mydata;
length v1 $20. v2 $500. 'Variable 3'n 'Variable 4'n $1000. ;

set xl.mysheet (keep=&keeplist.);

run;

 

libname xl clear;

 

This reads each file in successfully with no errors in the log. However, I noticed that rows from some Excel file are not being read in. I don't notice any level of missingness on the first row not being read in, so I'm not sure what's going on here. 

 

Any help is much appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Check the excel files for named ranges that are the same as the sheetname but not the full selection of data.

View solution in original post

2 REPLIES 2
ballardw
Super User

You should provide an example of file that demonstrates that behavior.

Tell us which row(s) are not read.

 

I realize that your source files may be sensitive. I am not asking for a file containing sensitive information but a file that shows the behavior. That may mean making a copy and replacing sensitive fields with values like XXXXX or 1111 (if the column should be numeric).

 

 

Reeza
Super User
Check the excel files for named ranges that are the same as the sheetname but not the full selection of data.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 538 views
  • 2 likes
  • 3 in conversation