BookmarkSubscribeRSS Feed
Kastchei
Pyrite | Level 9
Is there a way, within a template, to specify ODS to justify character data differently from numeric data? If left to default, character is left and numeric is right. However, since justify=on for most destinations, my decimals are not lined up. I would like to specify all numeric data to be just=d without affecting my character variables. Setting

parent = styles.printer;
replace Data from Cell "Default style for data cells in columns." /
just = d;

causes my character data to all be right justified.

Thanks.
1 REPLY 1
Kevin_SAS
SAS Employee
In 9.2 there is the capability of aligning columns based on their data type. There is a table template called Base.Template.Table that all table templates inherit from. If you define that table template as follows, it should do what you want.

proc template;
define table base.template.table;
cellstyle _datatype_ = 'num' as {just=d};
end;
run;

This doesn't apply to Proc Tabulate, Proc Report, or Proc Print though because they do not use table templates.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 1399 views
  • 0 likes
  • 2 in conversation