Did you know that if you have set multiple titles in SAS, that there is an easy way to remove them?
For example, suppose that you've written the following statements, which call the TITLE statement to set three titles:
title "A Great Big Papa Title"; title2 "A Medium-sized Mama Title"; title3 "A Wee Little Baby Title"; proc sgplot data=Sashelp.Cars; vbar Origin; run;
Now suppose that you want to remove the values of the TITLEn statements. I have always used three statements to remove the values for the TITLE, TITLE2, and TITLE3 statements, as follows:
title; /* cancel the TITLE statement */ title2; /* cancel the TITLE2 statement */ title3; /* cancel the TITLE3 statement */
However, a SAS colleague informed me that there is an easier way. It turns out that a TITLEn statement clears titles at level n and higher. That is, you do not need to submit a blank TITLE2 and TITLE3 statements. The TITLE statement is sufficient to remove the first-level title as well as all higher-order titles, so you can write the following statement:
title; /* cancel the TITLE, TITLE2, and TITLE3 statements */
Oh, and in case you are wondering, the same tip applies to the FOOTNOTE statement. When you cancel a FOOTNOTE statement, all higher-order footnotes are also canceled.
Do you know any cool tips for setting or clearing global SAS statements? Share a tip in the comments.