Help using Base SAS procedures

How do I hold a place in a table where there is no value?

Reply
N/A
Posts: 0

How do I hold a place in a table where there is no value?

For example, here is my code:

proc freq data=basedata1;
table satcat*apply/nocol norow nopercent missprint;
where hold=1 and reside=1;
format satcat satcat.;
run;

Output:

Table of SATCat by APPLY
SATCat APPLY(apply) Total
1.00
1000-1090 8 8
<1000 165 165
Total 173 173

What I want to do is have the output table also include the other values of the variable SATcat in which there are no observations(in this particular subset of the data) so that the output looks something like this:

Table of SATCat by APPLY
SATCat APPLY(apply) Total
1.00
>1200
1100-1190
1000-1090 8 8
<1000 165 165
Total 173 173

(Other tables I produce use similar variables and subset the data differently so that I end up with observations in all the levels of SATcat and I'm trying to make all of my tables look the same.)

Any ideas? I would also love to know if this can be done in PROC Tabulate as well.
SAS Super FREQ
Posts: 8,743

Re: How do I hold a place in a table where there is no value?

Hi,
You're on the right track, asking about PROC TABULATE. TABULATE, REPORT and MEANS are all procedures that support the use of the PRELOADFMT option -- which allows you to tell the procedures what list of values you'd LIKE to see in the output, even if some of the list does not appear in the data. PROC FREQ does -not- use the PRELOADFMT option.

Some prior forums postings on the topic of PRELOADFMT are:
http://support.sas.com/forums/thread.jspa?messageID=19957䷵
http://support.sas.com/forums/thread.jspa?messageID=14459㡻
http://support.sas.com/forums/thread.jspa?messageID=4872ገ

cynthia
N/A
Posts: 0

Re: How do I hold a place in a table where there is no value?

Thank you, I will look into PRELOADFMT.
N/A
Posts: 0

Re: How do I hold a place in a table where there is no value?

I tried using PRELOADFMT for a proc tabulate procedure and it worked great, thank you! Anyone have any ideas on doing something similar using proc freq?
Ask a Question
Discussion stats
  • 3 replies
  • 90 views
  • 0 likes
  • 2 in conversation