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+'
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...
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...
Good suggestion - I switched over to PROC TABULATE and added PRELOADFMT - looks good!
Thanks!
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;
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!
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.