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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.