BookmarkSubscribeRSS Feed
Eric_P_Elkin
Calcite | Level 5

Long time SAS user here. I've been working in SAS Studio that last three years. One thing I can't figure out:  TITLE statement no longer seems to function as a global statement in this environment.  Can anyone confirm that? I tried searching but couldn't find anything on SAS support to find the answer.

 

Example 1:  I can run this and get two titles in my output


title1 "This is TITLE 1";
title2 "This is TITLE 2";

proc freq data=analy;
tables var1 var2;
run;

 

Example 2: If I run it like this, I get Title1 for my first proc freq and Title2 ONLY for my second proc freq. I would expect to see Title1 and Title2 for the second proc freq. This is how it would work in SAS EG or PC-SAS.

 

title1 "This is TITLE 1";

proc freq data=analy;
tables var1 var2;
run;

 

title2 "This is TITLE 2";

proc freq data=analy;
tables var3 var4;
run;

 

 

4 REPLIES 4
Tom
Super User Tom
Super User

Are you submitting one block of code?  If so then you should see normal behavior.

If you are submitting sending it as two separate submissions then the code that SAS/Studio adds before and after your code is what is clearing the title settings.

 

You can tell SAS/Studio to go into "interactive" mode and it will not clear the titles between submission.

Tom_0-1729271281683.png

 

antonbcristina
SAS Super FREQ

Hi @Eric_P_Elkin, in SAS Studio the wrapper code includes a null TITLE and FOOTNOTE statement (among other things) to clear all titles and footnotes. The wrapper code is included with every run. You can view this wrapper code in SAS Studio by navigating to More Options (three dot menu at the top right of the editor window) > Open in a browser tab > Log.

 

My program has this at lines 10-11.

antonbcristina_3-1729271665429.png

 

 

This means that when I run (a version) of your program all together (i.e. both steps together), I get the following:

antonbcristina_0-1729271110406.png

 

However, if I run them separately I'll see the titles as you described. 

antonbcristina_1-1729271233449.png

and 

antonbcristina_2-1729271249055.png

 

 

Eric_P_Elkin
Calcite | Level 5

Thanks for the info/suggestions! Makes sense.

PaulMcDonald-AZ
Calcite | Level 5

I've always said that SAS Documentation puts the TITLE statements in the wrong place.  FOOTNOTE too.  They really do belong outside/above the PROC and not inside/within.

TITLE1 'SAS Baseball data' ;
proc print data=sashelp.baseball ;

run ;

But the documentation always shows this...
proc print data=sashelp.baseball ;

   TITLE1 'SAS Baseball data' ;

run ;

 

The TITLE statement declared remains in place until changed.  Logically, it belongs outside the PROC and not inside the PROC.  So far, they haven't listened to me on that one...


sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1643 views
  • 4 likes
  • 4 in conversation