What is the difference between %LOCAL and %GLOBAL?
Copy/paste the exact words below into a Google search:
sas What is the difference between %LOCAL and %GLOBAL
Also search for macro variable scope.
They both are used to make sure macro variables are defined. The difference is where they are defined. %GLOBAL will define them in the global symbol table. %LOCAL will define them in the symbol table for the currently running macro. Once the current macro finishes running its symbol table disappears.
% Local is a macro variable defined inside a macro. %Global is a macro variable defined in open code (outside the macro or can use anywhere).
Incorrect. local or global indicates the scope of the macro variable. You can create global macros within a macro for instance. The default for macro variables created within a macro is local to the macro, however you can explicitly state the macro variable is global, and hence make it available outside. As that doesn't really work with encapsulation, so default is local.
There is clear guidance in the documentation about this:
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.