BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SAS_inquisitive
Lapis Lazuli | Level 10
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

1 ACCEPTED SOLUTION

Accepted Solutions
mkeintz
PROC Star

Instead of

    name="a_{I}";

 

try

  name=vname(a_{I});

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

View solution in original post

2 REPLIES 2
mkeintz
PROC Star

Instead of

    name="a_{I}";

 

try

  name=vname(a_{I});

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
SAS_inquisitive
Lapis Lazuli | Level 10
Thank you, mkeintz.
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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