07-10-2014 03:52 AM
I am facing a problem with macro variable naming. I couldn't figure out what do you call situations like this but I have attached a sample code.
The issue is that I need to get the variable model on the data foo to resolve to the macro variable model_&&multi&i.
I have tried almost everything I can come up with(&&model_&&multi&i,&&&model_&&multi&i etc.), but probably my limited under the hood knowledge on macro variables is the issue.
07-10-2014 04:13 AM
Have you tried doing it in stages?
If you break it into several steps, you can inspect the contents of the variables with %put, or use options symbolgen;
07-10-2014 04:34 AM
The last %put shows some_content.
07-10-2014 04:23 AM
Not knowing exactly what you are trying to achieve why not something like:
proc sql; /* Create a dataset which has you loop values (so this &n_multi) */
create table LOOP as
data _null_; /* Using the dataset you created above, generate a bit of code for each observation in that dataset
with the code and the loop variable */
call execute('data foo;