Your statement
tree_ = &trees;
is resolving to
tree_ = '999', '888', '111', '222', '555', '876', '564', '109','456', '543', '897', '009', '321' ;
similarly
hl(i) ne &trees is
hl(i) ne '999', '888', '111', '222', '555', '876', '564', '109','456', '543', '897', '009', '321'
If you don't know why either of those is an error you need to review a lot of basics before attempting to use macro variables.
I have no idea what you are attempting to do with the tree_ = . If you are attempting to use R like syntax to assign values to the array then that is not going to work.
Using instead of the comparison this:
hl(i) not in ( &trees) then
might work if you want to find out that a single value of the array does not appear in the list.
And then
tree = whichc('&trees', of hl(*))>0;
first has a problem because
whichc('&trees' resolves to nothing. it uses the literal value &trees because macro variables do not resolve at all inside single quotes.
If you used whichc("&trees" then the whichc would be looking for the entire value "'999', '888', '111', '222', '555', '876', '564', '109','456', '543', '897', '009', '321' " to be in a single value of the one of the array elements.
You need to describe exactly what you are attempting to do. Best would be to show code that worked before you added in any macro variables. If you don't have such code, then that is the first thing you need to do.
... View more