Data means something that we can run code with.
Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712 will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.
Since your code is using multiple different source data sets then you would need to provide examples of each.
You also don't provide much guidance, as in any, as to what value goes where. Building a table should reference what variable(s) are used to build which column and/or row.
I have no way to tell from your picture showing a desired column headings MTD and YTD (NOT variables used anywhere in your code) or where "2024 Budget" and "2024 Actual" come from. I can make some sort of educated guesses because I've been programming for a while. But I also know from that experience that "guessing" is a very poor way to set rules for coding.
One has suspicion that this is part way through a process that split up an existing data set to get some summary values and now is looking to get put back together for the report. If this is indeed the case, then it may be better idea to provide an example of that earlier data set.
... View more