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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

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