DATA Step, Macro, Functions and more

Proc Tabulate and summing measures

Reply
Frequent Contributor
Posts: 84

Proc Tabulate and summing measures

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"};

 

Super Contributor
Posts: 252

Re: Proc Tabulate and summing measures

Can you provide some sample data? It's much easier to play around with the problem if there's something concrete to work on.

Super User
Posts: 5,498

Re: Proc Tabulate and summing measures

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.

Frequent Contributor
Posts: 84

Re: Proc Tabulate and summing measures

Posted in reply to Astounding

 

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;

 

 

Valued Guide
Posts: 634

Re: Proc Tabulate and summing measures

Can we now assume that you are getting what you want?
Frequent Contributor
Posts: 84

Re: Proc Tabulate and summing measures

yup sorry I should have spent more time examining and understanding my PROC TABULATE 

Ask a Question
Discussion stats
  • 5 replies
  • 188 views
  • 0 likes
  • 4 in conversation