楼主: zhou.wen
3369 15

[原创博文] Hashing,the best tool for Searching [推广有奖]

11
zhou.wen 发表于 2013-5-27 09:24:24
The hashing method
  1. data out;
  2. if 0 then set b;
  3. if (_n_=1) then do;
  4. declare hash myhash;
  5. myhash=_new_ hash(dataset:"b");
  6. rc=myhash.definekey("key");
  7. rc=myhash.definedata(all:"yes");
  8. myhash.definedone();
  9. end;
  10. set a;
  11. key=scan(type,1,',');
  12. rc=myhash.find();
  13. if rc=0 then types=data;
  14. mun=count(type,",")+1;
  15. do i=2 to mun;
  16. key=scan(type,i,',');
  17. rc=myhash.find();
  18. if rc=0 then do;       
  19.         types=trim(types)||','||data;
  20. end;
  21. end;
  22. keep id type types;
  23. run;
复制代码
已有 1 人评分学术水平 热心指数 信用等级 收起 理由
zll_zh + 1 + 1 + 1 good

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

Practice Is The Best Teacher!

12
swisssl 发表于 2013-5-27 10:53:26
为嘛没人告诉我matlab 和 R哪个更好啊。。。

13
萧景夜瞳 发表于 2013-5-27 12:05:55
let me first learn the code...

14
hnmjx 发表于 2013-5-27 12:15:23
这个有点意思。

15
zll_zh 发表于 2013-5-27 12:38:13
hasing

16
benbenbenwen 发表于 2013-5-27 12:46:43
学习了

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

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