Hi guys @Kurt_Bremser @Ksharp
I think the have dataset should be considered as lookup table where the formula for each state is saved.
Therefore you're code will not produce the correct results when running on another dataset like sashelp.prdsal2 for example.
... View more
NO. I is hard for proc report.
process the dataset firstly(add a new variable):
new_bad_event=ifn(bad_event=0,0,1);
After that run your code again ,using new_bad_event variable.
... View more