Instead of performing multiple separate PROC FREQ
procedures on a very large data set, I'd like to improve efficiency by performing a single PROC FREQ
with multiple TABLE
statements. Our QA process requires table titles which is simple with a single TABLE
statement using a single TITLE
statement, but is this possible with multiple TABLE
statements?
Take the example data and code below:
DATA TEST;
INPUT TEMPERATURE HUMIDITY PLATE FORM $12.;
DATALINES;
25 75 1 HOT
30 75 2 COLD
25 45 3 HOT
30 45 4 COLD
25 55 5 HOT
30 55 6 COLD
25 15 7 HOT
30 15 8 COLD
;
RUN;
** SINGLE PASS ON PROC FREQ **;
PROC FREQ DATA = TEST;
TITLE1 "TEMPERATURE FREQS";
TABLE TEMPERATURE / LIST OUT=FREQS_TEMP;
TITLE2 "HUMIDITY FREQS";
TABLE HUMIDITY / LIST OUT=FREQS_HUM;
TITLE3 "PLATE FREQS";
TABLE PLATE / LIST OUT=FREQS_PLATE;
TITLE4 "FORM FREQS";
TABLE FORM / LIST OUT=FREQS_FORM;
RUN;TITLE1;TITLE2;TITLE3;TITLE4;
The titles stack on top of one another at the very top of the output rather than each table, so is something like this possible in the data step or does a custom template have to be created? Could PROC REPORT
be a more viable option for custom frequencies?