Here's my step:
proc import datafile="G:\Departments\Research\test scores\SCREADY\&prevyr.-&yr.\&yr.SCREADY.xlsx" out=state dbms=xlsx replace;
sheet="&yr SC READY STATE";
range="A1:BS97";
run;
I'm also getting columns BT through DL, which I don't want.
I'm not sure but you may try:
libname mydata xlsx "G:\Departments\Research\test scores\SCREADY\&prevyr.-&yr.\&yr.SCREADY.xlsx";
proc import datafile=mydata;
sheet="&yr SC READY STATE";
range="A1:BS97";
run;
Try this -
proc import datafile="C:\TESTFILE.xlsx" out=testme dbms=excel replace;
getnames=yes;
range='A1:BS27'; /*I set to 27, as I just had to make a sample sheet to test what's not working for you*/
run;
Hi, what if we have different no of data on monthly basis? Is there any other ways to not hard coded the range while working with the same file but having different no of data?
Thanks
Yes, you can set the range to
range="A3:0";
if you want to start reading in data from the third row and capture all rows and columns with data regardless of how many there are.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.