Hi I am trying to create a report from a sorted dataset ( Grp_Order - Ascending & Total_Paid - Descending). The only parts that are sorted correctly are the odd # breaks. I tried variations of order = internal, order = data on the sorted variables. Here is the code.
proc report data=WORK.UTILIZATION_DATA_ORDER nowd
style(header) =
[just = left
font_face = calibri
font_size = 3
foreground = white
background = teal
protectspecialchars=off] ;
column Groupm Service_Category CHARGE_AMOUNT DISALLOW_AMOUNT ALLOWED_AMOUNT DISCOUNT_AMOUNT BENEFIT_AMOUNT DEDUCTIBLE_AMOUNT COPAY_AMOUNT COB_AMOUNT COINSURANCE_AMOUNT TOTAL_PAID Paid_Count Discount_Percent;
WHERE Current_Period = 'X';
define Groupm / order ORDER=data noprint;
define Service_Category / order ORDER=data 'Service Category' style(column)=[asis=on] missing style={just=l vjust =b };
break after Groupm / ol summarize page;
rbreak before / summarize;
compute Service_Category;
if _break_='_RBREAK_' then do;
Service_Category='Grand Total';
call define(_row_, 'style', 'style=[font_weight=bold color = white background = grey]');
end;
else if upcase(_break_)="GROUPM" then do;
Service_Category=Groupm;
call define(_row_, 'style', 'style=[font_weight=bold color = white background = grey]');
end;
else Service_Category = ' ' || Service_Category;
endcomp;
define CHARGE_AMOUNT / analysis SUM 'Charges' format=DOLLAR16.0 missing style={just=c vjust=b};
define DISALLOW_AMOUNT / analysis SUM 'Disallowed' format=DOLLAR16.0 missing style={just=c vjust=b};
define ALLOWED_AMOUNT / analysis SUM 'Allowed' format=DOLLAR16.0 missing style={just=c vjust=b};
define DISCOUNT_AMOUNT / analysis SUM 'Discount' format=DOLLAR16.0 missing style={just=c vjust=b};
define BENEFIT_AMOUNT / analysis SUM 'Benefit' format=DOLLAR16.0 missing style={just=c vjust=b};
define DEDUCTIBLE_AMOUNT / analysis SUM 'Deductible' format=DOLLAR16.0 missing style={just=c vjust=b};
define COPAY_AMOUNT / analysis SUM 'Co-Pay' format=DOLLAR16.0 missing style={just=c vjust=b};
define COB_AMOUNT / analysis SUM 'COB' format=DOLLAR16.0 missing style={just=c vjust=b};
define COINSURANCE_AMOUNT / analysis SUM 'Coinsurance' format=DOLLAR16.0 missing style={just=c vjust=b};
define TOTAL_PAID / analysis SUM 'Plan Payment' order=data format=DOLLAR16.0 missing style={just=c vjust=b};
define Paid_Count / analysis SUM 'Paid Count' format=Comma14.0 missing style={just=c vjust=b};
define Discount_Percent / computed 'Disc. %' format=PERCENT7.1 missing style={just=c vjust=b};
compute Discount_Percent;
Discount_Percent= DISCOUNT_AMOUNT.sum / ALLOWED_AMOUNT.sum;
endcomp;
run;
quit;
Appreciate any help...thanks in advance..
Please show us a sample of the result, pointing out the part which is not wanted.
On the attached, page 1 is sorted by plan payment (Total_Paid) in descending order. But page 2 is not. Page 3 is sorted correctly, but page 4 is not.
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.
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.