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;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3034 views
  • 2 likes
  • 3 in conversation