BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have a table that has the same id number in mulitple observations. There are 3 variables of interest that I want summed (separately) by unique id number. I'm having trouble writing this code. Where may I find help on this topic? Thanks in advance.
3 REPLIES 3
deleted_user
Not applicable
you can sent part of them to me and I will sent the code to you
deleted_user
Not applicable
you can try olivier's code.I think it's a smart one.
Olivier
Pyrite | Level 9
I think your program should look something like :

PROC MEANS DATA = yourDataSet NOPRINT NWAY ;
VAR yourInterestVariables ;
CLASS yourIDvariable ;
OUTPUT OUT = yourResultingDataSet
SUM = ;
RUN ;

You will create a new dataset, in which the sums of each of your interest variables will be included as a new variable (named after the interest variables), plus the ID variable.
Just copy and paste the previous program, leaving as it is the uppercase code, and replacing the rest by the correct names.

Regards.
Olivier

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

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