看板 Statistics 關於我們 聯絡資訊
※ 引述《FSGuitar (fingerstyle)》之銘言: : 請問一下 : SAS有可能辦到 : 一個指令就把所有的variable都加上一個數字或字母在每一個variable後呢? : 謝謝 proc contents noprint data=work.yourfile out=b(keep=name); run; data _null_; set b nobs=x; call symputx('x',x); run; %macro addroot(a) ; %do i=1 %to &x; data _null_; set b; if _n_=&i then do; len=length(name); call symput('root',substr(name,1,len)); end; run; data a; set a; rename &root=&root&a; run; %end; %mend; %addroot(a); a可以任意修改成你要的字根 -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.45.194.205 ※ 編輯: tew 來自: 114.45.194.205 (09/03 01:09)
FSGuitar:感謝!! 09/05 19:23