Advanced (Intro) to SAS Macro Programming (Part 3)
The First part and the Second part of this introduction talked about some basic things every beginner needs to know when using SAS Macro Language.
In this part we will talk about :
/* Calculating an average value and storing it in a macro variable*/
Proc Means Data = SASHELP.heart noprint;
Var height;
Output out = test mean= avg_height;
Run;
Proc SQL noprint;
Select avg_height into :var1
from test;
Quit;
%Put &var1;
In this part we will talk about :
- Dynamically storing a value into a macro variable
- Iterative statements in macro language (Next part)
- Conditional statements in macro language (Next part)
1-Dynamically storing a value into a macro variable
/* Calculating an average value and storing it in a macro variable*/Proc Means Data = SASHELP.heart noprint;
Var height;
Output out = test mean= avg_height;
Run;
Proc SQL noprint;
Select avg_height into :var1
from test;
Quit;
%Put &var1;