I'm curious as to why some functions cannot interpret the character type of a macro variable correctly.
Here's a sample program
%let yymm = 1905;
data tst;
reportDate = input(&yymm.,yymmn4.);
run;
will produce a numeric value, reportDate, with a null associated with it.
But either of the following programs:
data tst;
reportDate = input("&yymm.",yymmn4.);
run;
data tst;
reportDate = input(put(&yymm.,4.),yymmn4.);
run;
will result in the correct value, 21670.
Since macro variables always resolve as characters, why can't the input function resolve the macro variable reference correctly? The first argument requires a character value, which the resolved reference &yymm. is. I've always been curious about this functionality.