BookmarkSubscribeRSS Feed
chanduk
Obsidian | Level 7

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; 

7 REPLIES 7
chanduk
Obsidian | Level 7
I have used below code in compute block but it is over replaced the column "Month" ( report output ).Feb17 will be replaced with total. Please let me know is there any other way to write the code.

compute case_opened_month/char;
case_opened_month="Total";
endcomp;
Kurt_Bremser
Super User

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.

Ksharp
Super User
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; 




chanduk
Obsidian | Level 7

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;

Ksharp
Super User
Post the data or photo here, not Excel or Doc file. I wouldn't like to download it due to implying risk.

chanduk
Obsidian | Level 7

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;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

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
  • 7 replies
  • 1115 views
  • 0 likes
  • 3 in conversation