作者LittleMore (LittleMore)
看板Statistics
標題[程式] SAS macro的使用
時間Thu Mar 19 15:08:40 2015
[軟體程式類別]: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;
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.167.88.158
※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1426748923.A.772.html
※ 編輯: LittleMore (1.167.88.158), 03/19/2015 15:12:24
→ MOONY135: i=1:8 day=i*5 03/19 17:14
→ LittleMore: 謝謝提供 但我試不成功 來徒手煉鋼了~~ 03/19 18:43
推 tew: event study? 03/20 19:39
推 svin: 你會用%do loop, 不要宣告day 該成用%do i = 1 %to 5就ok 03/20 23:14
→ LittleMore: 我有空再試試看 好像可以直接在LOOP後面多加BY5解決 03/29 18:43