t*********l 发帖数: 778 | |
S********a 发帖数: 359 | 2 比如什么。。
【在 t*********l 的大作中提到】 : 有人有同感吗? : 为什么每次用总是很别扭?
|
t*********l 发帖数: 778 | 3 bear with my Cainiao question;
for example, how to build a two dimention array with all zero at first and
later assign the values into individule cells? |
S********a 发帖数: 359 | 4 菜鸟回答啊
你说的是iml吧
【在 t*********l 的大作中提到】 : bear with my Cainiao question; : for example, how to build a two dimention array with all zero at first and : later assign the values into individule cells?
|
c*****m 发帖数: 4817 | 5 array去掉也成立
【在 t*********l 的大作中提到】 : 有人有同感吗? : 为什么每次用总是很别扭?
|
P****D 发帖数: 11146 | 6 你这种情况还是用PROC IML吧。
【在 t*********l 的大作中提到】 : bear with my Cainiao question; : for example, how to build a two dimention array with all zero at first and : later assign the values into individule cells?
|
t*********l 发帖数: 778 | 7 proc iml;
x = j(100,100,0);
do i = 1 to 100;
do j=1 to 100;
x[i,j] = n_&i._&j;
end;
end;
quit;
为什么这个不work呢? |
o****o 发帖数: 8077 | 8 其实习惯了就好,SAS的数组挺好用,也很有用
试试这个代码,看看结果是啥:
data _null_;
array _x{5, 4} _temporary_ (20*0);
put "NOTE: " @8 _x[3, 2]= 7.2;
run;
试完了以后,再看看这个的结果,这样你对SAS数组的实现有更好的理解
data _null_;
array _x{5, 4} _temporary_ (10*0);
do i=1 to 5;
do j=1 to 4;
put "NOTE: " @8 i= j= _x[i, j]= 7.2;
end;
end;
run;
有包子么?谢了
【在 t*********l 的大作中提到】 : bear with my Cainiao question; : for example, how to build a two dimention array with all zero at first and : later assign the values into individule cells?
|
t*********l 发帖数: 778 | 9 o大虾每次都给好code,给个包子不成谢意
【在 o****o 的大作中提到】 : 其实习惯了就好,SAS的数组挺好用,也很有用 : 试试这个代码,看看结果是啥: : data _null_; : array _x{5, 4} _temporary_ (20*0); : put "NOTE: " @8 _x[3, 2]= 7.2; : run; : 试完了以后,再看看这个的结果,这样你对SAS数组的实现有更好的理解 : data _null_; : array _x{5, 4} _temporary_ (10*0); : do i=1 to 5;
|
k*****u 发帖数: 1688 | 10 33 data _null_;
34 array _x{5, 4} _temporary_ (20*0);
35 put "NOTE: " @8 _x[3, 2]= 7.2;
36 run;
NOTE: _x[3,2]=0.00
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
为什么赋值以后还是0尼? |
o****o 发帖数: 8077 | 11 because it was assigned to be 0.
【在 k*****u 的大作中提到】 : 33 data _null_; : 34 array _x{5, 4} _temporary_ (20*0); : 35 put "NOTE: " @8 _x[3, 2]= 7.2; : 36 run; : NOTE: _x[3,2]=0.00 : NOTE: DATA statement used (Total process time): : real time 0.00 seconds : cpu time 0.00 seconds : 为什么赋值以后还是0尼?
|
k*****u 发帖数: 1688 | |
o****o 发帖数: 8077 | 13 format
【在 k*****u 的大作中提到】 : 那那个7.2是赋值还是format啊?
|
k*****u 发帖数: 1688 | |