全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1295 2
2017-01-19

各位大大求助:
id content
2015-01 a1
2015-01 b1
2015-01 c1
2015-02 a2
2015-02 b2
2015-02 c2
怎么将数据变成如下:
id1 content1 id2 content2
2015-01 a1 2015-02 a2
2015-01 b1 2015-02 b2
2015-01 c1 2015-02 c2

求助各位帮忙,感谢!!

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2017-1-19 15:38:30
proc sort data=test;
by id;
run;

data test1;
set test;
by id;
if first.id then order=0;
order+1;
run;

proc sort data=test1;
by order id;
run;

data test2;
set test1 end=last;
by order;
if first.order then num=0;
num+1;
if _n_=1 then call execute('data wanted;');
call execute('id'||cats(num)||'='||quote(strip(id))||';content'||cats(num)||'='||quote(strip(content))||';');
if last.order then call execute('output;');
if last then call execute('run;');
run;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-2-12 01:34:53
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群