BookmarkSubscribeRSS Feed
ukpalnati
Calcite | Level 5

 

 

As per below mentioned code,  instead of % values it is calculating sum as per r break after

 

Could you suggest how to derive % for r break after values

 

Output table attached herewith


options missing='0';
Proc Report data=DTR.NH_TAT_Rpt headskip headline nowd missing
STYLE(Report)={FONT_FACE='Zurich BT' FONT_SIZE=10PT FONT_STYLE=ROMAN}
STYLE(COLUMN)={FONT_FACE='Zurich BT' FONT_SIZE=10PT FONT_STYLE=ROMAN FOREGROUND=#000000 BACKGROUND=#FFFFFF}
STYLE(HEader)={FONT_FACE='Zurich BT' FONT_WEIGHT=BOLD FONT_SIZE=10PT FONT_STYLE=ROMAN FOREGROUND=#FFFFFF BACKGROUND=#972926}
style(lines)=[FOREGROUND=black] style=[just=left];
Title j=l font='Zurich BT' height=3 color=black 'Settled (Paid+Rejected)Claims TAT met and missed%';
column ("Settled Claims TAT" REGISTER_FT TAT_Status,(n pct) Total_Count Total_Percentage );
where Final_Status in ("Paid","Closed","Rejected","Rejected") and Revised_DATE_OF_SETTLEMENT ne . ;
define REGISTER_FT/group "Product" order=internal STYLE(HEader)={FONT_FACE='Zurich BT' FONT_WEIGHT=BOLD FONT_SIZE=10PT FONT_STYLE=ROMAN FOREGROUND=#FFFFFF BACKGROUND=#972926};
define n/"Claim Count";
define TAT_Status/across STYLE(HEader)={FONT_FACE='Zurich BT' FONT_WEIGHT=BOLD FONT_SIZE=10PT FONT_STYLE=ROMAN FOREGROUND=#FFFFFF BACKGROUND=#972926};
define Total_Count/computed "Total Count" STYLE(HEader)={FONT_FACE='Zurich BT' FONT_WEIGHT=BOLD FONT_SIZE=10PT FONT_STYLE=ROMAN FOREGROUND=#FFFFFF BACKGROUND=#972926};
define Total_Percentage/computed "Total %" f=percent8.2 STYLE(HEader)={FONT_FACE='Zurich BT' FONT_WEIGHT=BOLD FONT_SIZE=10PT FONT_STYLE=ROMAN FOREGROUND=#FFFFFF BACKGROUND=#972926};
define pct /computed "%" f=percent8.2;
rbreak after / summarize ;
compute after;
REGISTER_FT="Grand Total";
call define(_row_,"Style","style=[FONT_FACE='Zurich BT' FONT_WEIGHT=BOLD FONT_SIZE=10PT foreground=white background=#972926]");
endcomp;
compute before REGISTER_FT;
Overall =sum(_c2_ , _c4_);
endcomp;
compute pct;
_c3_ = _c2_ / Overall;
_c5_ = _c4_ / Overall;
endcomp;
compute Total_Count;
Total_Count =sum(_c2_ , _c4_);
endcomp;
compute Total_Percentage;
Total_Percentage =sum(_c3_ , _c5_);
endcomp;
run;
quit;

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

Please work more so we work less to help you. There is way too much code that is irrelevant to your question.

 

Simplify your problem to a bare-bone example.

 

Maybe this will help:

 

proc report data=SASHELP.CLASS nowd;
  where NAME =:'J';
  column SEX NAME N;
  define SEX    / group;
  define NAME   / order;
  define PCTSEX / computed;
  define N      / noprint;
  compute before  ;
    TOT=N;
  endcomp;
  break after SEX /style=[just=left];
  compute after SEX ;
    PCTSEX=N/TOT;
    line N 2. ' ' SEX $1. ' (' PCTSEX percent6.0 ')' ;
  endcomp;
run;

 

Sex Name
F Jane
  Janet
  Joyce
  Judy
 4 F (  57% )
M James
  Jeffrey
  John
 3 M (  43% )

 

 

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
  • 1 reply
  • 673 views
  • 0 likes
  • 2 in conversation