Hi,
I have currently got the following code below, but can someone please help me change the text that I have currently got highlighted in red, so that the title for each month of my results will be included, so that it should say "February 2020 - Differences between open date and register" and "January 2020 - Differences between open date and register"? Thanks!
Code
%macro monthly_check(month_yyyy,startdt,enddt);
data &month_yyyy. ;
set test;
where "&startdt."d <= OPEN_DATE <= "&enddt."d;
Difference = intck('MONTH',OPEN_DATE,REGISTER);
run;
proc freq data=&month_yyyy. ;
title '&month_yyyy. - Differences between open date and register';
table Difference;
run;
title;
%mend monthly_check;
%monthly_check(February2020,01Feb2020,29Feb2020);
%monthly_check(January2020,01Jan2020,31Jan2020);
If you want macro variables to resolve, you need to use double quotes; single quotes prevent any resolution of macro triggers.
If you want macro variables to resolve, you need to use double quotes; single quotes prevent any resolution of macro triggers.
For macro variables to resolve they need to be in double quotes.
%macro monthly_check(month_yyyy,startdt,enddt);
data &month_yyyy.;
set test;
where "&startdt."d <= OPEN_DATE <= "&enddt."d;
Difference = intck('MONTH',OPEN_DATE,REGISTER);
run;
title "&month_yyyy. - Differences between open date and register";
proc freq data=&month_yyyy.;
table Difference;
run;
title;
%mend monthly_check;
%monthly_check(February2020,01Feb2020,29Feb2020);
%monthly_check(January2020,01Jan2020,31Jan2020);
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.