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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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