BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RunningIR
Calcite | Level 5

 

Hello,

 

Running a complicated Proc Report. I have one final problem my grand total. I am currently using "rbreak after" to compute a grand total, but it is not working for my computed columns. Anyone have any ideas?

 

Thanks,

 

proc report data=FundingYear missing nowd completecols   out=Nurse1;
where IOCategory="Nursing"  
and semester in ("&Semester1" "&Semester2" "&Semester3" "&Semester4" "&semester5" "&Semester6") ;
column StudentclassReport  Acad_Plan_Description CBM001major Sub_Plan_Description location IOCategory Semester,(student CBM001SCHAllStatefund)
FTSELast LastFunding FTSECurrent Currentfunding DiffFTE DIFFFund;

define StudentclassReport/ group order=data "Class Description";
define Acad_Plan_Description/ group "Academic Plan" ;
define CBM001major/ group "CIP" ;
define Sub_Plan_Description/ group "Academic Sub-Plan";
define location/ group "Location" ;
define IOCategory/group "I & O Category";
Define Semester/ across order=data "Semester";
Define student/ analysis sum "HeadCount";
Define CBM001SCHAllStatefund/ analysis sum "SCH";
define FTSELast/ computed "Last Base FTE";
define LastFunding/ computed "Fund Last";
define FTSECurrent/ computed "Current Base FTE";
define Currentfunding/ computed "Projected Funding";
define DiffFTE/ computed "Diff FTE";
define DIFFFund/ computed "Diff Funding";
break after StudentclassReport/ ol skip summarize suppress;
rbreak after /summarize ol ;

Compute after StudentclassReport;
Brkline=" Total for "|| trim(StudentclassReport);
StudentclassReport=brkline;
endcomp;

compute FTSELast;
If  StudentclassReport="Undergraduates" then FTSELast=sum(_C8_,_C10_,_C12_)/30;
If StudentclassReport="Master's Level" then FTSELast=sum(_C8_,_C10_,_C12_)/24;
If StudentclassReport="Doctoral" then FTSELast=sum(_C8_,_C10_,_C12_)/18;
IF FTSELast=. then FTSELast=0;
endcomp;

compute LastFunding;
LastFunding=(FTSELast)*&NurWFTEf;
endcomp;

compute FTSECurrent;
If  StudentclassReport="Undergraduates" then FTSECurrent=sum(_C18_,_C14_,_C16_)/30;
If StudentclassReport="Master's Level" then FTSECurrent=sum(_C18_,_C14_,_C16_)/24;
If StudentclassReport="Doctoral" then FTSECurrent=sum(_C18_,_C14_,_C16_)/18;
IF FTSECurrent=. then FTSECurrent=0;
endcomp;

compute Currentfunding;
Currentfunding=(FTSECurrent)*&NurWFTEf;
endcomp;

compute DiffFTE;
DiffFTE=FTSECurrent-FTSELast;
endcomp;

compute DIFFFund;
DIFFFund=Currentfunding-LastFunding;
endcomp;


compute StudentclassReport;
IF StudentclassReport NE ' ' then hold=StudentclassReport;
IF StudentclassReport EQ ' ' then StudentclassReport=hold;
if _break_ = '_RBREAK_' then
StudentclassReport = 'Grand Total';
endcomp;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Use COMPUTE block instead of RBREAK.

 

Compute after ;
  Brkline="Grand Total :";
  StudentclassReport=brkline;
endcomp;

View solution in original post

2 REPLIES 2
ballardw
Super User

You should provide some example input data, preferably in the form of datastep code, values for the macro variables, and what you would expect the result to look like.

 

Ksharp
Super User

Use COMPUTE block instead of RBREAK.

 

Compute after ;
  Brkline="Grand Total :";
  StudentclassReport=brkline;
endcomp;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2247 views
  • 1 like
  • 3 in conversation