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

i tried turning off and on but all tables have the title. why is it not working like title statement does?

 

could this be a question that's asked on the exam? i don't understand how we're supposed to know this kind of thing. 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:
You need to add step boundaries so that procedures end cleanly. Here's what I mean -- when I use the correct step boundaries, the procedure titles work as expected. If you don't end the first PROC MEANS, the ODS NOPROCTITLE has a "halo" effect of one step, but the step is not clear, so that's why it doesn't work correctly. Add the step boundaries and the ODS PROCTITLE/NOPROCTITLE work as they are intended:

Cynthia_sas_0-1629986011989.png


Cynthia

View solution in original post

7 REPLIES 7
Cynthia_sas
SAS Super FREQ

Hi:

  We really hope that students will ask themselves "what if" or "how does that work" or "what happens when" questions and test things out. Here's an example:

Cynthia_sas_0-1629932778594.png

 

  The ODS PROCTITLE and ODS NOPROCTITLE statement is turned on or turned off by just issuing the statement before your procedure. Not all procedures have procedure titles. The DATA step doesn't use PROCTITLE for example and another example is PROC SORT, which doesn't produce any Results/Report output for display. When you ask why it's not working like the TITLE statement, it's not "global", it doesn't work with ANY procedure that produces output. It only works with what I jokingly refer to as the "self-announcing" procedures -- the ones that broadcast the procedure name in the Results/Report. The halo effect of the PROCTITLE (PTITLE) or NOPROCTITLE (NOPTITLE) ODS statement is that it acts like a toggle. When it's on (and it's on by default), it's on until you toggle it off. When it's off, it's off until you toggle it back on. That's sort of how TITLEs and FOOTNOTEs work too. Most people who are producing reports for publication just get into the habit of turning it off.


If you want to know what topics that could be on the certification exam, we recommend that you look at the Content Guide for the exam, here:

https://www.sas.com/content/dam/SAS/documents/technical/certification/content-guide/specialist-base-... .

Cynthia

 

jaliu
Quartz | Level 8

that's odd, because i tried turning off and on for the same proc procedure. i.e. the exact same code one with noproctitle and one with it turned on, yet both had the title. which led me to think that it does not work in the way you mention.

Panagiotis
SAS Employee

I think you are confusing the TITLE with the PROCTITLE.

 

The PROCTITLE is a title that essentially tells you what PROC you are using. Some have it. You can remove the PROC title with ODS NOPROCTITLE. Once you turn the option off, it stays off until you turn it back or you sign out and sign back into SAS.

 

The TITLE is some text you add using the TITLE statement. The TITLE statement is GLOBAL. So it's best practice after you add a title to some output, to clear the titles.

 

So this proc will have a title:

 

title "I am a title";

proc something...

title;   <-- clears title

 

This proc won't have a title:

proc something...

 

 

Try this code and play around with it.

 

 

title "I am the title";
title2 "Below me is the PROCTITLE. It says 'The MEANS Procedure'";
proc means data=sashelp.cars;
	var MPG_City;
run;

*clear titles*;
title;

* Remove the PROCTITLE *; ods noproctitle; title "I am the title"; title2 "Below me the PROCTITLE has been removed with ODS NOPROCTITLE"; proc means data=sashelp.cars; var MPG_City; run; *clear titles*; title;

proctitle.png

 

jaliu
Quartz | Level 8

I have done this again and it still does not work. once i turn ods proctitle back on, it displays the title for both means tables.

 

ods graphics on;

ods noproctitle;
proc means data= cert.penngolf;

ods proctitle;
proc means data= cert.penngolf;

 

 

Panagiotis
SAS Employee

I recommend reviewing the SAS Programming I course. It's free: https://support.sas.com/edu/schedules.html?crs=PROG1&ctry=US

 

For the title and footnote statements review: Lesson 5 - Section 1: Enhancing Reports with Titles, Footnotes, and Labels. It's the first video, Using Titles and Footnotes.

 

To see what ODS NOPROCTITLE does review: Lesson 5 - Section 2: Creating Frequency Reports. It's the first video, Demo: Creating Frequency Reports and Graphs.

 

- Peter

 

Cynthia_sas
SAS Super FREQ

Hi:
You need to add step boundaries so that procedures end cleanly. Here's what I mean -- when I use the correct step boundaries, the procedure titles work as expected. If you don't end the first PROC MEANS, the ODS NOPROCTITLE has a "halo" effect of one step, but the step is not clear, so that's why it doesn't work correctly. Add the step boundaries and the ODS PROCTITLE/NOPROCTITLE work as they are intended:

Cynthia_sas_0-1629986011989.png


Cynthia

jaliu
Quartz | Level 8
ah, my mistake. previously it did not matter if i used run so I didn't to save time. thank you.

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!

LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 1357 views
  • 0 likes
  • 3 in conversation