BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DavidPhillips2
Rhodochrosite | Level 12

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";

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19
proc format;
  
value dLvl 1='Baccalaureate';
  
run;
title "Only %sysfunc(putn(1,dlvl))";
proc print data=sashelp.class;
   run;

View solution in original post

5 REPLIES 5
data_null__
Jade | Level 19

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

DavidPhillips2
Rhodochrosite | Level 12

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';

data_null__
Jade | Level 19
proc format;
  
value dLvl 1='Baccalaureate';
  
run;
title "Only %sysfunc(putn(1,dlvl))";
proc print data=sashelp.class;
   run;
DavidPhillips2
Rhodochrosite | Level 12

Data null,

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

data_null__
Jade | Level 19

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;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 5 replies
  • 2406 views
  • 1 like
  • 2 in conversation