|
Hello, everyone! Just a quick question for you all on macro
variables; I appreciate your assistance and thank you in advance for
your help.
Working inside of a macro, I'd like to process some data sets using a
do loop. I'd also like to have a variable within the do loop that's
based on the value of the control variable. Specifically, I'd like
the loop control variable to run from 1 to 11, and the inside variable
to run from 2 to 12, each incrementing by 1 each time through the
loop. In my mistaken brain, the code looks something like this:
%do i=1 %to 11;
%let j=&i+1;
data both;
merge code_per&i._replicates code_per&j._replicates;
However, the log file gives me an error, with the following message:
NOTE: Line generated by the macro variable "J".
186 code_per1+1_replicates
How can I get SAS to read this as code_per2_replicates instead? Any
thoughts? Thanks!
- Hoxie Ackerman
PS. I realize that this would seem to overwrite "both," which is
something I'm not concerned about; I run some procedures on "both" and
collect the output using code not included in this message, then
delete "both" before the next iteration.
|