BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
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
deleted_user
Not applicable
Thank you, I will look into PRELOADFMT.
deleted_user
Not applicable
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?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 554 views
  • 0 likes
  • 2 in conversation