DATA Step, Macro, Functions and more

create variable values from array variables

Accepted Solution Solved
Reply
Super Contributor
Posts: 271
Accepted Solution

create variable values from array variables

[ Edited ]
data want;
  array a_{*} a b c d;
  do i = 1 to dim(a_);
  	name = "a_{i}";
	output;
   end;
run;


data want;

name

a

d


Accepted Solutions
Solution
‎03-03-2017 01:32 PM
Trusted Advisor
Posts: 1,022

Re: create variable values from array variables

Posted in reply to SAS_inquisitive

Instead of

    name="a_{I}";

 

try

  name=vname(a_{I});

View solution in original post


All Replies
Solution
‎03-03-2017 01:32 PM
Trusted Advisor
Posts: 1,022

Re: create variable values from array variables

Posted in reply to SAS_inquisitive

Instead of

    name="a_{I}";

 

try

  name=vname(a_{I});

Super Contributor
Posts: 271

Re: create variable values from array variables

Thank you, mkeintz.
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 108 views
  • 1 like
  • 2 in conversation