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);
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.