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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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