作者tevil (dd)
站内Statistics
标题Re: [程式] SAS macro的使用
时间Tue Mar 24 16:51:38 2015
※ 引述《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://webptt.com/cn.aspx?n=bbs/Statistics/M.1427187101.A.B6C.html
1F:→ tevil: CODE的细节上我怕会有错误,太久没用,手边也没有以前写的 03/24 16:52
※ 编辑: tevil (111.240.202.29), 03/24/2015 16:52:58
2F:推 tew: %macro 开头 %mend;结尾 03/24 18:38
3F:推 LittleMore: 非常谢谢你~^^ 有空时一定来试试看 03/26 08:59