Hello!
I have a list of 246 schools. I am trying to add a year column but each school should have 2019, 2018, 2017, 2016, and 2015. Can someone help me figure out a way to code this so that I do not have to go in manually for this?
Thank you!
If your current data has one record per school then something like this:
data want;
set have;
do year=2015 to 2019;
output;
end;
run;
which will duplicate all the values in the other variables.
If you do not have one record per school then example of what you currently have and what the output should look like.
If the actual order really matters you could do: year = 2019 to 2015 by -1
If your current data has one record per school then something like this:
data want;
set have;
do year=2015 to 2019;
output;
end;
run;
which will duplicate all the values in the other variables.
If you do not have one record per school then example of what you currently have and what the output should look like.
If the actual order really matters you could do: year = 2019 to 2015 by -1
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.