BookmarkSubscribeRSS Feed
Uracsaslw
Calcite | Level 5
When trying to set a style that is not one of the defaults in EG I get the above Warning and my style is automatically converted back to normal style.

The solution it says is as follows:1.Close SAS Enterprise Guide. Add code similar to the following to the AUTOEXEC.SAS file on the SAS server:
proc template;
define style MyStyle_1;
parent=styles.analysis;
end;
run;

However when i add this information to the server file the code does not run at all.

Has anyone run into this error and have they found a solution as to successful add the above coding?
1 REPLY 1
ChrisHemedinger
Community Manager
You'll get the Style not Found message when you:
- Define a new custom CSS style using the EG Style Manager with a new name (such as "MyStyle"), and…
- You don't have a corresponding ODS STYLE on the server with the same name. You would have to define that using PROC TEMPLATE.

It's because EG generates ODS statements like:

ODS HTML STYLE=MyStyle STYLESHEET=(URL="path-to-styles\MyStyle.css")…

In this case, "STYLE=MyStyle" won't be found, because it doesn't exist as a style in any ODS template itemstore.

In 9.2, you can use PROC TEMPLATE to read in a CSS file and turn it into an ODS STYLE. However, there isn't a process in EG that makes that easy, so you would need to get the CSS file to the SAS session and then write the program yourself.

Placing that PROC TEMPLATE in the Autoexec might not be enough. You also need to make sure that the ODS PATH option is set to look in the appropriate place to resolve the styles. And sometimes SAS-server-based autoexec files don't initialize the session the way you would expect for EG use, so you might experiment with putting this code in the Tools->Options->SAS Programs->"Submit code on server connection" option.

Chris
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 815 views
  • 0 likes
  • 2 in conversation