Hi There.
I have this data, data A & B
I want to ask your expertise how to divide value from total_balance (Data A) to every var cell in data B for each year to get the percentage, so it will show like the picture below.
I usually do this manually on excel and I want to improve this.
here is my code
generate Data A
proc tabulate data = data_a;
table year, total_balance;
var total_balance;
class year;
run;
generate Data B
proc tabulate data = lnsx3by;
table year, MOBx*balance;
var balance;
class year MOBx;
run;
Thank you for your help
Since you only posted pictures we have to make a lot of guesses at what data you actually have.
It sounds to me like you one dataset with two variables YEAR and TOTAL_BALANCE.
And a second dataset with YEAR, MOBX and BALANCE.
So it sounds like you just want to MERGE the two by YEAR and then DIVIDE the two numbers to make a percentage.
data want;
merge b a ;
by year ;
percent = balance/total_balance.
format percent percent6. ;
run;
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.