Base SAS 5
The following SAS program is submitted:
data work.sets;
do until (prod gt 6);
prod + 1;
end;
run;
Which one of the following is the value of the variable PROD in the output
data set?
A. 5
B. 6
C. 7
D. 8
Click Comment link to get answer
答案是7。我有点不清楚这个7具体指的是什么?
(1)DOUNTIL一直到prod=6 prod+1=6+1=7
(2)dountil一直到检查到prod=7才会不执行,prod=7
请问这里的value of prod in the output是指第一种还
是第二种,我觉得是第一。因为这里指的是outputdata.
求教!谢谢!
n***8 发帖数: 39
2
do until 是先做再检查,从(1)到(2)。
B*H 发帖数: 10
3
第一种. do until 不累加. If prod + 1 is not included, the program will run
forever.
【在 r**********y 的大作中提到】 : Base SAS 5 : The following SAS program is submitted: : data work.sets; : do until (prod gt 6); : prod + 1; : end; : run; : Which one of the following is the value of the variable PROD in the output : data set? : A. 5