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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

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