Hi, I was trying to write some macro in sas. However, it is not working. Here is the code. * %macro product(num, v1, v2, v3, v4, v5, v6, v7, v8); %macro product(num, variable1-variable&n); %let produc = 0; %let variable = 'var'; %do j = 1 %to # %let k=j; &produc = &produc + j * v&k; %end; %mend product; %let n = 8; %let prod = 162; data zeo_corr.perm&n (keep= var1 - var&n produc) length default = 3; array a{&n} var1-var&n; do j = 1 to 10000; do i = 1 to &n; a[i]=j; end; %product(&n, var1- var&n); * %product(&n, var1, var2, var3, var4, var5, var6, var7, var8); if produc = &prod then output; end; run; it is showing the following error NOTE: Line generated by the macro variable "PRODUC". 1 0 - 180 ERROR 180-322: Statement is not valid or it is used out of proper order. or ERROR: More positional parameters found than defined. Where is the problem? Please suggest me the possible solution.
... View more