In the program written the output statement is written outside the do loop. For this reason the code suggested looks like this one: data Calculation; set uu; mac=cats('A',1); mac=cats('A',2); ... ... output; run; for this reason the mac column is updated before sending in output the row corresponding to mac=A1. I would suggest to place the output statement inside the macro program if the expected result should contain one row for mac=A1 and one for mac=A2 for every row in dataset uu: %macro chk; data Calculation; set uu; %do i=1 %to &totobs; mac=cats('A',&i); value=&&A&i.; output; %end; run; %mend; %chk; %put &A1.; %put &A2.;
... View more