Re: [問題] SAS程式碼問題

看板Statistics作者 (咖啡王子)時間13年前 (2012/09/03 01:08), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串3/4 (看更多)
※ 引述《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)

09/05 19:23, , 1F
感謝!!
09/05 19:23, 1F
文章代碼(AID): #1GGvAXCu (Statistics)
文章代碼(AID): #1GGvAXCu (Statistics)