SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Improving Program Efficiency with Macro Variables
Creating Your Own Macro Variables


Question: Which DATA step below correctly references the macro variable site? The value of site is used to create the data set name Westprod and to select observations where the value of region is west.

 
%let site=west;
data &site.prod;
   set reg.productn;
   if region='&site';
run;
 
%let site=west;
data &site.prod;
   set reg.productn;
   if region="&site";
run;
 
%let site=west;
data &siteprod;
   set reg.productn;
   if region='&site';
run;



  back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement