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

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!

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
  • 2261 views
  • 1 like
  • 3 in conversation