楼主: Wo_si_鍕
1332 2

关于转置处理数据 [推广有奖]

  • 0关注
  • 1粉丝

大专生

53%

还不是VIP/贵宾

-

威望
0
论坛币
789 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
741 点
帖子
33
精华
0
在线时间
36 小时
注册时间
2014-11-3
最后登录
2018-9-18

楼主
Wo_si_鍕 发表于 2017-1-19 14:59:27 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

各位大大求助:
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

求助各位帮忙,感谢!!

二维码

扫码加我 拉你入群

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

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

关键词:处理数据 Content con ten content

回帖推荐

wwang111 发表于2楼  查看完整内容

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) ...

沙发
wwang111 发表于 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;

藤椅
Claire230 发表于 2017-2-12 01:34:53

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-24 00:03