BookmarkSubscribeRSS Feed
Ram4sas
Fluorite | Level 6

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

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;

BrunoMueller
SAS Super FREQ

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=";
Barry_DeCicco
Calcite | Level 5

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.

Tom
Super User Tom
Super User

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;

 

sas-innovate-2024.png

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.

 

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
  • 4 replies
  • 3543 views
  • 0 likes
  • 5 in conversation