楼主: aicnzheng
2223 3

[问答] 请教如何用宏循环读取同一个表中的同一类型的很多变量并执行同一段程序 [推广有奖]

  • 0关注
  • 0粉丝

大专生

55%

还不是VIP/贵宾

-

威望
0
论坛币
430 个
通用积分
1.6405
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
437 点
帖子
27
精华
0
在线时间
64 小时
注册时间
2015-11-16
最后登录
2023-7-22

20论坛币
请教:
有一个表中有同类型的C15、C16 、C1821 、C22 、C25、C34、 C4041、 C50 、C53、 C71 、C9195共11个变量,需要放在event后面运行下面同一个程序,并且以相应的C名来命名生成的结果,请问如何编宏,谢谢!!

proc stdrate data=jisuan11.all
             refdata=jisuan11.y2000cn
             method=direct  /*   requests direct standardization  */
             stat=rate(mult=10000)  /* specifies the rate statistic for standardization */
             /* effect  computes the rate effect between the study populations with the default rate ratio statistics */
       ;
  population  event=C1 total=Pel ;
   reference  total=Pel;
   strata Sex Age / effect;
run;

如果能把结果输出到一个表中那就更好了!!!

关键词:多变量 如何用 宏循环 Populations Population
沙发
l1i2n3i4n5g 在职认证  发表于 2017-8-21 09:11:47 |只看作者 |坛友微信交流群
%macro test(c);
proc stdrate data=jisuan11.all
             refdata=jisuan11.y2000cn
             method=direct  /*   requests direct standardization  */
             stat=rate(mult=10000)  /* specifies the rate statistic for standardization */
             /* effect  computes the rate effect between the study populations with the default rate ratio statistics */
       ;
  population  event=&c total=Pel ;
   reference  total=Pel;
   strata Sex Age / effect;
run;
%mend;

%test(C15)
%test(C16)
这样是不是就行了?

使用道具

藤椅
aicnzheng 发表于 2017-8-21 10:01:39 |只看作者 |坛友微信交流群
l1i2n3i4n5g 发表于 2017-8-21 09:11
%macro test(c);
proc stdrate data=jisuan11.all
             refdata=jisuan11.y2000cn
不行啊,运行之后没有输出。

使用道具

板凳
我是小肚肚 发表于 2017-8-24 09:58:14 |只看作者 |坛友微信交流群
这几个变量编成数组 用循环做

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-24 21:04