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.

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!

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