title "Total Sales for 2002"; data perm.sales2002; set perm.sales; if year(enddate)=2002; run; proc print data=perm.sales2002; run;Then, you might need to change the references in your program in order to reference a different variable, data set, or text string. Especially if your programs are lengthy, scanning for specific references and updating them manually can take a lot of time, and it is easy to overlook a reference that needs to be updated.
title "Total Sales for 2001"; data perm.sales2001; set perm.sales; if year(enddate)=2002; run; proc print data=perm.sales2001; run;
%let year=2002; title "Total Sales for &year"; data perm.sales&year; set perm.sales; if year(enddate)=&year; run; proc print data=perm.sales&year; run;
amount
from the global symbol table
that is represented above, you place &amount
in
your program, as follows:
data new;
set perm.mast;
where fee>&amount;
run;
proc print;
run; |
Code After Substitution
data new;
set perm.mast;
where fee>975;
run;
proc print;
run; |
city
in a title, you must use double
quotation marks to enclose the title text in the TITLE statement,
as follows: title "Students from &city";