is there a short way to make ALL macro variables created inside a macro global in scope?
ie:
%macro x; %global _all_; * ??? ; %let x=1; %let y=1; %let z=1; %mend;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The only way I can think of to do this without having to declare each macro as global ahead of time and then do a %let statement is to use a macro in place of the %let statement.
In the code below, I create a macro called %mylet which has as its sole purpose the task of creating a global variable with the name and value I pass as arguments. I then use this macro in place of %let everywhere I want global variables defined.
eg.
would become…