So let's take this idea of not pre-quoting macro variables a step further.
Suppose I want to set up a macro that does the quoting and creating of a string for later use, so I don't have to edit Cynthia's %file1 macro each time I want to change the SQL. In other words, I want to put a %MEND after Cynthia's
%do i = 1 %to &numstr;
%if &i lt &numstr %then %let inlist = &inlist.&&word&i., ;
%else %if &i eq &numstr %then %let inlist = &inlist.&&word&i;
%end;
This could result in a general macro that I can use prior to any PROC SQL where such a list is needed. My solution, so far, has been to make &INLIST a %GLOBAL variable inside this macro, and then in the PROC SQL outside of the macro, I insert the %GLOBAL variable &INLIST into the SQL WHERE clause. Is there a better way to handle this?
... View more