Brittany Enfield
Brittany Enfield

Reputation: 107

Using macro variables in SAS statements copied from %include

I have a SAS frame program that I intend to use to call a separate SAS script a number of times. Each time, the information the called SAS script will be different.

Can I set the values of macro variables in the frame program that can then be used by the called SAS script?

Upvotes: 2

Views: 668

Answers (1)

Sam Dickson
Sam Dickson

Reputation: 5239

Yes. If you set the macro variables prior to the %include statements, the macros called using %include will first look locally to resolve the macro variables and then look globally, which is where they will reside. There are four ways to create a macro variable, but the one you'll probably want to use is %let.

If you're interested in being able to use macro variables outside of the macro where they were created, then you'll have to use %global to initiate the macro variables.

Upvotes: 2

Related Questions