SAS中文论坛

标题: TWO QUESTIONS ABOUT DO UNTIL STATEMENT [打印本页]

作者: shiyiming    时间: 2006-4-27 15:36
标题: TWO QUESTIONS ABOUT DO UNTIL STATEMENT
PROGRAM1:
data work.test;
        x=10;
        do until(x>12);                     
           a+1;output;
        end;  
     run;
proc print;run;

Why SAS system always displays 'data step running' after submited the program1?

PROGRAM2:
data work.test;
        x=11.5;
        do until(x>12);                     
           x+1;output;
        end;  
     run;
proc print;run;

OUTPUT2:
Obs x
1 12.5

Suppose the DO UNTIL steps below:
step1:x=11.5,x>12 is false, then x+1=12.5;
step2:x=12.5,x>12 is ture, then end DO UNTIL statement,executes next statement.

PROGRAM3:
data work.test;
        x=12.5;
        do until(x>12);                     
           x+1;output;
        end;  
     run;
proc print;run;

OUTPUT3:
Obs x
1 13.5

What is the DO UNTIL steps of program2?
作者: shiyiming    时间: 2006-4-27 16:17
标题: 莫非是……
I  think that at the beginning of Do Until statement, the default value of the expression(x>12) is false always.
kaka......
作者: shiyiming    时间: 2006-4-27 16:28
标题: hoho
abc...........................xyz
作者: shiyiming    时间: 2006-4-27 21:27
标题: 最终在DO WHILE中找到了答案
问题得到解决。




欢迎光临 SAS中文论坛 (http://mysas.net/forum/) Powered by Discuz! X3.2