This script uses the PROC FORMAT procedure to define conditional display rules for reports. It creates specific formats to control font colors (suffixes _f) and background colors (suffixes _b) based on specific data values ('YES', '3', '4', '5').
Data Analysis
Type : CREATION_INTERNE
The script does not manipulate data tables but generates metadata (formats) stored in the default format catalog.
1 Code Block
PROC FORMAT
Explanation : Definition of four character formats to apply visual styles. The formats associate values like 'YES' or severity codes (3, 4, 5) with color names (red, white, yellow, black), thus facilitating the creation of reports with visual alert indicators.
Copied!
proc format;
value $serious_f
'YES','yes' = 'white'
;
value $serious_b
'YES','yes' = 'red'
;
value $severity_f
'3' = 'black'
'4','5'= 'white'
;
value $severity_b
'3' = 'yellow'
'4','5'= 'red'
;
run;
1
PROC FORMAT;
2
value $serious_f
3
'YES','yes' = 'white'
4
;
5
value $serious_b
6
'YES','yes' = 'red'
7
;
8
value $severity_f
9
'3' = 'black'
10
'4','5'= 'white'
11
;
12
value $severity_b
13
'3' = 'yellow'
14
'4','5'= 'red'
15
;
16
RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.