I have 2 Proc tabulates where I am trying to show 2 different measure summed over different acacdemic year terms basically i am trying to sum in one
-the Tuition from each ALLOCATED_COLLEGE/SUBJECT_DESC for each column TERM_CODE
-the Student count for each ALLOCATED_COLLEGE/SUBJECT_DESC for each column TERM_CODE
IE I have change the VAR for each but they still sum exactly the same ...any suggestions?
the output from below can be seen in the attached pdf
proc tabulate data=ROBM.TBIR1025 missing contents = ' ' format=COMMA6.0 S=[foreground=highlight.]; class ALLOCATED_COLLEGE SUBJECT_DESC TERM_CODE; var INCLUDED_TUITION; keylabel Sum = " "; table (ALLOCATED_COLLEGE =' ') *(SUBJECT_DESC=' ' all='Total') all='Total', ((TERM_CODE=' ' all='Total')*((N=Amount))) / contents = ' ' misstext=' ' box={label="ALLOCATED_COLLEGE/SUBJECT_DESC"}; run; proc tabulate data=ROBM.TBIR1025 missing contents = ' ' format=COMMA6.0 S=[foreground=highlight.]; class ALLOCATED_COLLEGE 'SUBJECT_DESC'n 'TERM_CODE'n; var STUDENT_COUNT; keylabel Sum = " "; table (ALLOCATED_COLLEGE =' ') *(SUBJECT_DESC=' ' all='Total') all='Total', ((TERM_CODE=' ' all='Total')*((N=Count))) / contents = ' ' misstext=' ' box={label="ALLOCATED_COLLEGE/SUBJECT_DESC"};
Can you provide some sample data? It's much easier to play around with the problem if there's something concrete to work on.
You will have to learn a little more PROC TABULATE, I'm afraid. You have never asked for the SUM of anything. You only asked for the N statistic, which gives you a count of the nonmissing values. So the count of the nonmissing values doesn't change. You're allowed to ask for many different statistical measures, but you only get what you ask for.
you aew right I building these of a EBI server
proc tabulate data=ROBM.TABBS99991 missing contents = ' ' format=COMMA6.0 S=[foreground=highlight.]; class &showvarvalue &showvarvalue1 &acrossvarvalue; var &measurevar; keylabel Sum = " "; table &showby1exp &showby2exp &showvarall, (&acrossexp(&measureexp)) / contents = ' ' misstext=' ' box={label="&boxlabel"}; run;
and (&acrossexp(&measureexp)) should have just been (&measurevar)
proc tabulate data=ROBM.TABBS99991 missing contents = ' ' format=COMMA6.0 S=[foreground=highlight.]; class &showvarvalue &showvarvalue1 &acrossvarvalue; var &measurevar; keylabel Sum = " "; table &showby1exp &showby2exp &showvarall, (&measurevar) / contents = ' ' misstext=' ' box={label="&boxlabel"}; run;
proc tabulate data=ROBM.TBIR1025 missing contents = ' ' format=COMMA6.0 S=[foreground=highlight.]; class 'ALLOCATED_COLLEGE'n 'SUBJECT_DESC'n 'TERM_CODE'n; var STUDENT_COUNT; keylabel Sum = " "; table ('ALLOCATED_COLLEGE'n =' ') *('SUBJECT_DESC'n=' ' all='Total') all='Total', (('TERM_CODE'n=' ' all='Total')*((STUDENT_COUNT))) / contents = ' ' misstext=' ' box={label="ALLOCATED_COLLEGE/SUBJECT_DESC"}; run; proc tabulate data=ROBM.TBIR1025 missing contents = ' ' format=COMMA6.0 S=[foreground=highlight.]; class 'ALLOCATED_COLLEGE'n 'SUBJECT_DESC'n 'TERM_CODE'n; var INCLUDED_TUITION; keylabel Sum = " "; table (ALLOCATED_COLLEGE = ' ') *(SUBJECT_DESC = ' ' all = 'Total') all='Total', ((TERM_CODE = ' ' all = 'Total')*((INCLUDED_TUITION))) / contents = ' ' misstext=' ' box={label = "ALLOCATED_COLLEGE/SUBJECT_DESC"}; run;
yup sorry I should have spent more time examining and understanding my PROC TABULATE
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.