Re: [程式] SAS macro的使用
※ 引述《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
→
03/24 16:52, , 1F
03/24 16:52, 1F
※ 編輯: tevil (111.240.202.29), 03/24/2015 16:52:58
推
03/24 18:38, , 2F
03/24 18:38, 2F
推
03/26 08:59, , 3F
03/26 08:59, 3F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):