Based on some testing I just did in 9.2, it appears that some automatic macro variable can be declared to be local inside a macro. I tested sqlrc and SQL obs. Does anyone know of a comprehensive list of which automatics variables can be local?
Hmmm. You are correct. I will have to find it as the person who asked me this claimed that it was listed on the doc site as an automatic macro variable. But I just ran the same check you did and also checked dictionary tables and neither of these are automatic.
my "guess" is that any automatic macro variable to which you can assign a value, could be named on a %LOCAL
&syslast is an example I tried
438 %let syslast = something ;
439 %macro check1( name) ;
440 %local syslast ;
441 %let syslast = nothing ;
442 %put _local_ ;
443 %put &name = &&&name ;
444 %mend ;
445 %check1(syslast) ;
ERROR: Attempt to %LOCAL automatic macro variable SYSLAST.
CHECK1 NAME syslast
syslast = WORK.nothing
446 %put &syslast ;
So, that ERROR indicates a rule.
(which almosts demands an exception)
Automatic macro variables are created by the macro processor when you invoke SAS. All of them are global except for SYSPBUFF which is local. But, you won't see it listed with a "%put _local_" because that only lists user-generated local macro variables.
Of the automatic macro variables that can be assigned values, they still remain global no matter where you assign the new value...