data ds;
input values;
datalines;
-9
-6
3
4
-7
-1
-6
7
6
;
run;
How to count and sum positive and negative values
I don't propose to provide code for you, but here's how I would think about it.
You can also run something like proc means twice, once on the subset of positive values, and once on the negative subset.
Editted note: Finally, and most importantly, you can show what you tried (i.e. show us your SAS log), and you'll no doubt get helpful answers.
This forum is about SAS users supporting other SAS users.
What's appreciated is if you demonstrate some own effort as else you might end-up with people no more providing answers to your questions.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.