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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1040 views
  • 2 likes
  • 3 in conversation