SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

How to transfer dataset into array?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 17
Accepted Solution

How to transfer dataset into array?

Hi every oneSmiley Happy

I have a dataset, with variable v1 v2 and Rev, see below:

V1V2Rev
0.010.01453
0.010.02564
0.010.032354
0.020.01754
0.020.023534
0.020.031213
0.030.01435
0.030.0223
0.030.03543

now I would like to transfer dataset into an array: 

v2
v10.010.020.03
0.014535642354
0.0275435341213
0.0343523543

How could i accomplish that? should I use array? is there any procedure better than array?

Great Thanks,

Jenny



Accepted Solutions
Solution
‎04-20-2014 11:23 AM
Super User
Super User
Posts: 7,076

Re: How to transfer dataset into array?

Not sure what you mean by an array.  You could use PROC TRANSPOSE, but then the numbers that you have in V2 will be turned into variable names.

proc transpose data=have out=want ;

  by v1 ;

  id v2 ;

  var rev ;

run;

View solution in original post


All Replies
Solution
‎04-20-2014 11:23 AM
Super User
Super User
Posts: 7,076

Re: How to transfer dataset into array?

Not sure what you mean by an array.  You could use PROC TRANSPOSE, but then the numbers that you have in V2 will be turned into variable names.

proc transpose data=have out=want ;

  by v1 ;

  id v2 ;

  var rev ;

run;

🔒 This topic is solved and locked.

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

Discussion stats
  • 1 reply
  • 282 views
  • 1 like
  • 2 in conversation