|
1) Passing the values to a array of macro variables (ivar1 ivar2 ... in the example below)
2) retrieving values with solving the reference of &&ival&i given i=1,2,3,... that is the list of 1,3,10 ... in example below.
31 %macro loop_irregular_value(dummy);
32 data t1;
33 do i=1,3,10,2,8,6;
34 n+1;
35 call symputx(catt('ival',n),i);
36 end;
37 call symputx('cnt_i',n);
38 run;
39
40 %put retrieve values start here::;
41 %do i=1 %to &cnt_i;
42 %put &&ival&i;
43 %end;
44 %put retrieve values end here::;
45 %mend;
46
47 %loop_irregular_value(dummy)
NOTE: The data set WORK.T1 has 1 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
retrieve values start here::
1
3
10
2
8
6
retrieve values end here::
|