DATA Step, Macro, Functions and more

Array processing, getting the variable name from an array element?

Reply
Contributor
Posts: 20

Array processing, getting the variable name from an array element?

In Data step processing, is there a way to get the variable name from the array element
so like this
data t;
a=1;
b=2;
c=3;
array cols{*} a--c;
do i=1 to dim(cols);

if cols(i) ='a' then .....
end;

where you want the var name not the value?
thanks

run;
Super Contributor
Posts: 359

Re: Array processing, getting the variable name from an array element?

look at vname and vnamex
Contributor
Posts: 20

Re: Array processing, getting the variable name from an array element?

Exactly, thanks
Ask a Question
Discussion stats
  • 2 replies
  • 140 views
  • 0 likes
  • 2 in conversation