do you know how to use n in function LAGn(variable) that refer to another macro variable in the program-> max in my case?
data example1;
input value;
datalines;
1.0
3.0
1.0
1.0
4.0
1.0
1.0
2.0
4.0
2.0
;
proc means data=example1 max;
output out=example11 max=max;
run;
data example1;
%let n = max;
lagval=lag&n.(value);
run;
proc print data=example1;
run;
Thank you in advance! Wiola