BookmarkSubscribeRSS Feed
railfan1975
Fluorite | Level 6
I'm learning how to use PROC TEMPLATE to define a custom style. However, I'm getting an error I don't understand.

My code:
30 proc template;
31 define style styles.mystyle;
32 style table /
33 borderwidth = 1
34 bordercolor = red
35 color = blue
36 ;
37 end;
38 run;

The error:

30 proc template;
31 define style styles.mystyle;
32 style table /
33 borderwidth = 1
34 bordercolor = red
35 color = blue

_
22
76
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, ACTIVELINKCOLOR, BACKGROUND, BACKGROUNDIMAGE,
BORDERCOLOR, BORDERCOLORDARK, BORDERCOLORLIGHT, CONTRASTCOLOR, ENDCOLOR, FONT_FACE, FOREGROUND, IMAGE, LINKCOLOR,
NEUTRALCOLOR, POSTIMAGE, PREIMAGE, STARTCOLOR, VISITEDLINKCOLOR.
ERROR 76-322: Syntax error, statement will be ignored.
36 ;
37 end;
WARNING: Object will not be saved.
38 run;
4 REPLIES 4
Tim_SAS
Barite | Level 11
What SAS version? I think COLOR is not available until 9.2. Prior to that you use FOREGROUND, which I notice is one of the choices in the error message.
railfan1975
Fluorite | Level 6
Version 9.1.3

FOREGROUND will change the font color?
Cynthia_sas
Diamond | Level 26
Yes, in SAS 9.1.3, FOREGROUND is the correct attribute for the foreground color of the FONT.

To find the complete list, look in the SAS documentation for ODS under the topic: "Style Attributes and their Values".

cynthia
railfan1975
Fluorite | Level 6
It works! Thanks!

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
  • 4 replies
  • 1716 views
  • 0 likes
  • 3 in conversation