Skip to content

Instantly share code, notes, and snippets.

@RasanenTapio
Created November 10, 2014 19:38
Show Gist options
  • Save RasanenTapio/ab711d3c5650cfe45c41 to your computer and use it in GitHub Desktop.
Save RasanenTapio/ab711d3c5650cfe45c41 to your computer and use it in GitHub Desktop.
Macro variables: Local and global scope - example
/* Some easy ways for debugging macro variables.
Here are some commands to put macro variables to log:
%PUT _ALL_;
%Put _GLOBAL_;
%Put _LOCAL_;
*/
%Global Number1;
%Let Number1 = 100;
/* Print all macro variables to log */
%PUT All macro variables;
%PUT _ALL_;
%Macro TestVariables;
%LOCAL Number1;
%LET Number1 = 99;
/* Make a copy out of SASHELP.Vmacro-view */
data MyMacros;
set SASHELP.Vmacro;
run;
%PUT All local variables;
%PUT _LOCAL_;
%Mend TestVariables;
%TestVariables
/* Destroy global variable */
%SYMDEL Number1;
%PUT Variables?;
%PUT _GLOBAL_;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment