Apologies, I'll clarify.
data have;
input year ratio have have2 want;
cards;
2021 1 5 . 5
2022 2 . 5 10
2023 3 . 10 30
2024 4 . 30 120
2025 5 . 120 600
;
run;
I've updated the sample code. I only have ratio and have, I'm trying to generate have2, and finally want. It's been a while since I've written a sas code, so I'm a bit rusty.
To elaborate further,
for 2022, I want to multiply, ratio2022 with have2021
for 2023, I want to multiply, ratio 2023 with have 2022 so on.