BookmarkSubscribeRSS Feed
beacon
Obsidian | Level 7

Hi,

 

I'm working with a program that uses a macro in an RSUBMIT to run a PROC SQL statement to get a count for multiple tables in a database. When the results are displayed in the Results Viewer (ODSRESULTS) window, the default title is "The SAS System".

 

I tried using the TITLE statement to change the title, but the title only changes in the Output window. Is there a way to change the title in the Results Viewer for results that are produced during an RSUBMIT?

 

I'd prefer not to save the ODS output to a file on the remote server, download it locally, and display it in the Results Viewer window, if possible.

 

Here's an example of my code:

 

RSUBMIT;

%MACRO CheckTable(tableName);
  PROC SQL;
    /* Title example output: "CustomersTbl Count" */
    TITLE &=tableName. Count;                /* This only sets the title in the Output window */
    SELECT
        COUNT(*) AS TOTAL_COUNT
    FROM
        &tableName. t1
    ;
  QUIT;
%MEND;

ENDRSUBMIT;

RSUBMIT;

%CheckTable(CustomersTbl);
%CheckTable(OrdersTbl);
%CheckTable(ProductsTbl);

ENDRSUBMIT;

 

Thanks.

2 REPLIES 2
Reeza
Super User

Shouldn't your title statement be enclosed in quotes? And no equal signs?

 

title "&tableName. Record Count";

I'm assuming you also know you can get this information from the SASHELP.VTABLE instead of querying each table? Unless it's on a server then you have to do it this way...

beacon
Obsidian | Level 7
@Reeza wrote:

Shouldn't your title statement be enclosed in quotes? And no equal signs?


 

@Reeza, you're right. I forgot the quotes when I was typing and the equal sign is a typo. The actual code I was using to test has quotes and no equal sign. My apologies for the mistake in the post.

 

That being said, the title still does not change in the Results Viewer window. It changes in the Output window, but not the Results Viewer. Is there a way to get the title to change from "The SAS System" in the Results Viewer to the desired title in an RSUBMIT (without having to download anything)?

 


@Reezawrote:

I'm assuming you also know you can get this information from the SASHELP.VTABLE instead of querying each table? Unless it's on a server then you have to do it this way...


 

Yes, everything I'm working with for this particular issue is on the server.

 

Thanks.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 1557 views
  • 0 likes
  • 2 in conversation