DATA Step, Macro, Functions and more

Change title in Results Viewer (ODSRESULTS) for output from RSUBMIT

Reply
Occasional Contributor
Posts: 19

Change title in Results Viewer (ODSRESULTS) for output from RSUBMIT

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.

Super User
Posts: 24,026

Re: Change title in Results Viewer (ODSRESULTS) for output from RSUBMIT

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...

Occasional Contributor
Posts: 19

Re: Change title in Results Viewer (ODSRESULTS) for output from RSUBMIT

[ Edited ]
@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.

 

Ask a Question
Discussion stats
  • 2 replies
  • 123 views
  • 0 likes
  • 2 in conversation