I have a program which uses a input as %let reportdate = Q3 2022; And I having difficulties getting a readable datetime format from it. The code I have written is as follows: %let reportdate = Q3 2022; %macro date_loop(report_date);
%let rep_date = %sysfunc(intnx('quarter', %sysfunc(input(&report_date, yyq6.)), 0)); /*%let date = %sysfunc(inputn(%qscan(&report_date,1,%str( )),yyq.));*/
%do i = 1 %to 3;
%let month_start = %sysfunc(intnx('month', &rep_date, i-1, 'beginning'));
%let month_end = %sysfunc(intnx('month', &rep_date, i-1, 'end'));
%put &=month_start;
%put &=month_end;
%end;
%mend;
%date_loop(&reportdate); I have been looking at using the %qscan function but have had no luck. Would appreciate some guidance and just some generell tips and tricks. With kind regards, Fredrik
... View more