Published on :
Reporting CREATION_INTERNE

Defining Conditional Formatting Formats

This code is also available in: Deutsch Español Français
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!
1PROC 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.