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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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