楼主: dandan_9075
3489 27

[原创博文] 怎么让输出结果不留空 [推广有奖]

21
dandan_9075 在职认证  发表于 2012-5-16 16:45:37
sunset1986 发表于 2012-5-16 09:01
首先呢,您先来研究一下这两个程序的区别,然后可能自己就figure out了,呵呵
简单的说,retain是帮助获取 ...
谢谢你的细心帮助

22
dandan_9075 在职认证  发表于 2012-5-16 17:03:58
sunset1986 发表于 2012-5-16 09:11
当楼主研究清楚上面两个程序的区别后,再来运行一下下面这个程序,我把它分段化执行了,注意看log,然后琢磨 ...
谢谢哈  看懂retain的含义了,  非常感谢你的热心帮助

23
sunset1986 发表于 2012-5-17 08:53:50
dandan_9075 发表于 2012-5-16 17:03
谢谢哈  看懂retain的含义了,  非常感谢你的热心帮助
别客气~交流 才是 王道,呵呵
An honest tale speeds best being plainly told.
Cheers!

24
mccinfo 发表于 2012-5-20 12:06:38
excel做的花,选中第一列的空值单元格(alt+;)然后输入=,按一下 向上键,最后 ctrl+enter 搞定。很实用的方法。

25
madkoala 发表于 2012-5-27 22:17:13
9楼威武

26
tj0412ymy 发表于 2012-5-28 10:49:24
  1. data test;
  2. do urban=1 to 3;
  3.         if urban=1 then do age=1 to 5;
  4.                            do i=1 to 20;
  5.                        y=20 + 10*rannor(0);
  6.                        output;
  7.                 end;
  8.         end;
  9.    if urban=2 then do age=2 to 3;
  10.                              do i=1 to 20;
  11.                        y=20 + 10*rannor(0);
  12.                        output;
  13.                 end;
  14.         end;
  15.         if urban=3 then do age=2 to 4;
  16.                    do i=1 to 20;
  17.                        y=20 + 10*rannor(0);
  18.                        output;
  19.                 end;
  20.         end;
  21. end;
  22. drop i;
  23. run;

  24. data test1;
  25. set test end=EOF;output;
  26. if eof=1 then do urban=1 to 3;
  27. do age=1 to 5;
  28. y=.;output;
  29. end;end;
  30. run;
  31. options missing=0;
  32. proc sql;
  33. select urban,age,mean(y) as y
  34. from test1
  35. group by urban,age
  36. ;
  37. quit;
复制代码
对SAS和统计方面感兴趣的朋友,请加SAS学习和认证讨论群:169157207。欢迎在群上讨论!

27
yongjiang2 发表于 2012-5-28 17:59:11
data a ;
        input urban age y;
cards;
1 4 6
. 5 2
. 1 60
2 2 4
. 4 6
. 5 9
3 2 8
. 8 9
. 5 6
;
run;
data a1;
        set a;
retain urban1;
if urban ne . then urban1=urban;
    else urban=urban1;
drop urban1;
run;
试试看.....

28
ryuuzt 发表于 2012-6-1 09:15:44
ntsean 发表于 2012-5-9 00:21
我来无聊一把

data test;
不错,很好很强大。
谢谢。

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-8 14:32