看板 Statistics 關於我們 聯絡資訊
※ 引述《LittleMore (LittleMore)》之銘言: : [軟體程式類別]:sas : [程式問題]:macro的使用 : [軟體熟悉度]:低(1~3個月) : [問題敘述]: : 我有一筆資料 需要抓出5天、10天資料....到40天 : 但用手動更改太慢 我想請問要如何改成marco使用 : 以往我只會用%do i=1 %to 10 : %let day=5; : /*抓出五天*/ : data temp_5d; : set temp; : if time<=&day and time>0; : run; 年代太久遠code細節有點忘只能看幫不幫的了 macro test(day); data temp_&day.d; set temp; if time <=&day. and time >0; run; %macro (這邊非常不確定就是結速macro的意思) test(5) 這邊會建立一個temp_5d的檔案,也是5天的結果 test(10) temp_10d 10天 test(20) 同理 只要改裏面數字就好 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.240.202.29 ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1427187101.A.B6C.html
tevil: CODE的細節上我怕會有錯誤,太久沒用,手邊也沒有以前寫的 03/24 16:52
※ 編輯: tevil (111.240.202.29), 03/24/2015 16:52:58
tew: %macro 開頭 %mend;結尾 03/24 18:38
LittleMore: 非常謝謝你~^^ 有空時一定來試試看 03/26 08:59