HB, You've gotten a lot of good suggestions here. In my view, here's where things stand. Ksharp's approach looks most workable, because it is PROC FREQ-based. You had mentioned along the way that you might want some percentages instead of counts, where the percentage calculations omit missing values. That's exactly how PROC FREQ works. That would require significant changes to Ksharp's current version, but he (as well as several other posters) would be quite capable of doing that: (1) sorting by ENTITY, (2) running PROC FREQ BY ENTITY, (3) selecting which variables require percentages and which require counts (you would provide the rules on that one), (4) if needed, adjusting percentages from a scale of 0 to 100 to a scale of 0 to 1, (5) reconstructing NAME, (6) reshaping the results so they are ready for PROC PRINT, and (7) getting the PROC PRINT output into Excel-ready format. I know the steps are beyond your own SAS knowledge, but that would be taken care of for you. You would need to supply the rules about which variables require percentages and which require counts. The final PROC PRINT might need to add a VAR statement to group variables appropriately, such as: var con1_: con2_: con3_:; Down the road, you would have to watch out for new CON variables that take on unusual values. There could be a problem with the automation of variable names (the column headings), since SAS names are limited to letters, numbers, and underscores. If CON20 takes on values of "+" and "-", SAS would attempt to convert both values to CON20__ since it can't use CON20_+ and CON20_-. You would need to preprocess the data using statements that assign letters/numbers/underscores, such as: if CON20='+' then CON20='plus'; else if CON20='-' then CON20='minus'; At this point, it appears the ball is in your court. Given the results so far, what are the final specifications? Good luck.
... View more