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;

 

 

3 REPLIES 3
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 Employee

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.

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 134 views
  • 4 likes
  • 3 in conversation