Hello,
I have a very basic question (hope you are not laughing at me :D).
I have written a SAS code and I would like to select e.g. rows 10.000 - 20.000 to run the program in SAS University Edition. Of course, I could just select the relevant lines what takes some time. Is there a more convenient way to do this in SAS (e.g. I have not found an option where I can type in which lines I would like to select)?
Many thanks in advance,
Tim
By default, you can run the whole program or just the selected piece of code. You can run the specific lines of code if you enclose them in a macro and call it from somewhere.
SAS/Studio is GUI interface to run SAS programs. It allows you to highlight code in the editor window and submit it to SAS to run. That works great for selecting lines 10 to 20 in a program. But if you want to run 10 thousand lines of code then don't use a GUI tool. Instead write a program.
For example this program will read lines 10,000 to 20,000 from myprogram.sas and copy them to temporary file and then run the temporary file.
filename subset temp;
data _null_;
infile 'myprogram.sas' firstobs=10000 obs=20000 ;
file subset;
input;
put _infile_;
run;
%include subset;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.