I am trying to eventually get a sum of loanapproved per Branch (column) 1-5 (values) using array - Thank you
data dloans3; set dloans2; array Branch (5) Branch1 Branch2 Branch3 Branch4 Branch5; do i = 1 to 5; Branch1(i)=Branch1(i) + 1; end; drop i; RUN;
Example input data.
Example expected result for that example data.
There are enough different ways to "sum" that we need to know which one you mean.
I don't know what you mean by sums here ... and I don't understand why you chose to write "SUM(s)" which must mean something to you but doesn't mean anything to us ... what you show in your code, adding one to a variable, is generally not what I think of as finding sums. We need to see sample of your data, and the desired output.
I am trying to eventually get a sum of loanapproved per Branch (column) 1-5 (values) using array
Also ... why does it have to be an array? A common mistake for beginners is to specify a certain technique should be used, when in fact it would simply be better to state the problem without specifying the method of solution.
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!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.