I am trying to create a local macro variable with the %LET statement, the value of which is a macro variable that requires multiple ampersands to resolve. SAS is not resolving the multiple ampersands before assigning the name of the local macro variable.
%macro example;
%do i=1 %to %sysevalf(&max_n);
%let dg= &&max_&i..;
{stuff happens here}
%end;
%mend;
%example;
For example, &max_1. resolves to APPLE which I use in the {stuff happens here} portion of the code. However, SAS is giving me the warning "WARNING: Apparent symbolic reference MAX_ not resolved." And the DG macro variable is returning &&max_1 through &&max_17. Calling &DG. at this point will return &&max_1 which will resolve to APPLE on its own, but this will not work with the syntax in the code I'm not showing.
Any idea how to make the macro variable so that &DG. will return APPLE?