Hi ,
I ran the below report procedure for generating SAS report (please see the attachment for output sas report).
My question is how to create "Total" text ("total" text should be 2nd row first column case_opened_month("Month" in the report)
proc report data= days_opened7 ;
columns case_opened_month no_of_cases_closed avg_days_opened ('_Type of Cases_' SURS MCO UTI UNL LOCK );
define case_opened_month /group "Month";
define no_of_cases_closed/analysis sum "No of Cases Closed";
define avg_days_opened / mean "Average days opened";
define SURS /analysis sum "Beneficiary Case: SURS Comprehensive";
define MCO/analysis sum "Beneficiary Case: MCO Education Accuracy";
define UTI/analysis sum "Beneficiary Incident: Utilization";
define UNL/analysis sum "Beneficiary Incident: Unlisted Death Date";
define LOCK/analysis sum "Beneficiary Incident: Lock-In";
rbreak after/summarize ol ul ;
run;
Look at page 14 in this document: http://www.excursive.net/sas/ProcReportPaper.pdf
You use a COMPUTE block to set custom text in summary lines, and the automatic variable _break_ to determine in which grouping level you are.
Please read the documents as advised. This is the original example:
compute country;
if _break_ = 'COUNTRY' then
country = 'Subtotal';
else if _break_ = '_RBREAK_' then
country = 'GrandTotal';
endcomp;
Now compare this with your code, and you'll see what is missing.
Better post the example data and output you want see. That is the best way to describe your question. proc report data= days_opened7 ; columns case_opened_month no_of_cases_closed avg_days_opened ('_Type of Cases_' SURS MCO UTI UNL LOCK ); define case_opened_month /group "Month"; define no_of_cases_closed/analysis sum "No of Cases Closed"; define avg_days_opened / mean "Average days opened"; define SURS /analysis sum "Beneficiary Case: SURS Comprehensive"; define MCO/analysis sum "Beneficiary Case: MCO Education Accuracy"; define UTI/analysis sum "Beneficiary Incident: Utilization"; define UNL/analysis sum "Beneficiary Incident: Unlisted Death Date"; define LOCK/analysis sum "Beneficiary Incident: Lock-In"; compute after case_opened_month; case_opened_month='Total'; endcomp; rbreak after/summarize ol ul ; run;
Hi ,
Please see the attachment for input and output of the report.Below is the SAS code.I tried to print the "Total" text in the summary row but I couldn't.
proc report data= days_opened7 ;
/*WHERE (DATEPART(valid_from_dttm) GE "&OPEN_DATE_MIN"d) and (DATEPART(valid_from_dttm) LE "&OPEN_DATE_MAX"d);*/
columns case_opened_month no_of_cases_closed avg_days_opened ('_Type of Cases_' SURS MCO UTI UNL LOCK );
define case_opened_month /group "Month";
define no_of_cases_closed/analysis sum "No of Cases Closed";
define avg_days_opened /mean "Average days opened";
define SURS/analysis sum "Beneficiary Case: SURS Comprehensive";
define MCO/analysis sum "Beneficiary Case: MCO Education Accuracy";
define UTI/analysis sum "Beneficiary Incident: Utilization";
define UNL/analysis sum "Beneficiary Incident: Unlisted Death Date";
define LOCK/analysis sum "Beneficiary Incident: Lock-In";
compute case_opened_month;
if _break_='case_opened_month' then case_opened_month='Total';
endcomp;
rbreak after/summarize ol ul ;
run;
Post the data or photo here, not Excel or Doc file. I wouldn't like to download it due to implying risk.
I solved the issue.Below is the code.
compute case_opened_month;
IF _break_='_RBREAK_' THEN CALL DEFINE('case_opened_month','style','style=[pretext="Total"]');
endcomp;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.