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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.