hi:
Proc REPORT, MEANS and TABULATE all support the use of the PRELOADFMT option which can be used to provide a list of the universe of values that you would like to see and then if you use that option in the appropriate way, with your user defined format, you will get the zero rows you want. Sadly, PROC FREQ does not support the PRELOADFMT usage.
Consider this data:
[pre]
data testdata;
input dest $ type $ amt;
cards;
SYDNEY TEL 900
SYDNEY TEL 800
RIO TRP 700
RIO TRP 600
MOSCOW TEL 500
MOSCOW WEB 600
MOSCOW TRP 700
DUBLIN TEL 800
DUBLIN TRP 900
. WEB 800
;
run;
[/pre]
Notice how we have TEL, TRP and WEB type of Sales, but we don't have any SLF (self-booked) sales types. Also, we have an data line with a missing city or DEST. And, each city has different combos of type values.
If you use PROC REPORT, you don't need to do PRELOADFMT right off the bat. You can try COMPLETEROWS first. But then you might need to use PRELOADFMT if you needed to have a "zero" row for the SLF type (Self-Booked) and there were no SLF rows in the data.
The programs below show the different ways that you can use either COMPLETEROWS or COMPLETEROWS with PRELOADFMT and PROC REPORT. An investigation of the documentation will show you about PRELOADFMT and TABULATE or MEANS. This examples shows getting the SUM of AMT, but you could just as easily have changed the statistic to N for amt or just coded the N statistic on the column statement for PROC REPORT.
cynthia
[pre]
proc format;
value $tktfmt 'TEL'='Telephone Agent (Airline Employee)'
'WEB'='On-line Agent (Airline Employee)'
'TRP'='Travel Agent (Private Company)'
'SLF'='Free Agent (SELF Booked) ';
run;
*** Default PROC REPORT Behavior ***;
proc report data=testdata nowd missing;
column dest type amt;
define dest / group 'DEST';
define type / group 'TYPE' format=$tktfmt.;
define amt / analysis sum 'AMT';
break after dest /skip;
rbreak after / summarize ul ol;
title1 'PROC REPORT Default Behavior';
run;
*** Completerows ONLY ***;
proc report data=testdata nowd completerows missing;
column dest type amt;
define dest / group 'DEST';
define type / group 'TYPE' format=$tktfmt. ;
define amt / analysis sum 'AMT';
break after dest /skip;
rbreak after / summarize ul ol;
title1 'PROC REPORT with COMPLETEROWS option';
run;
*** Completerows with PRELOADFMT ***;
proc report data=testdata nowd completerows missing;
column dest type amt;
define dest / group 'DEST';
define type / group 'TYPE' format=$tktfmt. preloadfmt;
define amt / analysis sum 'AMT';
break after dest /skip;
rbreak after / summarize ul ol;
title1 'PROC REPORT with COMPLETEROWS and PRELOADFMT option';
run;
[/pre]