由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 如何重复运行sas程序100次,并把100次的结果全部output?
相关主题
请教一个sas macro的问题用尽心思做好了一个macro
[合集] SAS 问题:如何在使用macro的时候保护data。Need advice on SAS macro debugging
how to make this macro work, thankshelp on a sas question
SAS call symput question急问:SAS batch submission with macro variable
macro问题诚心求教非常感谢SAS help...
SAS DATA 求助请教SAS split data的问题
How to Macro it in SAS?batch?
Stupid SAS programming style is driving me crazy....[合集] 一个sas问题
相关话题的讨论汇总
话题: normalt话题: data话题: running话题: run话题: output
进入Statistics版参与讨论
1 (共1页)
k******a
发帖数: 816
1
下面这段code运行可以实现运行一百次的目的,但是我不知道怎么把100次的结果全都
输出?查了library里面的normalt, 只显示一次的结果。非常感谢!
%MACRO RUNNING(iter);
%do i = 1 %to &iter;
DATA normalt;
*mean 3.2, standard deviation 0.3;
rnormalt=3.2+0.3*NORMAL(0);
output;
run;
%END;
%MEND RUNNING;
%RUNNING (100);
RUN;
s******r
发帖数: 1524
2
DATA normalt;
*mean 3.2, standard deviation 0.3;
do i =1 to 100;
rnormalt=3.2+0.3*NORMAL(0);
output;
end;
drop i;
run;
?

【在 k******a 的大作中提到】
: 下面这段code运行可以实现运行一百次的目的,但是我不知道怎么把100次的结果全都
: 输出?查了library里面的normalt, 只显示一次的结果。非常感谢!
: %MACRO RUNNING(iter);
: %do i = 1 %to &iter;
: DATA normalt;
: *mean 3.2, standard deviation 0.3;
: rnormalt=3.2+0.3*NORMAL(0);
: output;
: run;
: %END;

r******l
发帖数: 240
3
本人半瓶子醋。
Change your "DATA normalt" into "DATA normalt&inter", I think you will get
what you want.
Using your code, every time you run your program, the output data will write
over the data from the last run. That is why you only get one data when
you finish running your program.

【在 k******a 的大作中提到】
: 下面这段code运行可以实现运行一百次的目的,但是我不知道怎么把100次的结果全都
: 输出?查了library里面的normalt, 只显示一次的结果。非常感谢!
: %MACRO RUNNING(iter);
: %do i = 1 %to &iter;
: DATA normalt;
: *mean 3.2, standard deviation 0.3;
: rnormalt=3.2+0.3*NORMAL(0);
: output;
: run;
: %END;

l*********s
发帖数: 5409
4
the code is wrong; move the %do %to statement into the Macro.
1 (共1页)
进入Statistics版参与讨论
相关主题
[合集] 一个sas问题macro问题诚心求教非常感谢
请教一个SAS Macro问题。谢谢SAS DATA 求助
请教macro的一个小程序,How to Macro it in SAS?
How to the macro regression with if?Stupid SAS programming style is driving me crazy....
请教一个sas macro的问题用尽心思做好了一个macro
[合集] SAS 问题:如何在使用macro的时候保护data。Need advice on SAS macro debugging
how to make this macro work, thankshelp on a sas question
SAS call symput question急问:SAS batch submission with macro variable
相关话题的讨论汇总
话题: normalt话题: data话题: running话题: run话题: output