Your SAS programs, embedded in web apps and elsewhere

Format Title

Accepted Solution Solved
Reply
Super Contributor
Posts: 477
Accepted Solution

Format Title

Is there a way to use a format a title similarly to how data can be formatted?

The closest thing in syntax I can think of that does not work is.

title="%Put(&max_level_name sLev.)  only";


Accepted Solutions
Solution
‎04-10-2015 03:45 PM
Respected Advisor
Posts: 3,777

Re: Format Title

proc format;
  
value dLvl 1='Baccalaureate';
  
run;
title "Only %sysfunc(putn(1,dlvl))";
proc print data=sashelp.class;
   run;

View solution in original post


All Replies
Respected Advisor
Posts: 3,777

Re: Format Title

There are options to control the look of the text in a title statement and you can also put BY variables and their values in titles.

SAS(R) 9.4 ODS Graphics: Procedures Guide, Fourth Edition

Super Contributor
Posts: 477

Re: Format Title

Rewording a little.

In SAS 9.2 I’m trying to make a title statement of

Title = “only 1”;

To display

Only Baccalaureate

Using a structure like

value dLvl

1='Baccalaureate';

Solution
‎04-10-2015 03:45 PM
Respected Advisor
Posts: 3,777

Re: Format Title

proc format;
  
value dLvl 1='Baccalaureate';
  
run;
title "Only %sysfunc(putn(1,dlvl))";
proc print data=sashelp.class;
   run;
Super Contributor
Posts: 477

Re: Format Title

Data null,

Thanks for helping me out. I was querying the value or storing the value without needing to, this will help with efficiency.

Respected Advisor
Posts: 3,777

Re: Format Title

Alternatively.

data class;
   set sashelp.class;
   retain dlvl 1;
proc format;
  
value dLvl 1='Baccalaureate';
  
run;
options byline=0;
title "Only #byval1";
proc print data=class;
   by dlvl;
   format dlvl dlvl.;
  
run;
options byline=1;
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 960 views
  • 0 likes
  • 2 in conversation