@ChrisBrooks wrote:
Interestingly I believe the bahaviour of Proc SQL in this regard changed in SAS v 9.2 or 9.3 - before then SAS would create an empty macro variable which is why you may see something like this work in old code on the web...
Nope. It has always worked this way. There are other ways than using a %LET to insure that the macro variable exists. You could use a %GLOBAL or %LOCAL statement to define the macro variable. Note that when using %LOCAL statement insdie of macro it works almost like using %let to initialize to empty since by default a new macro variable has no content and local macro variables are not remembered across mutliple calls. But a %GLOBAL statment will not re-initalize a macro variable that already exists and a global macro vairable will keep its value until reset or deleted.
... View more