can we print title statement without using proc statement

Reply
Frequent Contributor
Posts: 90

can we print title statement without using proc statement

Hi All,

I have below code to print title statement and test data set records.

data _null_;  set work.test;

call symput('source_date' left(put(src_date, data9.)));

stop; run;

PROC PRINT Data=Test;

title "list report for test &source_date";   RUN;

I would like to print only TITLE statement text , means dont want display 'Test' data set records using PROC PRINT Data=Test;RUN;


I have removed PROC PRINT Data=test; RUN; and rest executed.


data _null_

set work.test;

call symput('source_date' left(put(src_date, data9.)));

stop;

run;

Title "list report for test &source_date";

Result = No Error, but output blank.

is there any function or option to print title statement in result window?

Thx- Ravi

Super User
Super User
Posts: 7,977

Re: can we print title statement without using proc statement

Hi,

Instead of call symput and the title step, why not just put that information into a dataset and then print that.  E.g.

data list_of_titles;

     attrib title_text format=$2000.;

     set work.test;

     title_text="list report for test "||left(put(src_date, data9.));

run;

proc print data=list_of_titles;

     title "list report for all rows from test";

run;

SAS Super FREQ
Posts: 708

Re: can we print title statement without using proc statement

You can use Proc REPORT with the NOHEADER option or depending on the ODS desination make use of the ODS text="", see sample below. The TITLE statement will not produce output without some Proc printing something.

data title;
  title = "This is my title Proc Report";
run;

proc report data=title nowindows noheader nocenter
 
style(column) = { background=yellow };
run;

ods text="this is my title ods text=";
Ask a Question
Discussion stats
  • 2 replies
  • 240 views
  • 0 likes
  • 3 in conversation