There are a couple of ways that you can order data within a table, using options in the PROC TABULATE statement itself, or within a CLASS statement. I think what you will want to do is use the CLASS statement. Within a CLASS statement you can order the data in the following ways (from the documentation): ORDER=DATA | FORMATTED | FREQ | UNFORMATTED DATA: orders values according to their order in the input data set. FORMATTED: orders values by their ascending formatted values. This order depends on your operating environment. FREQ: orders values by descending frequency count. UNFORMATTED: orders values by their unformatted values, which yields the same order as PROC SORT. So, I bet that if you sort the data in the order you want the dttm variables to appear, and create separate CLASS statement for the dttm variable (like shown), you will get what you need. Of course, this might mix up the order of other variables, so you might need to have separate CLASS statements for them, even using the PRELOADFMT option (which is a great feature!). One wonderful, but simple, resource for understanding PROC TABULATE is this paper: http://www2.sas.com/proceedings/sugi30/258-30.pdf. Good luck! proc sort data = dataln; by dttm; run; proc tabulate data = dataIn; var catCount; class dttm / order = data; class studyID orderBy desc type; table studyID*type*orderBy*desc*(style=Header), catCount*dttm*max=' '; run;
... View more