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;
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.
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.
This means that when I run (a version) of your program all together (i.e. both steps together), I get the following:
However, if I run them separately I'll see the titles as you described.
and
Thanks for the info/suggestions! Makes sense.
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 25. Read more here about why you should contribute and what is in it for you!
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.