Hello, I am somewhat new to SAS programming and pretty confused about SAS macros. I hope you can help me out. I am trying to create a dataset containing locations for different files. In order to do that I have a dataset loop which executes a macro that assigns the path. %macro chosepath(i); %global path; %if &i = 1 %then %let path = path_1; %if &i = 2 %then %let path = path_2; %else %let path = nopath; %mend chosepath; data dataset; do i = 1 to 2; %chosepath(i); pathvar = "&path"; output; end; run; The problems is that the %if statements are never true. In stead of feeding the iterator (1, 2 ..) to the macro it always gets the iterator name (i). Is there any way for the macro to get the actual value?
... View more