Adding Traffic Lighting to PROC REPORT Table Values

What do traffic lights have to do with SAS output? The answer is that you can highlight results in your output using the familiar red, yellow, and green lights. You can use red for bad results, yellow for neutral results, and green for good results. If you're creating a large table, this technique is great for focusing the reader's attention on the key results.

In this example, we take our familiar table from the first few examples in this chapter and apply traffic lighting to mark low prices in green, high prices in red, and prices in between in yellow. This is done with a COMPUTE block on the variable PRICE. Within the COMPUTE block, a series of IF, THEN, ELSE statements assign the foreground ...

Get Output Delivery System: The Basics and Beyond now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.