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;

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 4648 views
  • 0 likes
  • 5 in conversation