BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GRP_Canada
Calcite | Level 5

Hi...

 

I have been using PROC FREQ as part of data validation (SAS EG7).  However, as samples of all my variable splits are not always present my output will typically have lines omitted.  As a result, I have to manually adjust in Excel to capture any missing outcomes

 

I am looking for a solution which will show ALL of the variable outcomes regardless if there was data present or not

 

thanks!

 

proc freq data= temp_sas;

table risk_calc * score /nopercent nocol nocum norow missing;

run;

 

The full list of outcomes for the variables should be:

- risk_calc (which is derived based on the product, length of time as customer, scores, etc..)

'A.1EMN1','A.2EMN2','A.3EMN3','A.4EYN1','A.5EYN2','A.6EYN3','A.7ENN3'

- score: 

'000-164','165-169','170-194','195-199','200-204','205-209','210-219','220-224','225-229',

'230-234','235-239','240-244','245-249','250-269','270+'

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

With PROC MEANS and PROC REPORT and PROC TABULATE, you can use the PRELOADFMT option. I don't know if it works with PROC FREQ. Here is an example using PROC MEANS: https://documentation.sas.com/?docsetId=proc&docsetTarget=n1eseaucwkzo18n1nph31op5kkdt.htm&docsetVer...

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

With PROC MEANS and PROC REPORT and PROC TABULATE, you can use the PRELOADFMT option. I don't know if it works with PROC FREQ. Here is an example using PROC MEANS: https://documentation.sas.com/?docsetId=proc&docsetTarget=n1eseaucwkzo18n1nph31op5kkdt.htm&docsetVer...

--
Paige Miller
GRP_Canada
Calcite | Level 5

Good suggestion - I switched over to PROC TABULATE and added PRELOADFMT - looks good!

 

Thanks!

Ksharp
Super User
data levels;
input sex $;
cards;
F
M
N
;

data have;
 set sashelp.class(in=ina) levels;
 w=ina;
run;
proc freq data=have;
table sex/norow nocol nocum nopercent missing missprint; 
weight w/zeros;
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2144 views
  • 2 likes
  • 3 in conversation