You will have a timing issue when using a macro %let statement in a data step. The %let statement will get executed before the data step so it won't be part of the data step iteration and you also can't pass a SAS data step variable to the %let statement. There your "i" will simply be interpreted as the character 'i'. Not sure why you need a macro at all but as this is a code snippet reality might look different and there are good reasons for a macro. Below should make your code snippet work: %macro DefineInputArray; ARRAY BYLINE(50) $16. BYLINE1 - BYLINE50; array iVal (50) %do i=1 %to 50; %let iter = %eval(1000+(&i-1)*1000); iVALUE&iter %end; %str(;) %mend; data sims; set data_inputs; %DefineInputArray; do i=1 to dim(BYLINE); BYLINE = iVALUE; end; run;
... View more