Append one column below another

2019-09-09 03:31发布

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?

标签: sas
1条回答
Root(大扎)
2楼-- · 2019-09-09 03:49

Like this:

proc transpose data=indataname out=outdataname(rename=(_NAME_=id col1 = price));
    by date;
run;
查看更多
登录 后发表回答