proc tab and a difference coulmn

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 84
Accepted Solution

proc tab and a difference coulmn

I have a proc tab

 

option validvarname=any;
libname stdnt "E:\SAS\Data\Student";
libname robm "f:\robm";

proc tabulate data=ROBM.dump missing contents = ' ' format=COMMA6.0 S=[foreground=highlight.];
   class 'Reporting Year'n 'Responsible College'n 'Reporting Year'n;
   var 'Final Charge'n;
   keylabel Sum = " ";
   table  ('Responsible College'n ="")  all=Total , (('Reporting Year'n="Reporting Year" )*(('Final Charge'n = "")*F=COMMA12.0)) /
                  contents = ' ' misstext=' ' box={label="test"};
  run;

 

that gives

 

 proctab.PNG

 

How do I get a 4th column that is the difference of 2017/2018 – 2016/2017 values?

 


Accepted Solutions
Solution
‎10-19-2017 09:19 AM
Super User
Posts: 12,148

Re: proc tab and a difference coulmn


robm wrote:

 

How do I get a 4th column that is the difference of 2017/2018 – 2016/2017 values?

 


Either use proc report which allows referencing result columns in calculations or do all of the summary before, do the calculation in a datastep and use proc tabulate (or report or print) to display the calculated result.

View solution in original post


All Replies
Solution
‎10-19-2017 09:19 AM
Super User
Posts: 12,148

Re: proc tab and a difference coulmn


robm wrote:

 

How do I get a 4th column that is the difference of 2017/2018 – 2016/2017 values?

 


Either use proc report which allows referencing result columns in calculations or do all of the summary before, do the calculation in a datastep and use proc tabulate (or report or print) to display the calculated result.

Frequent Contributor
Posts: 84

Re: proc tab and a difference coulmn

Thanks Ballard

Summary before is the way i went

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 81 views
  • 2 likes
  • 2 in conversation