Created
September 21, 2019 18:57
-
-
Save statgeek/2c516b2ad904c5209b0ef693f3e13e5d to your computer and use it in GitHub Desktop.
SAS - Preloadfmt - reporting values not in data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*This demonstrates how to ensure all levels are in your report | |
using the preloadfmt option*/ | |
data raw; | |
input person firsttest $ secondtest $; | |
datalines; | |
1 Good Good | |
2 Poor Good | |
3 Good Bad | |
4 Poor Bad | |
5 Poor Poor | |
; | |
run; | |
proc format; | |
value $ test_values | |
"Good" = "Good" | |
"Poor" = "Poor" | |
"Bad" = "Bad"; | |
run; | |
proc tabulate data=raw; | |
class firsttest secondtest / preloadfmt; | |
table firsttest, secondtest / misstext='0' printmiss; | |
format firsttest secondtest $test_values.; | |
run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment