BookmarkSubscribeRSS Feed
KBA17
Calcite | Level 5

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;
2 REPLIES 2
ballardw
Super User

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.

PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 523 views
  • 0 likes
  • 3 in conversation