Hi,
I'm trying to calculate time interval between two days stroed as macro variables like this:
%let start_date = %sysfunc(mdy(12,31,2018));
%let end_date = %sysfunc(mdy(12,31,2019));
%let dif = %sysfunc(intck('qtr', &start_date, &end_date));
But I get an error saying:
WARNING: An argument to the function INTCK referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range. NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set to a missing value.
IF I do it in a data step, it works, so I guess there is some issue with the macro variable assignment?
data test;
input start_date :date. end_date :date.;
datalines;
"31dec2018"d "31dec2019"d
;
run;
data test;
set test;
dif = intck('qtr', start_date, end_date);
run;
... View more