🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 04-10-2015 03:08 PM
(2624 views)
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc format;
value dLvl 1='Baccalaureate';
run;
title "Only %sysfunc(putn(1,dlvl))";
proc print data=sashelp.class;
run;
value dLvl 1='Baccalaureate';
run;
title "Only %sysfunc(putn(1,dlvl))";
proc print data=sashelp.class;
run;
5 REPLIES 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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';
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc format;
value dLvl 1='Baccalaureate';
run;
title "Only %sysfunc(putn(1,dlvl))";
proc print data=sashelp.class;
run;
value dLvl 1='Baccalaureate';
run;
title "Only %sysfunc(putn(1,dlvl))";
proc print data=sashelp.class;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Data null,
Thanks for helping me out. I was querying the value or storing the value without needing to, this will help with efficiency.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
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;