BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mmea
Quartz | Level 8

Hi 

I would like to put the current date in one title 

currentdate +1 in the next title

currentdate+2 in the third title

 

I tried this

but it do not work;

%let day = %sysfunc(putn("&sysdate"d, ddmmyy10.));
%let day = &day;


title height=15pt color=Black  'TEST  &day &sysdate.';

title2 j=l color=gray  'TEST &day &sysdate+1 ';


proc report ..............
1 ACCEPTED SOLUTION

Accepted Solutions
mmea
Quartz | Level 8


ods pdf notoc file="test_&todaysDate..pdf" ;
ods escapechar="^";


%let day1 = %sysfunc(putn(%sysfunc(today())    , ddmmyy10.));
%let day2 = %sysfunc(putn(%sysfunc(today()) + 1, ddmmyy10.));
%let day3 = %sysfunc(putn(%sysfunc(today()) + 2, ddmmyy10.));

%put &day1. &day2. &day3.;

title height=15pt color=Black  ' &day1.';
title2 j=l color=gray  ' &day1.';
title3 j=l color=gray  ' &day2.';
title4 j=l color=gray  ' &day3.';


options mprint;
title;


proc format;
    value colorf 0=#CBE5A1  1=#FFFF00  1-high = Firebrick;
run;

proc report data=Comp style(header) = {background = lightgray color = black};
	    columns hej nej leg day;
	    define hej /'hej ' group style(column)= [background = lightgray fontsize=2 font_weight = bold] style(header) = {background = lightgray frame=void};
		compute after region / style={bordertopcolor=black borderbottomcolor=black height=1px cellpadding=0};
        line ' '; 
        endcomp;
	    define nej / 'nej ' group style(column)= [background = lightgray fontsize=2] style(header) = {background = lightgray frame=void} ;
		define leg / 'leg ' group style(column)= [background = lightgray fontsize=2] style(header) = {background = lightgray frame=void};
		define day/' dage' group max style(column)= [background = lightgray fontsize=0.5 frame=void] style={background=colorf.} style(header) = {background = lightgray frame=void};
		
	run;


title;
ods pdf close;
ods _all_ close;

View solution in original post

6 REPLIES 6
PeterClemmensen
Tourmaline | Level 20

See if you can use this as a template 🙂

 

%let day1 = %sysfunc(putn(%sysfunc(today())    , ddmmyy10.));
%let day2 = %sysfunc(putn(%sysfunc(today()) + 1, ddmmyy10.));
%let day3 = %sysfunc(putn(%sysfunc(today()) + 2, ddmmyy10.));

%put &day1. &day2. &day3.;

title  "&day1.";
title2 "&day2.";
title3 "&day3.";

proc report data=sashelp.class;
run;

title;

mmea
Quartz | Level 8


ods pdf notoc file="test_&todaysDate..pdf" ;
ods escapechar="^";


%let day1 = %sysfunc(putn(%sysfunc(today())    , ddmmyy10.));
%let day2 = %sysfunc(putn(%sysfunc(today()) + 1, ddmmyy10.));
%let day3 = %sysfunc(putn(%sysfunc(today()) + 2, ddmmyy10.));

%put &day1. &day2. &day3.;

title height=15pt color=Black  ' &day1.';
title2 j=l color=gray  ' &day1.';
title3 j=l color=gray  ' &day2.';
title4 j=l color=gray  ' &day3.';


options mprint;
title;


proc format;
    value colorf 0=#CBE5A1  1=#FFFF00  1-high = Firebrick;
run;

proc report data=Comp style(header) = {background = lightgray color = black};
	    columns hej nej leg day;
	    define hej /'hej ' group style(column)= [background = lightgray fontsize=2 font_weight = bold] style(header) = {background = lightgray frame=void};
		compute after region / style={bordertopcolor=black borderbottomcolor=black height=1px cellpadding=0};
        line ' '; 
        endcomp;
	    define nej / 'nej ' group style(column)= [background = lightgray fontsize=2] style(header) = {background = lightgray frame=void} ;
		define leg / 'leg ' group style(column)= [background = lightgray fontsize=2] style(header) = {background = lightgray frame=void};
		define day/' dage' group max style(column)= [background = lightgray fontsize=0.5 frame=void] style={background=colorf.} style(header) = {background = lightgray frame=void};
		
	run;


title;
ods pdf close;
ods _all_ close;

PeterClemmensen
Tourmaline | Level 20

I'm guessing there is a question here?

 

Remember to put macro variables in double quotation marks. Macro variables do not resolve in single quotation marks 🙂

Astounding
PROC Star
Use double quotes, not single quotes. Macro variable references in single quotes will not be resolved.
PeterClemmensen
Tourmaline | Level 20

@mmea Did this solve your problem?

mmea
Quartz | Level 8

YES - SORRY!

SAS Innovate 2025: Call for Content

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1775 views
  • 3 likes
  • 3 in conversation