Created
November 10, 2014 19:38
-
-
Save RasanenTapio/ab711d3c5650cfe45c41 to your computer and use it in GitHub Desktop.
Macro variables: Local and global scope - example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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