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 ..............
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;
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;
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;
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 🙂
@mmea Did this solve your problem?
YES - SORRY!
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.