作者sheiswe (no matter)
看板Statistics
标题[问题] 遇到一个retain的问题
时间Thu May 28 10:16:45 2015
想续填入资料,又想避开不同的编码~
原始资料格式是这样:
data aa_table;
code Ind_15 Ind_71 Ind_389 new_389
211000 21 211 211000 All
211000
211000
211111
211111
211111
211111
211112 211 2111 211100 Other
211112
211112
211112
211112
212000 21 212 212000 Food
212000
data code_table; set aa_table;
retain name_389 new_389;
if name_389^='' then new_389=name_389;
run;
retain後会是这样:
code Ind_15 Ind_71 Ind_389 new_389 name_389
211000 21 211 211000 All
211000 All
211000 All
211111 All <<<这里要如何能让它不要填入,保持空值?
211111 All <<<这里不要填入
211111 All <<<这里不要填入
211111 All <<<这里不要填入
211112 211 2111 211100 Other
211112 Other
211112 Other
211112 Other
211112 Other
212000 21 212 212000 Food
212000 Food
不知道大大们有甚麽方法可以做到?恳求解...谢谢~:'(
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.113.33.218
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Statistics/M.1432779408.A.DF7.html
1F:→ st410614: data code_table; set aa_table; 05/28 22:20
2F:→ st410614: by code; 05/28 22:20
3F:→ st410614: if first.code then name_389=new_389; 05/28 22:21
4F:→ st410614: retain name_389; run; 05/28 22:21
5F:→ sheiswe: 可以了~谢谢大大^^ 06/04 16:14