Thank you. My code does not create the desired table. First I don't want to merge the cells with missing value. Second, I want the proc report table has the exact order of the input dataset. Third, the goal is to merge the cells if the "num" values are adjacent. Here is the code and the desired table is attached. data have; input variable $ @10 groups $1. @13 num; datalines; drugL 1 drugZ 2 drugC D 3 drugD B 4 drugE B 5 drugF B 6 drugX B 7 drugH B 8 drugI C 9 drugJ B 10 DrugK B 11 DrugL F 12 run; proc report data=have spanrows; column variable groups num; define groups/ group; define num/order noprint; run;
... View more