Getting macro error (Need Help!!!)
Basically I tried to run below
%macro assign;
proc sql noprint;
select count(distinct(Identifier)) into :z
from &Olive_Schema..owner_metadata ;
quit;
%let z = &z;
%do j = 1 %to &z;
%LET Identify = &j;
Data test_& Identify;
Set test_&Identify;
Run;
It was running fine until here, then when introduced
proc sql noprint;
select count(distinct(weeks)) into :r
from iter1_&Identify ;
quit;
%let r = &r;
proc sql noprint;
select distinct weeks
into :t1 - :t&r.
from iter1_&Identify ;
quit;
%let r = &r;
%do i = 1 %to &r;
%LET ctr_wk = &&t&i;
Data test_&ctr_wk;
Set test;run;
%end;
%end;
%mend;
%assign;
WARNING: Apparent symbolic reference R not resolved.
ERROR: The text expression &R contains a recursive reference to the macro variable R. The macro variable will be assigned the null
value.
ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
ERROR: The %TO value of the %DO I loop is invalid.
ERROR: The macro ASSIGN will stop executing.