BookmarkSubscribeRSS Feed
Xamius32
Calcite | Level 5

   Basically, since some of the variables are so long they end up looking like scientific notation in excel, so I have to use the

var X /style(data)={tagattr='format:@'};

SO I want to print all the variables, but want to apply some styling options to just a few. How do I do that without writing var statements for all variables?

1 REPLY 1
Cynthia_sas
SAS Super FREQ

The only way to apply style to specific variables is to use multiple VAR statements. If you have multiple vars that you want to style the same, you can list them on the same VAR statement. So, for example, see the code below. You can set some overall defaults on the PROC PRINT statement, but individual variables with differing styles will need to be on separate VAR statements.
  

cynthia

ods tagsets.excelxp file='c:\temp\stylechange.xml' style=htmlblue;

   

proc print data=sashelp.shoes (obs=10)
  style(obsno)={background=pink color=navy}
  style(header)={background=pink}
  style(column)={font_face='Courier New'};
  var region / style(header)={background=darkblue color=yellow font_weight=bold}
               style(data)={background=darkblue color=yellow font_weight=bold};
  var subsidiary / style(header)={font_size=12pt font_weight=bold};
  var product / style(data)={background=lightyellow};
  var sales inventory returns / style(data)={background=grayaa font_size=12pt font_weight=bold};
run;

  

ods tagsets.excelxp close;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 800 views
  • 0 likes
  • 2 in conversation