I have this kind of data table (it's just a part of large dataset) that I created using PROC MEANS and PROC SQL in SAS studio. I want to add several new columns in here which shows pct_missing of each year. Because, right now, we have same variables in multiple rows bcz i grouped it by year. Is there any way I can add these kind of columns using loop?
Current data(original data table):
what I expect to have: (wanna add all new columns pct_missing_2004 ~ pct_missing_2018 showing pct_missing of variable in each year) (the value of pct_missing_2004, 2005 written below is just an example!!!)
Is there anyway we can do this using loop or any other good way in SAS!?