f*****a 发帖数: 693 | 1 1. the macro variables CITY1 through CITY10 contain the respective values
Cary, New York, Chicago, Los Angeles, Austin, Boston, Orlando, Dallas,
Knoxville, and Asheville:
%macro listthem;
%do n=1 %to 10; &&city&n
%end;
%mend listthem;
%put %listthem;
Q: Why ";" is not needed after &&city&n ?
2. Sorry, no data for this one:
%macro sepfeature;
%do i=1 %to &n;
data &&type&i (drop=type);
set features;
***********************************
if type="&&type&i";
***********************************
r | a****3 发帖数: 11741 | 2 Q1, I have never seen such coding before. sorry, don't know.
for Q2: In Macro, you have to use " " to refer the parameter so that macro will
recognize the value of your parameter, then put into type. otherwise, it
will return &&type&i instead of the value that the parameter refers to. | b******e 发帖数: 539 | 3 For your first question:
if you put ';' there, in the intermediate step, your code resolves to
something like:
%put &&city1; &&city2; ...; &&city10;;
which is an invalid statement after the first ';' | f*****a 发帖数: 693 | |
|