Hi:
Using PROC TABULATE was one of the topics/tutorials that I gave at PharmaSUG a few years ago. If you go to this web site:
http://www.lexjansen.com/cgi-bin/psug.asp?x=ttab&s=psug_t
And look for the presentation, entitled "Good Table Manners with PROC TABULATE", you will find a link to download the code for the presentation. That zip file also contains a PDF file of the slides.
The bottom line with TABULATE is that the CLASS statement sets categories or buckets for collecting observations. The VAR statement sets which variables should be used for analysis in the buckets. If you do not have any VAR statements, then the default statistic which you would get would be the COUNT or N statistic.
The only other thing you have to know about TABULATE is that the TABLE statement, then arranges the CLASS and/or VAR variables in a table structure. In addition, the comma operator is used in the TABLE statement to build dimensions:
[pre]
table region, subsidiary, product;
[/pre]
would have region in the PAGE dimension, subsidiary in the ROW dimension and product in the COLUMN dimension. Then:
[pre]
table region, product;
[/pre]
with ONE comma would have region in the ROW dimension, product in the COLUMN dimension. Another operator (the *) is used to cross or next variables, so for example:
[pre]
table region, subsidiary*product;
[/pre]
would have region in the ROW diimension and subsidiary crossed with product (or you could think of it as product values nested underneath subsidiary values) in the COLUMN dimension. A TABLE statement without ANY commas will give you all your variables in the COLUMN dimension, so at the very least, you have to introduce a COMMA and probably a couple of ASTERISKS in your TABLE statement to get the table structure that you want.
For your table sketch, even though you said that you consider COLLEGE, GENDER and ETHNIC to be "row lines" -- they would be considered COLUMN headings in terms of PROC TABULATE -- therefore, all 3 of those variables would be your COLUMN dimension. The only variable that comprises rows in your sketch are the DEPT variable levels (Dept1, Dept2, etc), therefore, DEPT would be in your ROW dimension:
[pre]
proc tabulate data=mydata format=comma6.;
class college gender ethnic dept;
table dept,
college*gender*ethnic;
run;
[/pre]
or if you had more than 1 college, you might want to make college a PAGE dimension:
[pre]
proc tabulate data=mydata format=comma6.;
class college gender ethnic dept;
table college,
dept,
gender*ethnic /
box=_page_;
run;
[/pre]
BTW, EG has an excellent table designer GUI interface for PROC TABULATE. To get to it you would select DESCRIBE --> SUMMARY TABLES. Once you set your Task Roles (Classification and Analysis variables), then the drag and drop table designer is under the Summary Tables choice in the navigation pane.
If you would prefer to read more about PROC TABULATE, these papers might prove helpful:
http://www2.sas.com/proceedings/sugi25/25/iv/25p159.pdf
http://www.laurenhaworth.com/publications/71-28.pdf
http://www2.sas.com/proceedings/sugi30/179-30.pdf
You'll also have to read in the TABULATE documentation about how missing values are treated and make sure you have the right MISSING option set with TABULATE, if you do have CLASS variables with possible missing values and you want those to show on the table.
cynthia