BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am trying to change the background color in styles.brick.
PROC TEMPLATE;
DEFINE STYLE STYLES.BRICKA;
PARENT = STYLES.BRICK;

REPLACE COLOR_LIST /
'BGA1' = CXAFE6E9
;
END;
ODS PATH SASUSER.TEMPLAT(UPDATE) SASHELP.TMPLMST(READ);
ODS LISTING CLOSE;
ODS NOPROCTITLE ;
ODS PDF FILE = DISK
STYLE=STYLES.BRICKA
I get many messages like this:
WARNING: Could not locate style reference 'default.colors("docfg")'.

What am I missing?
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi --
Your issue has nothing to do with the mainframe. It has to do with how you're specifying your new style. When you use the REPLACE statement, you must RESPECIFY all the style attributes for the style element that you're replacing. In this case, the style element is "COLOR_LIST" and you are trying to change the background color.

The paper might prove instructive to help you solve this problem:
http://www2.sas.com/proceedings/sugi27/p186-27.pdf
It shows the use of the REPLACE statement and RESPECIFYing ALL the style attributes. "Unable to find" messages happen because inheritance is resolved differently in SAS 8 and SAS 9 (right now) when you use the REPLACE statement. In fact, STYLES.BRICK shows you that you must RESPECIFY all the style attributes when you use REPLACE because it contains a REPLACE for COLOR_LIST. If you cut and paste the entire COLOR_LIST section from the existing STYLES.BRICK and put it into your program, and then change the BGA1 attribute, you will get a table background that is a lovely color of light blue.

Starting in SAS 9.2, the REPLACE statement behavior will change and REPLACE will essentially act like the STYLE statement as far as style template inheritance is concerned, as described here:
http://www2.sas.com/proceedings/sugi31/053-31.pdf

Good luck! If you need more help with your style template, then Tech Support is your best bet for help. Template code is lengthy.

cynthia
deleted_user
Not applicable
Thank you very much

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1132 views
  • 0 likes
  • 2 in conversation