經(jīng)管之家送您一份
應(yīng)屆畢業(yè)生專屬福利!
求職就業(yè)群
經(jīng)管之家聯(lián)合CDA
送您一個全額獎學金名額~ !
感謝您參與論壇問題回答
經(jīng)管之家送您兩個論壇幣!
+2 論壇幣
請有高見的大蝦出來討論和賜教!
- data test;
- input id $ name $ 14. age;
- cards;
- 001 張三,李四,王五 25
- 002 趙六,甲乙 30
- ;
- run;
- data test1;
- retain id age;
- set test;
- do i=1 to countc(name,',')+1;
- name1=scan(name,i,',');
- output;
- end;
- drop i name;
- run;
復(fù)制代碼- data aa;
- input ID name $;
- cards;
- 1001 ABC
- 1002 ABCD
- 1003 ABCDE
- ;
- run;
- data bb;
- retain id;
- set aa;
- do i=1 to length(name);
- do j=i to length(name);
- name1=substr(name,i,j-i+1);
- output;
- end;
- end;
- drop i j name;
- run;
- proc sql;
- create table cc as
- select distinct a.id as id1, b.id as id2, count(a.name1=b.name1) as com
- from bb as a, bb as b
- where a.id<b.id and a.name1=b.name1
- group by a.id, b.id
- ;
- create table dd as
- select *,length(name) as len
- from aa
- ;
- create table ee as
- select a.id1, a.id2, b.len as len1, a.com
- from cc as a, dd as b
- where a.id1=b.id
- ;
- select a.id1, a.id2, a.len1, b.len as len2, a.com
- from ee as a, dd as b
- where a.id2=b.id
- ;
- quit;
復(fù)制代碼
掃碼加我 拉你入群
請注明:姓名-公司-職位
以便審核進群資格,未注明則拒絕
|