Tess
Tess

Reputation: 47

Append one column below another

I want to append one column below another column. My dataset looks like the following:

date xy  ab   cd
1   1.5  3.1  4.8
2   4.3  8.5  1.0
3   7.7  9.1  7.7

I want to create a dataset which looks like this:

date id  price 
1    xy  1.5
2    xy  4.3
3    xy  7.7
1    ab  3.1
2    ab  8.5
3    ab  9.1
1    cd  4.8
2    cd  1.0
3    cd  7.7

Do you have an idea how I can handle this?

Upvotes: 0

Views: 510

Answers (1)

Pekka
Pekka

Reputation: 2448

Like this:

proc transpose data=indataname out=outdataname(rename=(_NAME_=id col1 = price));
    by date;
run;

Upvotes: 3

Related Questions