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
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;
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.
Bruno,
This didn't work for me; I got the messages:
NOTE: No variables in data set WORK.TITLE.
NOTE: No variables in input data set.
Why not just use a BY statement?
Either just have the PROC write the BY header.
proc print data=test;
by src_date;
run;
Or use #BYVAL in your TITLE.
options nobyline;
title "list report for test #byval";
proc print data=test;
by src_date;
run;
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!
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.