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
Diamond | Level 26

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;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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